diff options
author | albert-github <albert.tests@gmail.com> | 2017-09-03 17:18:38 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2017-09-03 17:18:38 (GMT) |
commit | bb5c8dd29782ecbb05a4ef9788f2507e9a156848 (patch) | |
tree | d6e588149123f017f478334027a0ea12b9f5b3e2 /src/latexgen.cpp | |
parent | ddae91901de9509e8caff4181230535f236c5897 (diff) | |
download | Doxygen-bb5c8dd29782ecbb05a4ef9788f2507e9a156848.zip Doxygen-bb5c8dd29782ecbb05a4ef9788f2507e9a156848.tar.gz Doxygen-bb5c8dd29782ecbb05a4ef9788f2507e9a156848.tar.bz2 |
Bug 778730 - doxygen build fails
When a hyperlink splits across a page boundary it can come to the problem of "\pdfendlink ended up in different nesting level than \pdfstartlink".
To overcome this problem the \hyperlink is packed into a "\mbox" construct (as suffested e.g. in https://tex.stackexchange.com/questions/1522/pdfendlink-ended-up-in-different-nesting-level-than-pdfstartlink)
Diffstat (limited to 'src/latexgen.cpp')
-rw-r--r-- | src/latexgen.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 8d338ae..c036d34 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -171,13 +171,13 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f, } if (!ref && usePDFLatex && pdfHyperlinks) { - m_t << "\\hyperlink{"; + m_t << "\\mbox{\\hyperlink{"; if (f) m_t << stripPath(f); if (f && anchor) m_t << "_"; if (anchor) m_t << anchor; m_t << "}{"; codify(name); - m_t << "}"; + m_t << "}}"; } else { @@ -1370,9 +1370,10 @@ void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/) void LatexGenerator::startTextLink(const char *f,const char *anchor) { - if (!disableLinks && Config_getBool(PDF_HYPERLINKS)) + static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); + if (!disableLinks && pdfHyperlinks) { - t << "\\hyperlink{"; + t << "\\mbox{\\hyperlink{"; if (f) t << stripPath(f); if (anchor) t << "_" << anchor; t << "}{"; @@ -1385,6 +1386,11 @@ void LatexGenerator::startTextLink(const char *f,const char *anchor) void LatexGenerator::endTextLink() { + static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); + if (!disableLinks && pdfHyperlinks) + { + t << "}"; + } t << "}"; } @@ -1394,13 +1400,13 @@ void LatexGenerator::writeObjectLink(const char *ref, const char *f, static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (!disableLinks && !ref && pdfHyperlinks) { - t << "\\hyperlink{"; + t << "\\mbox{\\hyperlink{"; if (f) t << stripPath(f); if (f && anchor) t << "_"; if (anchor) t << anchor; t << "}{"; docify(text); - t << "}"; + t << "}}"; } else { |