diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2017-12-31 12:11:09 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2017-12-31 12:11:09 (GMT) |
commit | a1ddcc91ab6e1f7f69310179c2377e7666808a14 (patch) | |
tree | d36713cac2c4f23862f7ff8012e7d99f21e6a8ae | |
parent | 9e6d6b696388bf3375ed1a8b92ab79ccad21c3a7 (diff) | |
parent | 8afcb87097c92fd124282a998dad61ea2b16c7ec (diff) | |
download | Doxygen-a1ddcc91ab6e1f7f69310179c2377e7666808a14.zip Doxygen-a1ddcc91ab6e1f7f69310179c2377e7666808a14.tar.gz Doxygen-a1ddcc91ab6e1f7f69310179c2377e7666808a14.tar.bz2 |
Merge branch 'albert-github-feature/bug_783134'
-rw-r--r-- | src/latexdocvisitor.cpp | 2 | ||||
-rw-r--r-- | src/latexdocvisitor.h | 1 | ||||
-rw-r--r-- | src/latexgen.cpp | 6 | ||||
-rw-r--r-- | src/util.cpp | 27 | ||||
-rw-r--r-- | src/util.h | 4 |
5 files changed, 38 insertions, 2 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 4ed61a4..5a67c15 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1391,6 +1391,7 @@ void LatexDocVisitor::visitPre(DocParamSect *s) if (m_hide) return; bool hasInOutSpecs = s->hasInOutSpecifier(); bool hasTypeSpecs = s->hasTypeSpecifier(); + incUsedTableLevels(); switch(s->type()) { case DocParamSect::Param: @@ -1424,6 +1425,7 @@ void LatexDocVisitor::visitPre(DocParamSect *s) void LatexDocVisitor::visitPost(DocParamSect *s) { if (m_hide) return; + decUsedTableLevels(); switch(s->type()) { case DocParamSect::Param: diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 24f74ce..881863a 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -23,7 +23,6 @@ #include <qstack.h> #include <qcstring.h> #include <qlist.h> -//#include <qmap.h> class FTextStream; class CodeOutputInterface; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index c036d34..1511dcb 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -92,7 +92,7 @@ void LatexCodeGenerator::codify(const char *str) m_col+=spacesToNextTabStop; p++; break; - case '\n': m_t << '\n'; m_col=0; p++; + case '\n': (usedTableLevels()>0) ? m_t << "\\newline\n" : m_t << '\n'; m_col=0; p++; break; default: i=0; @@ -1849,11 +1849,13 @@ void LatexGenerator::writeNonBreakableSpace(int) void LatexGenerator::startDescTable(const char *title) { + incUsedTableLevels(); t << "\\begin{DoxyEnumFields}{" << title << "}" << endl; } void LatexGenerator::endDescTable() { + decUsedTableLevels(); t << "\\end{DoxyEnumFields}" << endl; } @@ -2196,6 +2198,7 @@ void LatexGenerator::lineBreak(const char *) void LatexGenerator::startMemberDocSimple(bool isEnum) { + incUsedTableLevels(); if (isEnum) { t << "\\begin{DoxyEnumFields}{"; @@ -2211,6 +2214,7 @@ void LatexGenerator::startMemberDocSimple(bool isEnum) void LatexGenerator::endMemberDocSimple(bool isEnum) { + decUsedTableLevels(); if (isEnum) { t << "\\end{DoxyEnumFields}" << endl; diff --git a/src/util.cpp b/src/util.cpp index f9d8a09..8e936b5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -47,6 +47,7 @@ #include "searchindex.h" #include "doxygen.h" #include "textdocvisitor.h" +#include "latexdocvisitor.h" #include "portable.h" #include "parserintf.h" #include "bufstr.h" @@ -6725,6 +6726,12 @@ void filterLatexString(FTextStream &t,const char *str, case '{': t << "\\{"; break; case '}': t << "\\}"; break; case '_': t << "\\_"; break; + case '&': t << "\\&"; break; + case '%': t << "\\%"; break; + case '#': t << "\\#"; break; + case '$': t << "\\$"; break; + case '^': (usedTableLevels()>0) ? t << "\\string^" : t << (char)c; break; + case '~': (usedTableLevels()>0) ? t << "\\string~" : t << (char)c; break; case ' ': if (keepSpaces) t << "~"; else t << ' '; break; default: @@ -8823,3 +8830,23 @@ void writeExtraLatexPackages(FTextStream &t) } } +//------------------------------------------------------ + +static int g_usedTableLevels = 0; + +void incUsedTableLevels() +{ + g_usedTableLevels++; +} +void decUsedTableLevels() +{ + g_usedTableLevels--; +} +int usedTableLevels() +{ + return g_usedTableLevels; +} + +//------------------------------------------------------ + + @@ -478,5 +478,9 @@ bool mainPageHasTitle(); bool openOutputFile(const char *outFile,QFile &f); void writeExtraLatexPackages(FTextStream &t); +int usedTableLevels(); +void incUsedTableLevels(); +void decUsedTableLevels(); + #endif |