diff options
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 204 |
1 files changed, 98 insertions, 106 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index f00e6cf..52a8acf 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * 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. * @@ -175,8 +175,8 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f, { m_t << "\\mbox{\\hyperlink{"; if (f) m_t << stripPath(f); - if (f && anchor) m_t << "_"; - if (anchor) m_t << anchor; + if (f && anchor) m_t << "_"; + if (anchor) m_t << anchor; m_t << "}{"; codify(name); m_t << "}}"; @@ -372,7 +372,7 @@ static void writeLatexMakefile() t << endl << "clean:" << endl - << "\trm -f " + << "\trm -f " << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf" << endl; } @@ -623,7 +623,7 @@ static void writeDefaultHeaderPart1(FTextStream &t) "}\n" "\\makeatother\n" "\n"; - // + // t << "\\makeatletter\n" "\\newcommand\\hrulefilll{\\leavevmode\\leaders\\hrule\\hskip 0pt plus 1filll\\kern\\z@}\n" "\\makeatother\n" @@ -905,11 +905,11 @@ void LatexGenerator::endFile() //void LatexGenerator::writeIndex() //{ // startFile("refman.tex"); -//} - +//} + void LatexGenerator::startProjectNumber() { - t << "\\\\[1ex]\\large "; + t << "\\\\[1ex]\\large "; } void LatexGenerator::startIndexSection(IndexSections is) @@ -1021,7 +1021,7 @@ void LatexGenerator::startIndexSection(IndexSections is) t << "{"; // Namespace Documentation}\n": found=TRUE; } - } + } } break; case isClassDocumentation: @@ -1031,7 +1031,7 @@ void LatexGenerator::startIndexSection(IndexSections is) bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isEmbeddedInOuterScope() ) @@ -1046,13 +1046,9 @@ void LatexGenerator::startIndexSection(IndexSections is) case isFileDocumentation: { bool isFirst=TRUE; - FileNameListIterator fnli(*Doxygen::inputNameList); - FileName *fn; - for (fnli.toFirst();(fn=fnli.current());++fnli) + for (const auto &fn : *Doxygen::inputNameLinkedMap) { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) + for (const auto &fd : *fn) { if (fd->isLinkableInProject()) { @@ -1151,7 +1147,7 @@ void LatexGenerator::endIndexSection(IndexSections is) if (!gd->isReference()) { //if (compactLatex) t << "\\input"; else t << "\\include"; - t << "\\include"; + t << "\\include"; t << "{" << gd->getOutputFileBase() << "}\n"; } } @@ -1175,7 +1171,7 @@ void LatexGenerator::endIndexSection(IndexSections is) if (dd->isLinkableInProject()) { //if (compactLatex) t << "\\input"; else t << "\\include"; - t << "\\input"; + t << "\\input"; t << "{" << dd->getOutputFileBase() << "}\n"; } } @@ -1199,7 +1195,7 @@ void LatexGenerator::endIndexSection(IndexSections is) if (nd->isLinkableInProject()) { //if (compactLatex) t << "\\input"; else t << "\\include"; - t << "\\input"; + t << "\\input"; t << "{" << nd->getOutputFileBase() << "}\n"; } ++nli; @@ -1213,7 +1209,7 @@ void LatexGenerator::endIndexSection(IndexSections is) bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isEmbeddedInOuterScope() ) @@ -1224,28 +1220,24 @@ void LatexGenerator::endIndexSection(IndexSections is) } for (;(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && + if (cd->isLinkableInProject() && cd->templateMaster()==0 && !cd->isEmbeddedInOuterScope() ) { //if (compactLatex) t << "\\input"; else t << "\\include"; - t << "\\input"; + t << "\\input"; t << "{" << cd->getOutputFileBase() << "}\n"; - } + } } } break; case isFileDocumentation: { bool isFirst=TRUE; - FileNameListIterator fnli(*Doxygen::inputNameList); - FileName *fn; - for (fnli.toFirst();(fn=fnli.current());++fnli) + for (const auto &fn : *Doxygen::inputNameLinkedMap) { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) + for (const auto &fd : *fn) { if (fd->isLinkableInProject()) { @@ -1262,7 +1254,7 @@ void LatexGenerator::endIndexSection(IndexSections is) else { //if (compactLatex) t << "\\input" ; else t << "\\include"; - t << "\\input" ; + t << "\\input" ; t << "{" << fd->getOutputFileBase() << "}\n"; if (sourceBrowser && m_prettyCode && fd->generateSourceFile()) { @@ -1287,7 +1279,7 @@ void LatexGenerator::endIndexSection(IndexSections is) for (++pdi;(pd=pdi.current());++pdi) { //if (compactLatex) t << "\\input" ; else t << "\\include"; - t << "\\input"; + t << "\\input"; t << "{" << pd->getOutputFileBase() << "}\n"; } } @@ -1306,7 +1298,7 @@ void LatexGenerator::endIndexSection(IndexSections is) if (compactLatex) t << "\\doxysection"; else t << "\\chapter"; t << "{" << pd->title(); t << "}\n"; - + if (compactLatex || first) t << "\\input" ; else t << "\\include"; t << "{" << pd->getOutputFileBase() << "}\n"; first=FALSE; @@ -1339,7 +1331,7 @@ void LatexGenerator::writePageLink(const char *name, bool /*first*/) //bool &compactLatex = Config_getBool(COMPACT_LATEX); // next is remove for bug615957 //if (compactLatex || first) t << "\\input" ; else t << "\\include"; - t << "\\input" ; + t << "\\input" ; t << "{" << name << "}\n"; } @@ -1442,7 +1434,7 @@ void LatexGenerator::writeStartAnnoItem(const char *,const char *, { t << "\\item\\contentsline{section}\\textbf{ "; if (path) docify(path); - docify(name); + docify(name); t << "} "; } @@ -1477,7 +1469,7 @@ void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/) //{ // t << "\\textbf{ "; // docify(name); -// t << "}"; +// t << "}"; //} void LatexGenerator::startTextLink(const char *f,const char *anchor) @@ -1487,7 +1479,7 @@ void LatexGenerator::startTextLink(const char *f,const char *anchor) { t << "\\mbox{\\hyperlink{"; if (f) t << stripPath(f); - if (anchor) t << "_" << anchor; + if (anchor) t << "_" << anchor; t << "}{"; } else @@ -1514,8 +1506,8 @@ void LatexGenerator::writeObjectLink(const char *ref, const char *f, { t << "\\mbox{\\hyperlink{"; if (f) t << stripPath(f); - if (f && anchor) t << "_"; - if (anchor) t << anchor; + if (f && anchor) t << "_"; + if (anchor) t << anchor; t << "}{"; docify(text); t << "}}"; @@ -1525,7 +1517,7 @@ void LatexGenerator::writeObjectLink(const char *ref, const char *f, t << "\\textbf{ "; docify(text); t << "}"; - } + } } void LatexGenerator::startPageRef() @@ -1536,7 +1528,7 @@ void LatexGenerator::startPageRef() void LatexGenerator::endPageRef(const char *clname, const char *anchor) { t << "}{"; - if (clname) t << clname; + if (clname) t << clname; if (anchor) t << "_" << anchor; t << "}"; } @@ -1550,13 +1542,13 @@ void LatexGenerator::startTitleHead(const char *fileName) { t << "\\hypertarget{" << stripPath(fileName) << "}{}"; } - if (Config_getBool(COMPACT_LATEX)) + if (Config_getBool(COMPACT_LATEX)) { - t << "\\doxysubsection{"; + t << "\\doxysubsection{"; } - else + else { - t << "\\doxysection{"; + t << "\\doxysection{"; } } @@ -1575,26 +1567,26 @@ void LatexGenerator::endTitleHead(const char *fileName,const char *name) void LatexGenerator::startTitle() { - if (Config_getBool(COMPACT_LATEX)) + if (Config_getBool(COMPACT_LATEX)) { - t << "\\doxysubsection{"; + t << "\\doxysubsection{"; } - else + else { - t << "\\doxysection{"; + t << "\\doxysection{"; } } void LatexGenerator::startGroupHeader(int extraIndentLevel) { - if (Config_getBool(COMPACT_LATEX)) + if (Config_getBool(COMPACT_LATEX)) { extraIndentLevel++; } if (extraIndentLevel==3) { - t << "\\doxysubparagraph*{"; + t << "\\doxysubparagraph*{"; } else if (extraIndentLevel==2) { @@ -1619,11 +1611,11 @@ void LatexGenerator::endGroupHeader(int) void LatexGenerator::startMemberHeader(const char *,int) { - if (Config_getBool(COMPACT_LATEX)) + if (Config_getBool(COMPACT_LATEX)) { - t << "\\doxysubsubsection*{"; + t << "\\doxysubsubsection*{"; } - else + else { t << "\\doxysubsection*{"; } @@ -1733,9 +1725,9 @@ void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) } void LatexGenerator::writeAnchor(const char *fName,const char *name) -{ +{ //printf("LatexGenerator::writeAnchor(%s,%s)\n",fName,name); - t << "\\label{" << stripPath(name) << "}" << endl; + t << "\\label{" << stripPath(name) << "}" << endl; static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); static bool usePDFLatex = Config_getBool(USE_PDFLATEX); if (usePDFLatex && pdfHyperlinks) @@ -1885,31 +1877,31 @@ void LatexGenerator::endMemberTemplateParams(const char *,const char *) } } -void LatexGenerator::startMemberItem(const char *,int annoType,const char *) -{ +void LatexGenerator::startMemberItem(const char *,int annoType,const char *) +{ //printf("LatexGenerator::startMemberItem(%d)\n",annType); if (!m_insideTabbing) { - t << "\\item " << endl; + t << "\\item " << endl; templateMemberItem = (annoType == 3); } } -void LatexGenerator::endMemberItem() +void LatexGenerator::endMemberItem() { if (m_insideTabbing) { t << "\\\\"; - } + } templateMemberItem = FALSE; - t << endl; + t << endl; } -void LatexGenerator::startMemberDescription(const char *,const char *,bool) +void LatexGenerator::startMemberDescription(const char *,const char *,bool) { if (!m_insideTabbing) - { - t << "\\begin{DoxyCompactList}\\small\\item\\em "; + { + t << "\\begin{DoxyCompactList}\\small\\item\\em "; } else { @@ -1918,12 +1910,12 @@ void LatexGenerator::startMemberDescription(const char *,const char *,bool) } } -void LatexGenerator::endMemberDescription() -{ +void LatexGenerator::endMemberDescription() +{ if (!m_insideTabbing) { - //t << "\\item\\end{DoxyCompactList}"; - t << "\\end{DoxyCompactList}"; + //t << "\\item\\end{DoxyCompactList}"; + t << "\\end{DoxyCompactList}"; } else { @@ -1932,7 +1924,7 @@ void LatexGenerator::endMemberDescription() } -void LatexGenerator::writeNonBreakableSpace(int) +void LatexGenerator::writeNonBreakableSpace(int) { //printf("writeNonBreakableSpace()\n"); if (m_insideTabbing) @@ -1941,7 +1933,7 @@ void LatexGenerator::writeNonBreakableSpace(int) } else { - t << "~"; + t << "~"; } } @@ -2001,25 +1993,25 @@ void LatexGenerator::endDescTableData() t << "\\\\\n\\hline\n" << endl; } -void LatexGenerator::lastIndexPage() +void LatexGenerator::lastIndexPage() { } -void LatexGenerator::startMemberList() -{ +void LatexGenerator::startMemberList() +{ if (!m_insideTabbing) { - t << "\\begin{DoxyCompactItemize}" << endl; + t << "\\begin{DoxyCompactItemize}" << endl; } } -void LatexGenerator::endMemberList() +void LatexGenerator::endMemberList() { //printf("LatexGenerator::endMemberList(%d)\n",m_insideTabbing); if (!m_insideTabbing) { - t << "\\end{DoxyCompactItemize}" << endl; + t << "\\end{DoxyCompactItemize}" << endl; } } @@ -2029,7 +2021,7 @@ void LatexGenerator::startMemberGroupHeader(bool hasHeader) if (hasHeader) t << "\\begin{Indent}"; t << "\\textbf{ "; // changed back to rev 756 due to bug 660501 - //if (Config_getBool(COMPACT_LATEX)) + //if (Config_getBool(COMPACT_LATEX)) //{ // t << "\\doxysubparagraph*{"; //} @@ -2062,80 +2054,80 @@ void LatexGenerator::startMemberGroup() void LatexGenerator::endMemberGroup(bool hasHeader) { - if (hasHeader)t << "\\end{Indent}"; + if (hasHeader)t << "\\end{Indent}"; t << endl; } -void LatexGenerator::startDotGraph() +void LatexGenerator::startDotGraph() { newParagraph(); } -void LatexGenerator::endDotGraph(DotClassGraph &g) +void LatexGenerator::endDotGraph(DotClassGraph &g) { g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath); } -void LatexGenerator::startInclDepGraph() +void LatexGenerator::startInclDepGraph() { } -void LatexGenerator::endInclDepGraph(DotInclDepGraph &g) +void LatexGenerator::endInclDepGraph(DotInclDepGraph &g) { g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath); } -void LatexGenerator::startGroupCollaboration() +void LatexGenerator::startGroupCollaboration() { } -void LatexGenerator::endGroupCollaboration(DotGroupCollaboration &g) +void LatexGenerator::endGroupCollaboration(DotGroupCollaboration &g) { g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath); } -void LatexGenerator::startCallGraph() +void LatexGenerator::startCallGraph() { } -void LatexGenerator::endCallGraph(DotCallGraph &g) +void LatexGenerator::endCallGraph(DotCallGraph &g) { g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath); } -void LatexGenerator::startDirDepGraph() +void LatexGenerator::startDirDepGraph() { } -void LatexGenerator::endDirDepGraph(DotDirDeps &g) +void LatexGenerator::endDirDepGraph(DotDirDeps &g) { g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath); } -void LatexGenerator::startDescription() -{ - t << "\\begin{description}" << endl; +void LatexGenerator::startDescription() +{ + t << "\\begin{description}" << endl; } -void LatexGenerator::endDescription() -{ - t << "\\end{description}" << endl; +void LatexGenerator::endDescription() +{ + t << "\\end{description}" << endl; m_firstDescItem=TRUE; } -void LatexGenerator::startDescItem() -{ +void LatexGenerator::startDescItem() +{ m_firstDescItem=TRUE; - t << "\\item["; + t << "\\item["; } -void LatexGenerator::endDescItem() -{ - if (m_firstDescItem) +void LatexGenerator::endDescItem() +{ + if (m_firstDescItem) { t << "]" << endl; m_firstDescItem=FALSE; - } + } else { lineBreak(); @@ -2278,11 +2270,11 @@ void LatexGenerator::endCodeFragment() void LatexGenerator::startInlineHeader() { - if (Config_getBool(COMPACT_LATEX)) + if (Config_getBool(COMPACT_LATEX)) { - t << "\\doxyparagraph*{"; + t << "\\doxyparagraph*{"; } - else + else { t << "\\doxysubsubsection*{"; } |