diff options
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r-- | src/rtfdocvisitor.cpp | 250 |
1 files changed, 133 insertions, 117 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 471cf85..2bd2c29 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -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. * @@ -44,13 +44,13 @@ static QCString align(DocHtmlCell *cell) { HtmlAttribList attrs = cell->attribs(); uint i; - for (i=0; i<attrs.count(); ++i) + for (i=0; i<attrs.count(); ++i) { if (attrs.at(i)->name.lower()=="align") { - if (attrs.at(i)->value.lower()=="center") + if (attrs.at(i)->value.lower()=="center") return "\\qc "; - else if (attrs.at(i)->value.lower()=="right") + else if (attrs.at(i)->value.lower()=="right") return "\\qr "; else return ""; } @@ -59,8 +59,8 @@ static QCString align(DocHtmlCell *cell) } RTFDocVisitor::RTFDocVisitor(FTextStream &t,CodeOutputInterface &ci, - const char *langExt) - : DocVisitor(DocVisitor_RTF), m_t(t), m_ci(ci), m_insidePre(FALSE), + const char *langExt) + : DocVisitor(DocVisitor_RTF), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_indentLevel(0), m_lastIsPara(FALSE), m_langExt(langExt) { } @@ -71,7 +71,7 @@ QCString RTFDocVisitor::getStyle(const char *name) n.sprintf("%s%d",name,m_indentLevel); StyleData *sd = rtf_Style[n]; ASSERT(sd!=0); - return sd->reference; + return sd->reference(); } void RTFDocVisitor::incIndentLevel() @@ -213,7 +213,7 @@ void RTFDocVisitor::visit(DocLineBreak *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n"); - m_t << "\\par" << endl; + m_t << "\\par" << endl; m_lastIsPara=TRUE; } @@ -306,37 +306,36 @@ void RTFDocVisitor::visit(DocVerbatim *s) m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - Doxygen::parserManager->getCodeParser(lang) - .parseCode(m_ci,s->context(),s->text(),langExt, - s->isExample(),s->exampleFile()); - //m_t << "\\par" << endl; + getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),langExt, + s->isExample(),s->exampleFile()); + //m_t << "\\par" << endl; m_t << "}" << endl; break; - case DocVerbatim::Verbatim: + case DocVerbatim::Verbatim: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); filter(s->text(),TRUE); - //m_t << "\\par" << endl; + //m_t << "\\par" << endl; m_t << "}" << endl; break; - case DocVerbatim::RtfOnly: - m_t << s->text(); + case DocVerbatim::RtfOnly: + m_t << s->text(); break; - case DocVerbatim::HtmlOnly: - case DocVerbatim::LatexOnly: - case DocVerbatim::XmlOnly: + case DocVerbatim::HtmlOnly: + case DocVerbatim::LatexOnly: + case DocVerbatim::XmlOnly: case DocVerbatim::ManOnly: case DocVerbatim::DocbookOnly: /* nothing */ break; - case DocVerbatim::Dot: + case DocVerbatim::Dot: { static int dotindex = 1; QCString fileName(4096); - fileName.sprintf("%s%d%s", - (Config_getString(RTF_OUTPUT)+"/inline_dotgraph_").data(), + fileName.sprintf("%s%d%s", + (Config_getString(RTF_OUTPUT)+"/inline_dotgraph_").data(), dotindex++, ".dot" ); @@ -355,13 +354,13 @@ void RTFDocVisitor::visit(DocVerbatim *s) if (Config_getBool(DOT_CLEANUP)) file.remove(); } break; - case DocVerbatim::Msc: + case DocVerbatim::Msc: { static int mscindex = 1; QCString baseName(4096); baseName.sprintf("%s%d%s", - (Config_getString(RTF_OUTPUT)+"/inline_mscgraph_").data(), + (Config_getString(RTF_OUTPUT)+"/inline_mscgraph_").data(), mscindex++, ".msc" ); @@ -427,14 +426,13 @@ void RTFDocVisitor::visit(DocInclude *inc) switch(inc->type()) { case DocInclude::IncWithLines: - { + { m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); QFileInfo cfi( inc->file() ); FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() ); - Doxygen::parserManager->getCodeParser(inc->extension()) - .parseCode(m_ci,inc->context(), + getCodeParser(inc->extension()).parseCode(m_ci,inc->context(), inc->text(), langExt, inc->isExample(), @@ -451,12 +449,11 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "}" << endl; } break; - case DocInclude::Include: + case DocInclude::Include: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - Doxygen::parserManager->getCodeParser(inc->extension()) - .parseCode(m_ci,inc->context(), + getCodeParser(inc->extension()).parseCode(m_ci,inc->context(), inc->text(),langExt,inc->isExample(), inc->exampleFile(), 0, // fileDef @@ -473,8 +470,14 @@ void RTFDocVisitor::visit(DocInclude *inc) case DocInclude::DontIncWithLines: case DocInclude::HtmlInclude: case DocInclude::LatexInclude: + case DocInclude::ManInclude: + case DocInclude::XmlInclude: + case DocInclude::DocbookInclude: break; - case DocInclude::VerbInclude: + case DocInclude::RtfInclude: + m_t << inc->text(); + break; + case DocInclude::VerbInclude: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); @@ -486,8 +489,7 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "{" << endl; if (!m_lastIsPara) m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - Doxygen::parserManager->getCodeParser(inc->extension()) - .parseCode(m_ci, + getCodeParser(inc->extension()).parseCode(m_ci, inc->context(), extractBlock(inc->text(),inc->blockId()), langExt, @@ -503,13 +505,12 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "{" << endl; if (!m_lastIsPara) m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - Doxygen::parserManager->getCodeParser(inc->extension()) - .parseCode(m_ci, + getCodeParser(inc->extension()).parseCode(m_ci, inc->context(), extractBlock(inc->text(),inc->blockId()), langExt, inc->isExample(), - inc->exampleFile(), + inc->exampleFile(), fd, lineBlock(inc->text(),inc->blockId()), -1, // endLine @@ -521,8 +522,8 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "}"; } break; - case DocInclude::SnippetDoc: - case DocInclude::IncludeDoc: + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" "Please create a bug report\n",__FILE__); break; @@ -538,7 +539,7 @@ void RTFDocVisitor::visit(DocIncOperator *op) QCString locLangExt = getFileNameExtension(op->includeFileName()); if (locLangExt.isEmpty()) locLangExt = m_langExt; SrcLangExt langExt = getLanguageFromFileName(locLangExt); - if (op->isFirst()) + if (op->isFirst()) { if (!m_hide) { @@ -549,10 +550,10 @@ void RTFDocVisitor::visit(DocIncOperator *op) pushEnabled(); m_hide = TRUE; } - if (op->type()!=DocIncOperator::Skip) + if (op->type()!=DocIncOperator::Skip) { popEnabled(); - if (!m_hide) + if (!m_hide) { FileDef *fd = 0; if (!op->includeFileName().isEmpty()) @@ -561,8 +562,7 @@ void RTFDocVisitor::visit(DocIncOperator *op) fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() ); } - Doxygen::parserManager->getCodeParser(locLangExt) - .parseCode(m_ci,op->context(),op->text(),langExt, + getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt, op->isExample(),op->exampleFile(), fd, // fileDef op->line(), // startLine @@ -576,7 +576,7 @@ void RTFDocVisitor::visit(DocIncOperator *op) pushEnabled(); m_hide=TRUE; } - if (op->isLast()) + if (op->isLast()) { popEnabled(); if (!m_hide) @@ -598,7 +598,7 @@ void RTFDocVisitor::visit(DocFormula *f) if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n"); bool bDisplay = !f->isInline(); - if (bDisplay) + if (bDisplay) { m_t << "\\par"; m_t << "{"; @@ -607,7 +607,7 @@ void RTFDocVisitor::visit(DocFormula *f) m_t << "\\qc"; } m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f->relPath() << f->name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}"; - if (bDisplay) + if (bDisplay) { m_t << "\\par}"; } @@ -630,7 +630,7 @@ void RTFDocVisitor::visit(DocCite *cite) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocCite)}\n"); - if (!cite->file().isEmpty()) + if (!cite->file().isEmpty()) { startLink(cite->ref(),cite->file(),cite->anchor()); } @@ -639,7 +639,7 @@ void RTFDocVisitor::visit(DocCite *cite) m_t << "{\\b "; } filter(cite->text()); - if (!cite->file().isEmpty()) + if (!cite->file().isEmpty()) { endLink(cite->ref()); } @@ -671,7 +671,7 @@ void RTFDocVisitor::visitPost(DocAutoList *) if (!m_lastIsPara) m_t << "\\par"; m_t << "}" << endl; m_lastIsPara=TRUE; - if (!m_indentLevel) m_t << "\\par"; + if (!m_indentLevel) m_t << "\\par" << endl; } void RTFDocVisitor::visitPre(DocAutoListItem *) @@ -694,13 +694,13 @@ void RTFDocVisitor::visitPre(DocAutoListItem *) m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocAutoListItem *) +void RTFDocVisitor::visitPost(DocAutoListItem *) { decIndentLevel(); DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoListItem)}\n"); } -void RTFDocVisitor::visitPre(DocPara *) +void RTFDocVisitor::visitPre(DocPara *) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n"); } @@ -714,7 +714,7 @@ void RTFDocVisitor::visitPost(DocPara *p) !(p->parent() && // and for parameters & sections p->parent()->kind()==DocNode::Kind_ParamSect ) - ) + ) { m_t << "\\par" << endl; m_lastIsPara=TRUE; @@ -726,7 +726,7 @@ void RTFDocVisitor::visitPre(DocRoot *r) if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRoot)}\n"); if (r->indent()) incIndentLevel(); - m_t << "{" << rtf_Style["BodyText"]->reference << endl; + m_t << "{" << rtf_Style["BodyText"]->reference() << endl; } void RTFDocVisitor::visitPost(DocRoot *r) @@ -746,24 +746,24 @@ void RTFDocVisitor::visitPre(DocSimpleSect *s) if (!m_lastIsPara) m_t << "\\par" << endl; m_t << "{"; // start desc //m_t << "{\\b "; // start bold - m_t << "{" << rtf_Style["Heading5"]->reference << endl; + m_t << "{" << rtf_Style["Heading5"]->reference() << endl; switch(s->type()) { - case DocSimpleSect::See: + case DocSimpleSect::See: m_t << theTranslator->trSeeAlso(); break; - case DocSimpleSect::Return: + case DocSimpleSect::Return: m_t << theTranslator->trReturns(); break; - case DocSimpleSect::Author: + case DocSimpleSect::Author: m_t << theTranslator->trAuthor(TRUE,TRUE); break; - case DocSimpleSect::Authors: + case DocSimpleSect::Authors: m_t << theTranslator->trAuthor(TRUE,FALSE); break; - case DocSimpleSect::Version: + case DocSimpleSect::Version: m_t << theTranslator->trVersion(); break; - case DocSimpleSect::Since: + case DocSimpleSect::Since: m_t << theTranslator->trSince(); break; - case DocSimpleSect::Date: + case DocSimpleSect::Date: m_t << theTranslator->trDate(); break; - case DocSimpleSect::Note: + case DocSimpleSect::Note: m_t << theTranslator->trNote(); break; case DocSimpleSect::Warning: m_t << theTranslator->trWarning(); break; @@ -850,7 +850,7 @@ void RTFDocVisitor::visitPre(DocSimpleListItem *) incIndentLevel(); } -void RTFDocVisitor::visitPost(DocSimpleListItem *) +void RTFDocVisitor::visitPost(DocSimpleListItem *) { decIndentLevel(); DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n"); @@ -869,7 +869,7 @@ void RTFDocVisitor::visitPre(DocSection *s) int level = QMIN(s->level()+1,4); heading.sprintf("Heading%d",level); // set style - m_t << rtf_Style[heading]->reference << endl; + m_t << rtf_Style[heading]->reference() << endl; // make table of contents entry filter(s->title()); m_t << endl << "\\par" << "}" << endl; @@ -879,7 +879,7 @@ void RTFDocVisitor::visitPre(DocSection *s) m_lastIsPara=TRUE; } -void RTFDocVisitor::visitPost(DocSection *) +void RTFDocVisitor::visitPost(DocSection *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSection)}\n"); @@ -892,12 +892,12 @@ void RTFDocVisitor::visitPre(DocHtmlList *l) if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlList)}\n"); m_t << "{" << endl; - rtf_listItemInfo[m_indentLevel].isEnum = l->type()==DocHtmlList::Ordered; + rtf_listItemInfo[m_indentLevel].isEnum = l->type()==DocHtmlList::Ordered; rtf_listItemInfo[m_indentLevel].number = 1; m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlList *) +void RTFDocVisitor::visitPost(DocHtmlList *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlList)}\n"); @@ -925,7 +925,7 @@ void RTFDocVisitor::visitPre(DocHtmlListItem *) m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlListItem *) +void RTFDocVisitor::visitPost(DocHtmlListItem *) { decIndentLevel(); DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n"); @@ -940,7 +940,7 @@ void RTFDocVisitor::visitPre(DocHtmlDescList *) //m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlDescList *) +void RTFDocVisitor::visitPost(DocHtmlDescList *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescList)}\n"); @@ -955,11 +955,11 @@ void RTFDocVisitor::visitPre(DocHtmlDescTitle *) DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescTitle)}\n"); //m_t << "\\par" << endl; //m_t << "{\\b "; - m_t << "{" << rtf_Style["Heading5"]->reference << endl; + m_t << "{" << rtf_Style["Heading5"]->reference() << endl; m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlDescTitle *) +void RTFDocVisitor::visitPost(DocHtmlDescTitle *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescTitle)}\n"); @@ -976,7 +976,7 @@ void RTFDocVisitor::visitPre(DocHtmlDescData *) m_t << "{" << rtf_Style_Reset << getStyle("DescContinue"); } -void RTFDocVisitor::visitPost(DocHtmlDescData *) +void RTFDocVisitor::visitPost(DocHtmlDescData *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescData)}\n"); @@ -994,7 +994,7 @@ void RTFDocVisitor::visitPre(DocHtmlTable *) m_lastIsPara=TRUE; } -void RTFDocVisitor::visitPost(DocHtmlTable *) +void RTFDocVisitor::visitPost(DocHtmlTable *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n"); @@ -1010,7 +1010,7 @@ void RTFDocVisitor::visitPre(DocHtmlCaption *) m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} "; } -void RTFDocVisitor::visitPost(DocHtmlCaption *) +void RTFDocVisitor::visitPost(DocHtmlCaption *) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n"); m_t << "}\n\\par" << endl; @@ -1045,7 +1045,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r) m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlRow *) +void RTFDocVisitor::visitPost(DocHtmlRow *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlRow)}\n"); @@ -1063,7 +1063,7 @@ void RTFDocVisitor::visitPre(DocHtmlCell *c) m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlCell *) +void RTFDocVisitor::visitPost(DocHtmlCell *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCell)}\n"); @@ -1085,7 +1085,7 @@ void RTFDocVisitor::visitPre(DocInternal *) //m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocInternal *) +void RTFDocVisitor::visitPost(DocInternal *) { if (m_hide) return; //DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternal)}\n"); @@ -1101,14 +1101,30 @@ void RTFDocVisitor::visitPre(DocHRef *href) DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n"); if (Config_getBool(RTF_HYPERLINKS)) { - m_t << "{\\field " - "{\\*\\fldinst " - "{ HYPERLINK \"" << href->url() << "\" " - "}{}" - "}" - "{\\fldrslt " - "{\\cs37\\ul\\cf2 "; - + if (href->url().startsWith("#CITEREF")) + { + // when starting with #CITEREF it is a doxygen generated "url"a + // so a local link + QCString cite; + cite = "citelist_" + href->url().right(href->url().length()-1); + m_t << "{\\field " + "{\\*\\fldinst " + "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" " + "}{}" + "}" + "{\\fldrslt " + "{\\cs37\\ul\\cf2 "; + } + else + { + m_t << "{\\field " + "{\\*\\fldinst " + "{ HYPERLINK \"" << href->url() << "\" " + "}{}" + "}" + "{\\fldrslt " + "{\\cs37\\ul\\cf2 "; + } } else { @@ -1117,12 +1133,12 @@ void RTFDocVisitor::visitPre(DocHRef *href) m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHRef *) +void RTFDocVisitor::visitPost(DocHRef *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHRef)}\n"); if (Config_getBool(RTF_HYPERLINKS)) - { + { m_t << "}" "}" "}"; @@ -1144,13 +1160,13 @@ void RTFDocVisitor::visitPre(DocHtmlHeader *header) int level = QMIN(header->level(),5); heading.sprintf("Heading%d",level); // set style - m_t << rtf_Style[heading]->reference; + m_t << rtf_Style[heading]->reference(); // make open table of contents entry that will be closed in visitPost method m_t << "{\\tc\\tcl" << level << " "; m_lastIsPara=FALSE; } -void RTFDocVisitor::visitPost(DocHtmlHeader *) +void RTFDocVisitor::visitPost(DocHtmlHeader *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n"); @@ -1242,7 +1258,7 @@ void RTFDocVisitor::visitPre(DocDotFile *df) writeDotFile(df); } -void RTFDocVisitor::visitPost(DocDotFile *df) +void RTFDocVisitor::visitPost(DocDotFile *df) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDotFile)}\n"); includePicturePostRTF(true, df->hasCaption()); @@ -1253,7 +1269,7 @@ void RTFDocVisitor::visitPre(DocMscFile *df) writeMscFile(df); } -void RTFDocVisitor::visitPost(DocMscFile *df) +void RTFDocVisitor::visitPost(DocMscFile *df) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocMscFile)}\n"); includePicturePostRTF(true, df->hasCaption()); @@ -1278,7 +1294,7 @@ void RTFDocVisitor::visitPre(DocLink *lnk) startLink(lnk->ref(),lnk->file(),lnk->anchor()); } -void RTFDocVisitor::visitPost(DocLink *lnk) +void RTFDocVisitor::visitPost(DocLink *lnk) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLink)}\n"); @@ -1302,7 +1318,7 @@ void RTFDocVisitor::visitPre(DocRef *ref) if (!ref->hasLinkText()) filter(ref->targetTitle()); } -void RTFDocVisitor::visitPost(DocRef *ref) +void RTFDocVisitor::visitPost(DocRef *ref) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRef)}\n"); @@ -1316,7 +1332,7 @@ void RTFDocVisitor::visitPre(DocSecRefItem *) DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefItem)}\n"); } -void RTFDocVisitor::visitPost(DocSecRefItem *) +void RTFDocVisitor::visitPost(DocSecRefItem *) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefItem)}\n"); } @@ -1332,7 +1348,7 @@ void RTFDocVisitor::visitPre(DocSecRefList *) m_lastIsPara=TRUE; } -void RTFDocVisitor::visitPost(DocSecRefList *) +void RTFDocVisitor::visitPost(DocSecRefList *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n"); @@ -1353,7 +1369,7 @@ void RTFDocVisitor::visitPost(DocSecRefList *) // } //} // -//void RTFDocVisitor::visitPost(DocLanguage *l) +//void RTFDocVisitor::visitPost(DocLanguage *l) //{ // DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLanguage)}\n"); // QCString langId = Config_getEnum(OUTPUT_LANGUAGE); @@ -1370,16 +1386,16 @@ void RTFDocVisitor::visitPre(DocParamSect *s) m_t << "{"; // start param list if (!m_lastIsPara) m_t << "\\par" << endl; //m_t << "{\\b "; // start bold - m_t << "{" << rtf_Style["Heading5"]->reference << endl; + m_t << "{" << rtf_Style["Heading5"]->reference() << endl; switch(s->type()) { - case DocParamSect::Param: + case DocParamSect::Param: m_t << theTranslator->trParameters(); break; - case DocParamSect::RetVal: + case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break; - case DocParamSect::Exception: + case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break; - case DocParamSect::TemplateParam: + case DocParamSect::TemplateParam: m_t << theTranslator->trTemplateParameters(); break; default: ASSERT(0); @@ -1416,7 +1432,7 @@ void RTFDocVisitor::visitPost(DocParamSect *s) void RTFDocVisitor::visitPre(DocParamList *pl) { - static int columnPos[4][5] = + static int columnPos[4][5] = { { 2, 25, 100, 100, 100 }, // no inout, no type { 3, 14, 35, 100, 100 }, // inout, no type { 3, 25, 50, 100, 100 }, // no inout, type @@ -1503,11 +1519,11 @@ void RTFDocVisitor::visitPre(DocParamList *pl) { if (type->kind()==DocNode::Kind_Word) { - visit((DocWord*)type); + visit((DocWord*)type); } else if (type->kind()==DocNode::Kind_LinkedWord) { - visit((DocLinkedWord*)type); + visit((DocLinkedWord*)type); } else if (type->kind()==DocNode::Kind_Sep) { @@ -1519,7 +1535,7 @@ void RTFDocVisitor::visitPre(DocParamList *pl) m_t << "\\cell }"; } } - + if (useTable) { @@ -1537,11 +1553,11 @@ void RTFDocVisitor::visitPre(DocParamList *pl) if (!first) m_t << ","; else first=FALSE; if (param->kind()==DocNode::Kind_Word) { - visit((DocWord*)param); + visit((DocWord*)param); } else if (param->kind()==DocNode::Kind_LinkedWord) { - visit((DocLinkedWord*)param); + visit((DocLinkedWord*)param); } } m_t << "} "; @@ -1596,7 +1612,7 @@ void RTFDocVisitor::visitPre(DocXRefItem *x) } m_t << "{"; // start param list //m_t << "{\\b "; // start bold - m_t << "{" << rtf_Style["Heading5"]->reference << endl; + m_t << "{" << rtf_Style["Heading5"]->reference() << endl; if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum) { QCString refName; @@ -1615,7 +1631,7 @@ void RTFDocVisitor::visitPre(DocXRefItem *x) m_t << "{\\field " "{\\*\\fldinst " - "{ HYPERLINK \\\\l \"" << refName << "\" " + "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" " "}{}" "}" "{\\fldrslt " @@ -1655,7 +1671,7 @@ void RTFDocVisitor::visitPre(DocInternalRef *ref) startLink("",ref->file(),ref->anchor()); } -void RTFDocVisitor::visitPost(DocInternalRef *) +void RTFDocVisitor::visitPost(DocInternalRef *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternalRef)}\n"); @@ -1682,7 +1698,7 @@ void RTFDocVisitor::visitPre(DocHtmlBlockQuote *) if (!m_lastIsPara) m_t << "\\par" << endl; m_t << "{"; // start desc incIndentLevel(); - m_t << rtf_Style_Reset << getStyle("DescContinue"); + m_t << rtf_Style_Reset << getStyle("DescContinue"); } void RTFDocVisitor::visitPost(DocHtmlBlockQuote *) @@ -1724,7 +1740,7 @@ void RTFDocVisitor::visitPost(DocParBlock *) //} void RTFDocVisitor::filter(const char *str,bool verbatim) -{ +{ if (str) { const unsigned char *p=(const unsigned char *)str; @@ -1755,7 +1771,7 @@ void RTFDocVisitor::filter(const char *str,bool verbatim) case '\\': m_t << "\\\\"; break; case '\n': if (verbatim) { - m_t << "\\par" << endl; + m_t << "\\par" << endl; } else { @@ -1836,7 +1852,7 @@ void RTFDocVisitor::writeDotFile(const QCString &filename, bool hasCaption) if ((i=baseName.findRev('/'))!=-1) { baseName=baseName.right(baseName.length()-i-1); - } + } QCString outDir = Config_getString(RTF_OUTPUT); writeDotGraphFromFile(filename,outDir,baseName,GOF_BITMAP); QCString imgExt = getDotImageExtension(); @@ -1854,7 +1870,7 @@ void RTFDocVisitor::writeMscFile(const QCString &fileName, bool hasCaption) if ((i=baseName.findRev('/'))!=-1) { baseName=baseName.right(baseName.length()-i-1); - } + } QCString outDir = Config_getString(RTF_OUTPUT); writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP); includePicturePreRTF(baseName + ".png", true, hasCaption); |