summaryrefslogtreecommitdiffstats
path: root/src/rtfgen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-09 18:55:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-24 14:08:14 (GMT)
commit0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6 (patch)
treef3af0df1bd26f367220386ab4e011a27c9b341fd /src/rtfgen.cpp
parent8b3efba55c297d9af5274bf525e53417b78e8be3 (diff)
downloadDoxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.zip
Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.gz
Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.bz2
Refactoring: OutputList & OutputGen
- Initialized member variables inside the class - Added copy & assign operators for OutputGenerator and Derived classes. - throw a runtime exception when OutputGenerator is copied while is file is still in progress. - Added clone method to make a copy of OutputList. - Moved the implementation of enable() & disable() and friend into OutputGen instead of having the same implementation in each derived class. - Made m_dir and m_fileName readonly (members dir() and fileName()) - Removed call to new while adding generators to OutputList - Replaced QStack by std::stack for the "enabled" state.
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r--src/rtfgen.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 9d0a957..dff4cdd 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -63,16 +63,23 @@ static QCString dateToRTFDateString()
return result;
}
-RTFGenerator::RTFGenerator() : OutputGenerator()
+RTFGenerator::RTFGenerator() : OutputGenerator(Config_getString(RTF_OUTPUT))
{
- m_dir=Config_getString(RTF_OUTPUT);
- m_col=0;
- //insideTabbing=FALSE;
- m_listLevel = 0;
- m_bstartedBody = FALSE;
- m_omitParagraph = FALSE;
- m_numCols = 0;
- m_prettyCode=Config_getBool(RTF_SOURCE_CODE);
+}
+
+RTFGenerator::RTFGenerator(const RTFGenerator &og) : OutputGenerator(og)
+{
+}
+
+RTFGenerator &RTFGenerator::operator=(const RTFGenerator &og)
+{
+ OutputGenerator::operator=(og);
+ return *this;
+}
+
+std::unique_ptr<OutputGenerator> RTFGenerator::clone() const
+{
+ return std::make_unique<RTFGenerator>(*this);
}
RTFGenerator::~RTFGenerator()
@@ -577,8 +584,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);
- static QCString projectName = Config_getString(PROJECT_NAME);
+ bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
+ QCString projectName = Config_getString(PROJECT_NAME);
switch (is)
{
@@ -1872,7 +1879,7 @@ void RTFGenerator::endClassDiagram(const ClassDiagram &d,
newParagraph();
// create a png file
- d.writeImage(t,m_dir,m_relPath,fileName,FALSE);
+ d.writeImage(t,dir(),m_relPath,fileName,FALSE);
// display the file
t << "{" << endl;
@@ -2500,7 +2507,7 @@ void RTFGenerator::endDotGraph(DotClassGraph &g)
newParagraph();
QCString fn =
- g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),m_fileName,m_relPath,TRUE,FALSE);
+ g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,TRUE,FALSE);
// display the file
t << "{" << endl;
@@ -2523,8 +2530,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
- m_fileName,m_relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
t << "{" << endl;
@@ -2554,8 +2560,7 @@ void RTFGenerator::endCallGraph(DotCallGraph &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
- m_fileName,m_relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
t << "{" << endl;
@@ -2577,8 +2582,7 @@ void RTFGenerator::endDirDepGraph(DotDirDeps &g)
{
newParagraph();
- QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
- m_fileName,m_relPath,FALSE);
+ QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,dir(),fileName(),m_relPath,FALSE);
// display the file
t << "{" << endl;
@@ -3037,7 +3041,7 @@ void RTFGenerator::endInlineMemberDoc()
void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
{
- static bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
+ bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
DoxyCodeLineOpen = TRUE;
QCString lineNumber;