diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-06-10 09:13:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-10 09:13:43 (GMT) |
commit | 55735feae7530d1650b95f96d33448d64076f476 (patch) | |
tree | f394332bbc3704de00aa3ca58f34e860637e039f /src/latexdocvisitor.cpp | |
parent | 217984ec2ace85e4e6ba6e9d348e0657938cba79 (diff) | |
parent | ed86c707318c1cb005702ef88dbdaa3a2bee5581 (diff) | |
download | Doxygen-55735feae7530d1650b95f96d33448d64076f476.zip Doxygen-55735feae7530d1650b95f96d33448d64076f476.tar.gz Doxygen-55735feae7530d1650b95f96d33448d64076f476.tar.bz2 |
Merge pull request #742 from albert-github/feature/bug_latex_table_code
Problem with code inside a Doxy table in LaTeX
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r-- | src/latexdocvisitor.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index e268006..7fd27bb 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -18,6 +18,7 @@ #include "htmlattrib.h" #include <qfileinfo.h> #include "latexdocvisitor.h" +#include "latexgen.h" #include "docparser.h" #include "language.h" #include "doxygen.h" @@ -291,10 +292,12 @@ void LatexDocVisitor::visit(DocVerbatim *s) { case DocVerbatim::Code: { - m_t << "\n\\begin{DoxyCode}\n"; + m_t << "\n\\begin{DoxyCode}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); Doxygen::parserManager->getParser(lang) ->parseCode(m_ci,s->context(),s->text(),langExt, s->isExample(),s->exampleFile()); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCode}\n"; } break; @@ -399,7 +402,8 @@ void LatexDocVisitor::visit(DocInclude *inc) { case DocInclude::IncWithLines: { - m_t << "\n\\begin{DoxyCodeInclude}\n"; + m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); Doxygen::parserManager->getParser(inc->extension()) @@ -415,11 +419,13 @@ void LatexDocVisitor::visit(DocInclude *inc) 0, // memberDef TRUE // show line numbers ); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCodeInclude}" << endl; } break; case DocInclude::Include: - m_t << "\n\\begin{DoxyCodeInclude}\n"; + m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(),langExt,inc->isExample(), @@ -431,6 +437,7 @@ void LatexDocVisitor::visit(DocInclude *inc) 0, // memberDef FALSE ); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCodeInclude}\n"; break; case DocInclude::DontInclude: @@ -447,7 +454,8 @@ void LatexDocVisitor::visit(DocInclude *inc) break; case DocInclude::Snippet: { - m_t << "\n\\begin{DoxyCodeInclude}\n"; + m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, inc->context(), @@ -456,6 +464,7 @@ void LatexDocVisitor::visit(DocInclude *inc) inc->isExample(), inc->exampleFile() ); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCodeInclude}" << endl; } break; @@ -463,7 +472,8 @@ void LatexDocVisitor::visit(DocInclude *inc) { QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); - m_t << "\n\\begin{DoxyCodeInclude}\n"; + m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, inc->context(), @@ -478,6 +488,7 @@ void LatexDocVisitor::visit(DocInclude *inc) 0, // memberDef TRUE // show line number ); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCodeInclude}" << endl; } break; @@ -495,7 +506,8 @@ void LatexDocVisitor::visit(DocIncOperator *op) // op->type(),op->isFirst(),op->isLast(),op->text().data()); if (op->isFirst()) { - if (!m_hide) m_t << "\n\\begin{DoxyCodeInclude}\n"; + if (!m_hide) m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; + LatexCodeGenerator::setDoxyCodeOpen(TRUE); pushEnabled(); m_hide = TRUE; } @@ -515,6 +527,7 @@ void LatexDocVisitor::visit(DocIncOperator *op) if (op->isLast()) { popEnabled(); + LatexCodeGenerator::setDoxyCodeOpen(FALSE); if (!m_hide) m_t << "\n\\end{DoxyCodeInclude}\n"; } else |