Skip to content

Commit

Permalink
Bug 773231 - Underscores in type or member name cause unwanted hyphen…
Browse files Browse the repository at this point in the history
…ation in PDF output Data Fields
  • Loading branch information
Dimitri van Heesch committed Oct 23, 2016
1 parent 6300c03 commit d571efb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/install.doc
Expand Up @@ -78,7 +78,7 @@ Compilation is now done by performing the following steps:

cd doxygen-$VERSION
mkdir build
cd build
cd build

<li>Run cmake with the makefile generator

Expand Down
4 changes: 2 additions & 2 deletions src/latexdocvisitor.cpp
Expand Up @@ -386,8 +386,8 @@ void LatexDocVisitor::visit(DocAnchor *anc)
m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%" << endl;
if (!anc->file().isEmpty() && Config_getBool(PDF_HYPERLINKS))
{
m_t << "\\hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor()
<< "}{}%" << endl;
m_t << "\\Hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor()
<< "}%" << endl;
}
}

Expand Down
17 changes: 11 additions & 6 deletions src/latexgen.cpp
Expand Up @@ -203,7 +203,7 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
//if (!m_prettyCode) return;
if (usePDFLatex && pdfHyperlinks)
{
m_t << "\\hypertarget{" << stripPath(lineAnchor) << "}{}";
m_t << "\\Hypertarget{" << stripPath(lineAnchor) << "}";
}
writeCodeLink(ref,fileName,anchor,lineNumber,0);
}
Expand Down Expand Up @@ -1596,17 +1596,18 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
{
static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
static bool usePDFLatex = Config_getBool(USE_PDFLATEX);
t << "\\mbox{";
if (usePDFLatex && pdfHyperlinks)
{
t << "\\hypertarget{";
t << "\\Hypertarget{";
if (fName) t << stripPath(fName);
if (anchor) t << "_" << anchor;
t << "}{}";
t << "}";
}
t << "\\label{";
if (fName) t << stripPath(fName);
if (anchor) t << "_" << anchor;
t << "} " << endl;
t << "}} " << endl;
}

void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
Expand All @@ -1623,11 +1624,11 @@ void LatexGenerator::writeAnchor(const char *fName,const char *name)
{
if (fName)
{
t << "\\hypertarget{" << stripPath(fName) << "_" << stripPath(name) << "}{}" << endl;
t << "\\Hypertarget{" << stripPath(fName) << "_" << stripPath(name) << "}" << endl;
}
else
{
t << "\\hypertarget{" << stripPath(name) << "}{}" << endl;
t << "\\Hypertarget{" << stripPath(name) << "}" << endl;
}
}
}
Expand Down Expand Up @@ -2216,20 +2217,24 @@ void LatexGenerator::endMemberDocSimple(bool isEnum)

void LatexGenerator::startInlineMemberType()
{
insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
}

void LatexGenerator::endInlineMemberType()
{
t << "&" << endl;
insideTabbing = FALSE;
}

void LatexGenerator::startInlineMemberName()
{
insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
}

void LatexGenerator::endInlineMemberName()
{
t << "&" << endl;
insideTabbing = FALSE;
}

void LatexGenerator::startInlineMemberDoc()
Expand Down
3 changes: 3 additions & 0 deletions templates/latex/doxygen.sty
Expand Up @@ -492,6 +492,9 @@
% Color used for table heading
\newcommand{\tableheadbgcolor}{lightgray}%

% Version of hypertarget with correct landing location
\newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}

% Define caption that is also suitable in a table
\makeatletter
\def\doxyfigcaption{%
Expand Down

0 comments on commit d571efb

Please sign in to comment.