summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2014-12-10 17:14:29 (GMT)
committeralbert-github <albert.tests@gmail.com>2014-12-10 17:14:29 (GMT)
commit05eb230757f6510d461bd14df3b190da46edd9dc (patch)
tree05c94ee9242d0f47869696b8861fdfc38a29f68f /src/rtfgen.cpp
parentdc37f6c2a42740e6cbd79d1e6c758c5cbc1f10f7 (diff)
downloadDoxygen-05eb230757f6510d461bd14df3b190da46edd9dc.zip
Doxygen-05eb230757f6510d461bd14df3b190da46edd9dc.tar.gz
Doxygen-05eb230757f6510d461bd14df3b190da46edd9dc.tar.bz2
Add source code possibility for RTF output
Analogous to Latex and HTML output the possibility to have source code shown in RTF output is created. Based on question: http://doxygen.10944.n7.nabble.com/RTF-lack-of-source-code-tc6936.html
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index c0dca5b..354469b 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -66,6 +66,7 @@ RTFGenerator::RTFGenerator() : OutputGenerator()
m_bstartedBody = FALSE;
m_omitParagraph = FALSE;
m_numCols = 0;
+ m_prettyCode=Config_getBool("RTF_SOURCE_CODE");
}
RTFGenerator::~RTFGenerator()
@@ -539,6 +540,8 @@ 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");
+
switch (is)
{
case isTitlePageStart:
@@ -810,6 +813,11 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
t << fd->getOutputFileBase();
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
+ {
+ t << "\\par " << rtf_Style_Reset << endl;
+ t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ }
isFirst=FALSE;
}
else
@@ -819,6 +827,11 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"";
t << fd->getOutputFileBase();
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ if (sourceBrowser && m_prettyCode && fd->generateSourceFile())
+ {
+ t << "\\par " << rtf_Style_Reset << endl;
+ t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"" << fd->getSourceFileBase() << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
+ }
}
}
}