diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:52:56 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-15 10:52:56 +0900 |
commit | dcd93df0217323e30905987ff42937c10e512c1a (patch) | |
tree | 2d6f454acb7fd25f3605f4878f752241992efe36 /src/rtfgen.cpp | |
parent | 0efe600d6f0659af7bae9047301dd60983e18a6e (diff) | |
download | doxygen-dcd93df0217323e30905987ff42937c10e512c1a.tar.gz doxygen-dcd93df0217323e30905987ff42937c10e512c1a.tar.bz2 doxygen-dcd93df0217323e30905987ff42937c10e512c1a.zip |
Imported Upstream version 1.8.11upstream/1.8.11
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 7baaa3c..749f57b 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -541,6 +541,7 @@ void RTFGenerator::endIndexSection(IndexSections is) bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); + static QCString projectName = Config_getString("PROJECT_NAME"); switch (is) { @@ -549,7 +550,7 @@ void RTFGenerator::endIndexSection(IndexSections is) // User has overridden document title in extensions file t << "}" << rtf_title; else - t << "}" << Config_getString("PROJECT_NAME"); + t << "}" << projectName; break; case isTitlePageAuthor: { @@ -578,7 +579,17 @@ void RTFGenerator::endIndexSection(IndexSections is) } t << rtf_Style_Reset << rtf_Style["Title"]->reference << endl; // set to title style - t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt TITLE}}\\par" << endl; + if (rtf_title) + // User has overridden document title in extensions file + t << "{\\field\\fldedit {\\*\\fldinst " << rtf_title << " \\\\*MERGEFORMAT}{\\fldrslt " << rtf_title << "}}\\par" << endl; + else + { + DocText *root = validatingParseText(projectName); + t << "{\\field\\fldedit {\\*\\fldinst TITLE \\\\*MERGEFORMAT}{\\fldrslt "; + writeDoc(root,0,0); + t << "}}\\par" << endl; + + } t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to title style t << "\\par\n"; @@ -593,10 +604,14 @@ void RTFGenerator::endIndexSection(IndexSections is) t << "\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\\par\n"; t << rtf_Style_Reset << rtf_Style["SubTitle"]->reference << endl; // set to subtitle style - t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl; - t << "Version " << Config_getString("PROJECT_NUMBER") << "\\par"; + if (rtf_author) + t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt "<< rtf_author << " }}\\par" << endl; + else + t << "{\\field\\fldedit {\\*\\fldinst AUTHOR \\\\*MERGEFORMAT}{\\fldrslt AUTHOR}}\\par" << endl; + + t << theTranslator->trVersion() << " " << Config_getString("PROJECT_NUMBER") << "\\par"; t << "{\\field\\fldedit {\\*\\fldinst CREATEDATE \\\\*MERGEFORMAT}" - "{\\fldrslt CREATEDATE}}\\par"<<endl; + "{\\fldrslt "<< dateToString(FALSE) << " }}\\par"<<endl; t << "\\page\\page"; DBG_RTF(t << "{\\comment End title page}" << endl) @@ -2363,7 +2378,7 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl // files because the first line before the body // ALWAYS contains "{\comment begin body}" int len; - do + for(;;) { lineBuf.resize(maxLineLength); if ((len=f.readLine(lineBuf.rawData(),maxLineLength))==-1) @@ -2372,8 +2387,9 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl return FALSE; } lineBuf.resize(len+1); + if (lineBuf.find("\\comment begin body")!=-1) break; if (bIncludeHeader) encodeForOutput(t,lineBuf.data()); - } while (lineBuf.find("\\comment begin body")==-1); + } lineBuf.resize(maxLineLength); @@ -2590,6 +2606,7 @@ bool RTFGenerator::preProcessFileInplace(const char *path,const char *name) if (!outf.open(IO_WriteOnly)) { err("Failed to open %s for writing!\n",combinedName.data()); + QDir::setCurrent(oldDir); return FALSE; } FTextStream outt(&outf); @@ -2680,6 +2697,7 @@ void RTFGenerator::startSimpleSect(SectionTypes,const char *file,const char *anc void RTFGenerator::endSimpleSect() { DBG_RTF(t << "{\\comment (endSimpleSect)}" << endl) + m_omitParagraph = FALSE; newParagraph(); decrementIndentLevel(); m_omitParagraph = TRUE; |