summaryrefslogtreecommitdiffstats
path: root/src/mandocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-05-02 09:20:20 (GMT)
committerGitHub <noreply@github.com>2021-05-02 09:20:20 (GMT)
commit4f4688844b3c6ff67782c2be95b2ceb195702067 (patch)
tree90cf8871d4cffc81ff99d392bc2b00191456de85 /src/mandocvisitor.cpp
parent4fd8254c903b251be91ab669f4d83cb86ebaf499 (diff)
parent4784ecea4d15c34af41c1adaa188159b124a1ed0 (diff)
downloadDoxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.zip
Doxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.tar.gz
Doxygen-4f4688844b3c6ff67782c2be95b2ceb195702067.tar.bz2
Merge branch 'master' into feature/bug_code_lang
Diffstat (limited to 'src/mandocvisitor.cpp')
-rw-r--r--src/mandocvisitor.cpp373
1 files changed, 197 insertions, 176 deletions
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index 95d15f8..8d41d63 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -13,8 +13,6 @@
*
*/
-#include <qfileinfo.h>
-
#include "mandocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -28,9 +26,12 @@
#include "filedef.h"
#include "htmlentity.h"
#include "emoji.h"
+#include "fileinfo.h"
+
+ManListItemInfo man_listItemInfo[man_maxIndentLevels];
-ManDocVisitor::ManDocVisitor(FTextStream &t,CodeOutputInterface &ci,
- const char *langExt)
+ManDocVisitor::ManDocVisitor(TextStream &t,CodeOutputInterface &ci,
+ const QCString &langExt)
: DocVisitor(DocVisitor_Man), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_firstCol(FALSE),
m_indent(0), m_langExt(langExt)
{
@@ -112,15 +113,15 @@ void ManDocVisitor::visit(DocURL *u)
void ManDocVisitor::visit(DocLineBreak *)
{
if (m_hide) return;
- m_t << endl << ".br" << endl;
+ m_t << "\n.br\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visit(DocHorRuler *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -168,17 +169,17 @@ void ManDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Preformatted:
if (s->enable())
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
@@ -199,25 +200,25 @@ void ManDocVisitor::visit(DocVerbatim *s)
switch (s->type())
{
case DocVerbatim::Code:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),
langExt,
s->isExample(),s->exampleFile());
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocVerbatim::Verbatim:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_t << s->text();
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocVerbatim::ManOnly:
@@ -249,11 +250,11 @@ void ManDocVisitor::visit(DocInclude *inc)
{
case DocInclude::IncWithLines:
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -267,16 +268,16 @@ void ManDocVisitor::visit(DocInclude *inc)
TRUE
);
delete fd;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
case DocInclude::Include:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(inc->extension()).parseCode(m_ci,inc->context(),
inc->text(),
langExt,
@@ -289,9 +290,9 @@ void ManDocVisitor::visit(DocInclude *inc)
0, // memberDef
FALSE
);
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::DontInclude:
@@ -306,19 +307,19 @@ void ManDocVisitor::visit(DocInclude *inc)
m_t << inc->text();
break;
case DocInclude::VerbInclude:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
m_t << inc->text();
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::Snippet:
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -326,18 +327,18 @@ void ManDocVisitor::visit(DocInclude *inc)
inc->isExample(),
inc->exampleFile()
);
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
break;
case DocInclude::SnipWithLines:
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
- QFileInfo cfi( inc->file() );
- FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
+ FileInfo cfi( inc->file().str() );
+ FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
getCodeParser(inc->extension()).parseCode(m_ci,
inc->context(),
extractBlock(inc->text(),inc->blockId()),
@@ -352,9 +353,9 @@ void ManDocVisitor::visit(DocInclude *inc)
TRUE // show line number
);
delete fd;
- if (!m_firstCol) m_t << endl;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
break;
@@ -372,28 +373,28 @@ void ManDocVisitor::visit(DocIncOperator *op)
if (locLangExt.isEmpty()) locLangExt = m_langExt;
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
//printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
- // op->type(),op->isFirst(),op->isLast(),op->text().data());
+ // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
if (op->isFirst())
{
if (!m_hide)
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
- m_t << ".nf" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
+ m_t << ".nf\n";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
FileDef *fd = 0;
if (!op->includeFileName().isEmpty())
{
- QFileInfo cfi( op->includeFileName() );
- fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileInfo cfi( op->includeFileName().str() );
+ fd = createFileDef( cfi.dirPath(), cfi.fileName() );
}
getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
@@ -407,23 +408,23 @@ 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;
- m_t << ".fi" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".fi\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -466,7 +467,7 @@ void ManDocVisitor::visitPost(DocAutoList *)
{
if (m_hide) return;
m_indent-=2;
- m_t << ".PP" << endl;
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocAutoListItem *li)
@@ -474,7 +475,7 @@ void ManDocVisitor::visitPre(DocAutoListItem *li)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"" << ws;
if (((DocAutoList *)li->parent())->isEnumList())
{
@@ -484,14 +485,14 @@ void ManDocVisitor::visitPre(DocAutoListItem *li)
{
m_t << "\\(bu\" " << m_indent;
}
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocAutoListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
@@ -508,8 +509,8 @@ void ManDocVisitor::visitPost(DocPara *p)
)
)
{
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
}
@@ -527,8 +528,8 @@ void ManDocVisitor::visitPre(DocSimpleSect *s)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
switch(s->type())
@@ -571,17 +572,17 @@ void ManDocVisitor::visitPre(DocSimpleSect *s)
// special case 1: user defined title
if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
{
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
}
void ManDocVisitor::visitPost(DocSimpleSect *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -592,23 +593,23 @@ void ManDocVisitor::visitPre(DocTitle *)
void ManDocVisitor::visitPost(DocTitle *)
{
if (m_hide) return;
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPre(DocSimpleList *)
{
if (m_hide) return;
m_indent+=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PD 0" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PD 0\n";
}
void ManDocVisitor::visitPost(DocSimpleList *)
{
if (m_hide) return;
m_indent-=2;
- m_t << ".PP" << endl;
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocSimpleListItem *)
@@ -616,27 +617,27 @@ void ManDocVisitor::visitPre(DocSimpleListItem *)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
- m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocSimpleListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPre(DocSection *s)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
if (s->level()==1) m_t << ".SH"; else m_t << ".SS";
m_t << " \"";
filter(s->title());
- m_t << "\"" << endl;
- if (s->level()==1) m_t << ".PP" << endl;
+ m_t << "\"\n";
+ if (s->level()==1) m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -644,20 +645,35 @@ void ManDocVisitor::visitPost(DocSection *)
{
}
-void ManDocVisitor::visitPre(DocHtmlList *)
+void ManDocVisitor::visitPre(DocHtmlList *l)
{
if (m_hide) return;
m_indent+=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PD 0" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PD 0\n";
+ man_listItemInfo[m_indent].number = 1;
+ man_listItemInfo[m_indent].type = '1';
+ for (const auto &opt : l->attribs())
+ {
+ if (opt.name=="type")
+ {
+ man_listItemInfo[m_indent].type = opt.value[0];
+ }
+ if (opt.name=="start")
+ {
+ bool ok;
+ int val = opt.value.toInt(&ok);
+ if (ok) man_listItemInfo[m_indent].number = val;
+ }
+ }
}
void ManDocVisitor::visitPost(DocHtmlList *)
{
if (m_hide) return;
m_indent-=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocHtmlListItem *li)
@@ -665,41 +681,63 @@ void ManDocVisitor::visitPre(DocHtmlListItem *li)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"" << ws;
if (((DocHtmlList *)li->parent())->type()==DocHtmlList::Ordered)
{
- m_t << li->itemNumber() << ".\" " << m_indent+2;
+ switch (man_listItemInfo[m_indent].type)
+ {
+ case '1':
+ m_t << man_listItemInfo[m_indent].number;
+ break;
+ case 'a':
+ m_t << integerToAlpha(man_listItemInfo[m_indent].number,false);
+ break;
+ case 'A':
+ m_t << integerToAlpha(man_listItemInfo[m_indent].number);
+ break;
+ case 'i':
+ m_t << integerToRoman(man_listItemInfo[m_indent].number,false);
+ break;
+ case 'I':
+ m_t << integerToRoman(man_listItemInfo[m_indent].number);
+ break;
+ default:
+ m_t << man_listItemInfo[m_indent].number;
+ break;
+ }
+ m_t << ".\" " << m_indent+2;
+ man_listItemInfo[m_indent].number++;
}
else // bullet list
{
m_t << "\\(bu\" " << m_indent;
}
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocHtmlListItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
//void ManDocVisitor::visitPre(DocHtmlPre *)
//{
-// if (!m_firstCol) m_t << endl;
-// m_t << ".PP" << endl;
-// m_t << ".nf" << endl;
+// if (!m_firstCol) m_t << "\n";
+// m_t << ".PP\n";
+// m_t << ".nf\n";
// m_insidePre=TRUE;
//}
//
//void ManDocVisitor::visitPost(DocHtmlPre *)
//{
// m_insidePre=FALSE;
-// if (!m_firstCol) m_t << endl;
-// m_t << ".fi" << endl;
-// m_t << ".PP" << endl;
+// if (!m_firstCol) m_t << "\n";
+// m_t << ".fi\n";
+// m_t << ".PP\n";
// m_firstCol=TRUE;
//}
@@ -710,15 +748,15 @@ void ManDocVisitor::visitPre(DocHtmlDescList *)
void ManDocVisitor::visitPost(DocHtmlDescList *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPre(DocHtmlDescTitle *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
m_t << ".IP \"\\fB";
m_firstCol=FALSE;
}
@@ -726,7 +764,7 @@ void ManDocVisitor::visitPre(DocHtmlDescTitle *)
void ManDocVisitor::visitPost(DocHtmlDescTitle *)
{
if (m_hide) return;
- m_t << "\\fP\" 1c" << endl;
+ m_t << "\\fP\" 1c\n";
m_firstCol=TRUE;
}
@@ -773,18 +811,18 @@ void ManDocVisitor::visitPost(DocHtmlCell *)
void ManDocVisitor::visitPre(DocInternal *)
{
if (m_hide) return;
- //if (!m_firstCol) m_t << endl;
- //m_t << ".PP" << endl;
- //m_t << "\\fB" << theTranslator->trForInternalUseOnly() << "\\fP" << endl;
- //m_t << ".RS 4" << endl;
+ //if (!m_firstCol) m_t << "\n";
+ //m_t << ".PP\n";
+ //m_t << "\\fB" << theTranslator->trForInternalUseOnly() << "\\fP\n";
+ //m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocInternal *)
{
if (m_hide) return;
- //if (!m_firstCol) m_t << endl;
- //m_t << ".RE" << endl;
- //m_t << ".PP" << endl;
+ //if (!m_firstCol) m_t << "\n";
+ //m_t << ".RE\n";
+ //m_t << ".PP\n";
//m_firstCol=TRUE;
}
@@ -803,7 +841,7 @@ void ManDocVisitor::visitPost(DocHRef *)
void ManDocVisitor::visitPre(DocHtmlHeader *header)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
+ if (!m_firstCol) m_t << "\n";
if (header->level()==1) m_t << ".SH"; else m_t << ".SS";
m_t << " \"";
}
@@ -811,8 +849,8 @@ void ManDocVisitor::visitPre(DocHtmlHeader *header)
void ManDocVisitor::visitPost(DocHtmlHeader *header)
{
if (m_hide) return;
- m_t << "\"" << endl;
- if (header->level()==1) m_t << ".PP" << endl;
+ m_t << "\"\n";
+ if (header->level()==1) m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -877,15 +915,15 @@ void ManDocVisitor::visitPre(DocSecRefItem *)
if (m_hide) return;
QCString ws;
ws.fill(' ',m_indent-2);
- if (!m_firstCol) m_t << endl;
- m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << "\n";
m_firstCol=TRUE;
}
void ManDocVisitor::visitPost(DocSecRefItem *)
{
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_firstCol=TRUE;
}
@@ -899,8 +937,8 @@ void ManDocVisitor::visitPost(DocSecRefList *)
{
if (m_hide) return;
m_indent-=2;
- if (!m_firstCol) m_t << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".PP\n";
}
void ManDocVisitor::visitPre(DocParamSect *s)
@@ -908,8 +946,8 @@ void ManDocVisitor::visitPre(DocParamSect *s)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
switch(s->type())
@@ -925,16 +963,16 @@ void ManDocVisitor::visitPre(DocParamSect *s)
default:
ASSERT(0);
}
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocParamSect *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -942,21 +980,17 @@ void ManDocVisitor::visitPre(DocParamList *pl)
{
if (m_hide) return;
m_t << "\\fI";
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
bool first=TRUE;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (!first) m_t << ","; else first=FALSE;
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
}
m_t << "\\fP ";
@@ -967,8 +1001,8 @@ void ManDocVisitor::visitPost(DocParamList *pl)
if (m_hide) return;
if (!pl->isLast())
{
- if (!m_firstCol) m_t << endl;
- m_t << ".br" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".br\n";
}
}
@@ -978,22 +1012,22 @@ void ManDocVisitor::visitPre(DocXRefItem *x)
if (x->title().isEmpty()) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
m_t << "\\fB";
filter(x->title());
- m_t << "\\fP" << endl;
- m_t << ".RS 4" << endl;
+ m_t << "\\fP\n";
+ m_t << ".RS 4\n";
}
void ManDocVisitor::visitPost(DocXRefItem *x)
{
if (m_hide) return;
if (x->title().isEmpty()) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -1022,18 +1056,18 @@ void ManDocVisitor::visitPre(DocHtmlBlockQuote *)
if (m_hide) return;
if (!m_firstCol)
{
- m_t << endl;
- m_t << ".PP" << endl;
+ m_t << "\n";
+ m_t << ".PP\n";
}
- m_t << ".RS 4" << endl; // TODO: add support for nested block quotes
+ m_t << ".RS 4\n"; // TODO: add support for nested block quotes
}
void ManDocVisitor::visitPost(DocHtmlBlockQuote *)
{
if (m_hide) return;
- if (!m_firstCol) m_t << endl;
- m_t << ".RE" << endl;
- m_t << ".PP" << endl;
+ if (!m_firstCol) m_t << "\n";
+ m_t << ".RE\n";
+ m_t << ".PP\n";
m_firstCol=TRUE;
}
@@ -1054,11 +1088,11 @@ void ManDocVisitor::visitPost(DocParBlock *)
}
-void ManDocVisitor::filter(const char *str)
+void ManDocVisitor::filter(const QCString &str)
{
- if (str)
+ if (!str.isEmpty())
{
- const char *p=str;
+ const char *p=str.data();
char c=0;
while ((c=*p++))
{
@@ -1073,16 +1107,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;
-}
-