summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-01-16 20:14:16 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-01-22 20:45:20 (GMT)
commit302ea696fae93d7f05cf0f68ce3017cd8b7c4952 (patch)
tree7e2948659099ed832d32bfd494adaf3f158a3fd2
parent31755d65806fda34a9b5f6b40dbfec54978d5b99 (diff)
downloadDoxygen-302ea696fae93d7f05cf0f68ce3017cd8b7c4952.zip
Doxygen-302ea696fae93d7f05cf0f68ce3017cd8b7c4952.tar.gz
Doxygen-302ea696fae93d7f05cf0f68ce3017cd8b7c4952.tar.bz2
Refactoring: move Doc*Visitor::push/popEnabled
New class & name: DocVisitor::push/popHidden
-rw-r--r--src/docbookvisitor.cpp25
-rw-r--r--src/docbookvisitor.h2
-rw-r--r--src/docvisitor.cpp15
-rw-r--r--src/docvisitor.h4
-rw-r--r--src/htmldocvisitor.cpp44
-rw-r--r--src/htmldocvisitor.h24
-rw-r--r--src/latexdocvisitor.cpp25
-rw-r--r--src/latexdocvisitor.h4
-rw-r--r--src/mandocvisitor.cpp21
-rw-r--r--src/mandocvisitor.h21
-rw-r--r--src/rtfdocvisitor.cpp46
-rw-r--r--src/rtfdocvisitor.h20
-rw-r--r--src/xmldocvisitor.cpp21
-rw-r--r--src/xmldocvisitor.h21
14 files changed, 82 insertions, 211 deletions
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp
index a03fa3c..7325b35 100644
--- a/src/docbookvisitor.cpp
+++ b/src/docbookvisitor.cpp
@@ -511,7 +511,7 @@ DB_VIS_C
{
m_t << "<programlisting>";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -519,7 +519,7 @@ DB_VIS_C
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -541,12 +541,12 @@ DB_VIS_C
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_t << "</programlisting>";
}
else
@@ -1201,7 +1201,7 @@ DB_VIS_C
}
else
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1243,7 +1243,7 @@ DB_VIS_C
}
else
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1606,19 +1606,6 @@ DB_VIS_C
m_t << "</link>";
}
-void DocbookDocVisitor::pushEnabled()
-{
-DB_VIS_C
- m_enabled.push(m_hide);
-}
-
-void DocbookDocVisitor::popEnabled()
-{
-DB_VIS_C
- m_hide=m_enabled.top();
- m_enabled.pop();
-}
-
void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s)
{
DB_VIS_C
diff --git a/src/docbookvisitor.h b/src/docbookvisitor.h
index c1e43d9..b56066f 100644
--- a/src/docbookvisitor.h
+++ b/src/docbookvisitor.h
@@ -143,8 +143,6 @@ class DocbookDocVisitor : public DocVisitor
void startLink(const QCString &file,
const QCString &anchor);
void endLink();
- void pushEnabled();
- void popEnabled();
void startMscFile(const QCString &fileName,const QCString &width,
const QCString &height, bool hasCaption,const DocNodeList &children);
void endMscFile(bool hasCaption);
diff --git a/src/docvisitor.cpp b/src/docvisitor.cpp
index d46d8c0..5356faf 100644
--- a/src/docvisitor.cpp
+++ b/src/docvisitor.cpp
@@ -14,6 +14,7 @@
#include <unordered_map>
+#include <stack>
#include "parserintf.h"
#include "docvisitor.h"
@@ -25,6 +26,7 @@ struct DocVisitor::Private
{
int id;
std::unordered_map< std::string, std::unique_ptr<CodeParserInterface> > parserFactoryMap;
+ std::stack<bool> hidden;
};
DocVisitor::DocVisitor(int id) : m_p(std::make_unique<Private>())
@@ -56,3 +58,16 @@ int DocVisitor::id() const
{
return m_p->id;
}
+
+void DocVisitor::pushHidden(bool hide)
+{
+ m_p->hidden.push(hide);
+}
+
+bool DocVisitor::popHidden()
+{
+ if (m_p->hidden.empty()) return false;
+ bool v = m_p->hidden.top();
+ m_p->hidden.pop();
+ return v;
+}
diff --git a/src/docvisitor.h b/src/docvisitor.h
index 4d4b263..baf5bef 100644
--- a/src/docvisitor.h
+++ b/src/docvisitor.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Copyright (C) 1997-2020 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -96,6 +96,8 @@ class DocVisitor
virtual ~DocVisitor();
int id() const;
CodeParserInterface &getCodeParser(const char *langExt);
+ void pushHidden(bool hide);
+ bool popHidden();
/*! @name Visitor functions for leaf nodes
* @{
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 9b11685..a10abfe 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -782,7 +782,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
{
forceEndParagraph(op);
if (!m_hide) m_ci.startCodeFragment("DoxyCode");
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -790,7 +790,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -816,12 +816,12 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_ci.endCodeFragment("DoxyCode");
forceStartParagraph(op);
}
@@ -1771,7 +1771,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1801,7 +1801,7 @@ void HtmlDocVisitor::visitPost(DocImage *img)
}
else // other format
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1927,25 +1927,6 @@ void HtmlDocVisitor::visitPost(DocSecRefList *s)
forceStartParagraph(s);
}
-//void HtmlDocVisitor::visitPre(DocLanguage *l)
-//{
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// pushEnabled();
-// m_hide = TRUE;
-// }
-//}
-//
-//void HtmlDocVisitor::visitPost(DocLanguage *l)
-//{
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// popEnabled();
-// }
-//}
-
void HtmlDocVisitor::visitPre(DocParamSect *s)
{
if (m_hide) return;
@@ -2288,19 +2269,6 @@ void HtmlDocVisitor::endLink()
m_t << "</a>";
}
-void HtmlDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void HtmlDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void HtmlDocVisitor::writeDotFile(const QCString &fn,const QCString &relPath,
const QCString &context)
{
diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h
index c994bac..084482e 100644
--- a/src/htmldocvisitor.h
+++ b/src/htmldocvisitor.h
@@ -1,13 +1,10 @@
/******************************************************************************
*
- *
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2021 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -20,7 +17,6 @@
#define _HTMLDOCVISITOR_H
#include "docvisitor.h"
-#include <qstack.h>
#include <qcstring.h>
class Definition;
@@ -34,11 +30,11 @@ class HtmlDocVisitor : public DocVisitor
{
public:
HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const Definition *ctx);
-
+
//--------------------------------------
// visitor functions for leaf nodes
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -60,7 +56,7 @@ class HtmlDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -139,9 +135,9 @@ class HtmlDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
+
void writeObfuscatedMailAddress(const QCString &url);
void filter(const char *str);
void filterQuotedCdataAttr(const char* str);
@@ -154,9 +150,6 @@ class HtmlDocVisitor : public DocVisitor
void writeDiaFile(const QCString &fileName,const QCString &relPath,const QCString &context);
void writePlantUMLFile(const QCString &fileName,const QCString &relPath,const QCString &context);
- void pushEnabled();
- void popEnabled();
-
void forceEndParagraph(DocNode *n);
void forceStartParagraph(DocNode *n);
@@ -168,7 +161,6 @@ class HtmlDocVisitor : public DocVisitor
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
- QStack<bool> m_enabled;
const Definition *m_ctx;
QCString m_langExt;
};
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index abdf116..10562a6 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -557,7 +557,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
if (op->isFirst())
{
if (!m_hide) m_ci.startCodeFragment("DoxyCodeInclude");
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -565,7 +565,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -586,12 +586,12 @@ void LatexDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide=popHidden();
if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
}
else
@@ -1382,7 +1382,7 @@ void LatexDocVisitor::visitPre(DocImage *img)
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1396,7 +1396,7 @@ void LatexDocVisitor::visitPost(DocImage *img)
}
else // other format
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1824,19 +1824,6 @@ void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCS
}
}
-void LatexDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void LatexDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void LatexDocVisitor::startDotFile(const QCString &fileName,
const QCString &width,
const QCString &height,
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h
index 003d780..45995e1 100644
--- a/src/latexdocvisitor.h
+++ b/src/latexdocvisitor.h
@@ -176,9 +176,6 @@ class LatexDocVisitor : public DocVisitor
void writeDiaFile(const QCString &fileName, DocVerbatim *s);
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s);
- void pushEnabled();
- void popEnabled();
-
//--------------------------------------
// state variables
//--------------------------------------
@@ -190,7 +187,6 @@ class LatexDocVisitor : public DocVisitor
bool m_hide;
bool m_hideCaption;
bool m_insideTabbing;
- QStack<bool> m_enabled;
QCString m_langExt;
struct TableState
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index d1bcce9..bc219cd 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -381,12 +381,12 @@ void ManDocVisitor::visit(DocIncOperator *op)
m_t << ".PP" << endl;
m_t << ".nf" << endl;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -407,12 +407,12 @@ void ManDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
if (!m_firstCol) m_t << endl;
@@ -1069,16 +1069,3 @@ void ManDocVisitor::filter(const char *str)
}
}
-void ManDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void ManDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h
index fa65424..7c5dc8d 100644
--- a/src/mandocvisitor.h
+++ b/src/mandocvisitor.h
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -20,7 +20,6 @@
#define _MANDOCVISITOR_H
#include "docvisitor.h"
-#include <qstack.h>
#include <qcstring.h>
class FTextStream;
@@ -31,11 +30,11 @@ class ManDocVisitor : public DocVisitor
{
public:
ManDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
-
+
//--------------------------------------
// visitor functions for leaf nodes
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -57,7 +56,7 @@ class ManDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -140,13 +139,10 @@ class ManDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
- void filter(const char *str);
- void pushEnabled();
- void popEnabled();
+ void filter(const char *str);
//--------------------------------------
// state variables
@@ -158,7 +154,6 @@ class ManDocVisitor : public DocVisitor
bool m_hide;
bool m_firstCol;
int m_indent;
- QStack<bool> m_enabled;
QCString m_langExt;
};
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 5b9b116..1fcaaa7 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -540,12 +540,12 @@ void RTFDocVisitor::visit(DocIncOperator *op)
m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample");
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -566,12 +566,12 @@ void RTFDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
m_t << "\\par";
@@ -1206,7 +1206,7 @@ void RTFDocVisitor::includePicturePreRTF(const QCString name, bool isTypeRTF, bo
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1241,7 +1241,7 @@ void RTFDocVisitor::includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool
}
else
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1351,27 +1351,6 @@ void RTFDocVisitor::visitPost(DocSecRefList *)
m_lastIsPara=TRUE;
}
-//void RTFDocVisitor::visitPre(DocLanguage *l)
-//{
-// DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLanguage)}\n");
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// pushEnabled();
-// m_hide = TRUE;
-// }
-//}
-//
-//void RTFDocVisitor::visitPost(DocLanguage *l)
-//{
-// DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLanguage)}\n");
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// popEnabled();
-// }
-//}
-
void RTFDocVisitor::visitPre(DocParamSect *s)
{
if (m_hide) return;
@@ -1815,19 +1794,6 @@ void RTFDocVisitor::endLink(const QCString &ref)
m_lastIsPara=FALSE;
}
-void RTFDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void RTFDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void RTFDocVisitor::writeDotFile(DocDotFile *df)
{
writeDotFile(df->file(), df->hasCaption());
diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h
index 82e4453..5cb5de3 100644
--- a/src/rtfdocvisitor.h
+++ b/src/rtfdocvisitor.h
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -20,7 +20,6 @@
#define _RTFDOCVISITOR_H
#include "docvisitor.h"
-#include <qstack.h>
#include <qcstring.h>
class FTextStream;
@@ -31,11 +30,11 @@ class RTFDocVisitor : public DocVisitor
{
public:
RTFDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
-
+
//--------------------------------------
// visitor functions for leaf nodes
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -57,7 +56,7 @@ class RTFDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -138,9 +137,9 @@ class RTFDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
+
void filter(const char *str,bool verbatim=FALSE);
void startLink(const QCString &ref,const QCString &file,
const QCString &anchor);
@@ -149,8 +148,6 @@ class RTFDocVisitor : public DocVisitor
void incIndentLevel();
void decIndentLevel();
- void pushEnabled();
- void popEnabled();
void includePicturePreRTF(const QCString name, bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
void writeDotFile(const QCString &fileName, bool hasCaption);
@@ -169,7 +166,6 @@ class RTFDocVisitor : public DocVisitor
bool m_insidePre;
bool m_hide;
int m_indentLevel;
- QStack<bool> m_enabled;
bool m_lastIsPara;
QCString m_langExt;
};
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 43ca8c9..d85ce5d 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -459,7 +459,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
{
m_t << "<programlisting filename=\"" << op->includeFileName() << "\">";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -467,7 +467,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
@@ -489,12 +489,12 @@ void XmlDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_t << "</programlisting>";
}
else
@@ -1251,16 +1251,3 @@ void XmlDocVisitor::endLink()
m_t << "</ref>";
}
-void XmlDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void XmlDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h
index 6fa1392..d0981a2 100644
--- a/src/xmldocvisitor.h
+++ b/src/xmldocvisitor.h
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -20,7 +20,6 @@
#define _XMLDOCVISITOR_H
#include "docvisitor.h"
-#include <qstack.h>
#include <qcstring.h>
class FTextStream;
@@ -32,11 +31,11 @@ class XmlDocVisitor : public DocVisitor
{
public:
XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci);
-
+
//--------------------------------------
// visitor functions for leaf nodes
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -58,7 +57,7 @@ class XmlDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -142,17 +141,14 @@ class XmlDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
+
void filter(const char *str);
void startLink(const QCString &ref,const QCString &file,
const QCString &anchor);
void endLink();
- void pushEnabled();
- void popEnabled();
-
//--------------------------------------
// state variables
//--------------------------------------
@@ -161,7 +157,6 @@ class XmlDocVisitor : public DocVisitor
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
- QStack<bool> m_enabled;
QCString m_langExt;
};