Commit 3337add3 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Simplified LaTeX header/footer escaping

parent 3cee30e9
...@@ -592,6 +592,14 @@ void LatexGenerator::startProjectNumber() ...@@ -592,6 +592,14 @@ void LatexGenerator::startProjectNumber()
t << "\\\\[1ex]\\large "; t << "\\\\[1ex]\\large ";
} }
static QCString convertToLaTeX(const QCString &s)
{
QGString result;
FTextStream t(&result);
filterLatexString(t,s,FALSE,FALSE,FALSE);
return result.data();
}
void LatexGenerator::startIndexSection(IndexSections is) void LatexGenerator::startIndexSection(IndexSections is)
{ {
bool &compactLatex = Config_getBool("COMPACT_LATEX"); bool &compactLatex = Config_getBool("COMPACT_LATEX");
...@@ -607,16 +615,10 @@ void LatexGenerator::startIndexSection(IndexSections is) ...@@ -607,16 +615,10 @@ void LatexGenerator::startIndexSection(IndexSections is)
else else
{ {
QCString header = fileToString(latexHeader); QCString header = fileToString(latexHeader);
QGString genStringName; t << substituteKeywords(header,0,
FTextStream tgName(&genStringName); convertToLaTeX(Config_getString("PROJECT_NAME")),
filterLatexString(tgName, Config_getString("PROJECT_NAME"), FALSE,FALSE,FALSE); convertToLaTeX(Config_getString("PROJECT_NUMBER")),
QGString genStringNumber; convertToLaTeX(Config_getString("PROJECT_BRIEF")));
FTextStream tgNumber(&genStringNumber);
filterLatexString(tgNumber, Config_getString("PROJECT_NUMBER"), FALSE,FALSE,FALSE);
QGString genStringBrief;
FTextStream tgBrief(&genStringBrief);
filterLatexString(tgBrief, Config_getString("PROJECT_BRIEF"), FALSE,FALSE,FALSE);
t << substituteKeywords(header,0, genStringName, genStringNumber, genStringBrief);
} }
} }
break; break;
...@@ -1011,16 +1013,10 @@ void LatexGenerator::endIndexSection(IndexSections is) ...@@ -1011,16 +1013,10 @@ void LatexGenerator::endIndexSection(IndexSections is)
else else
{ {
QCString footer = fileToString(latexFooter); QCString footer = fileToString(latexFooter);
QGString genStringName; t << substituteKeywords(footer,0,
FTextStream tgName(&genStringName); convertToLaTeX(Config_getString("PROJECT_NAME")),
filterLatexString(tgName, Config_getString("PROJECT_NAME"), FALSE,FALSE,FALSE); convertToLaTeX(Config_getString("PROJECT_NUMBER")),
QGString genStringNumber; convertToLaTeX(Config_getString("PROJECT_BRIEF")));
FTextStream tgNumber(&genStringNumber);
filterLatexString(tgNumber, Config_getString("PROJECT_NUMBER"), FALSE,FALSE,FALSE);
QGString genStringBrief;
FTextStream tgBrief(&genStringBrief);
filterLatexString(tgBrief, Config_getString("PROJECT_BRIEF"), FALSE,FALSE,FALSE);
t << substituteKeywords(footer,0, genStringName, genStringNumber, genStringBrief);
} }
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment