summaryrefslogtreecommitdiffstats
path: root/src/latexdocvisitor.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-06-10 09:13:43 (GMT)
committerGitHub <noreply@github.com>2018-06-10 09:13:43 (GMT)
commit55735feae7530d1650b95f96d33448d64076f476 (patch)
treef394332bbc3704de00aa3ca58f34e860637e039f /src/latexdocvisitor.cpp
parent217984ec2ace85e4e6ba6e9d348e0657938cba79 (diff)
parented86c707318c1cb005702ef88dbdaa3a2bee5581 (diff)
downloadDoxygen-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.cpp25
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