diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2017-09-21 18:28:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 18:28:54 (GMT) |
commit | 8667acc294d68fbcf99623ae62124ccd4c99a652 (patch) | |
tree | 4b9ad321b178dae9821c323456701d9f4b6c7df0 | |
parent | eed1c240c253cb1a606189c708c7cf295a27cee8 (diff) | |
parent | bb5c8dd29782ecbb05a4ef9788f2507e9a156848 (diff) | |
download | Doxygen-8667acc294d68fbcf99623ae62124ccd4c99a652.zip Doxygen-8667acc294d68fbcf99623ae62124ccd4c99a652.tar.gz Doxygen-8667acc294d68fbcf99623ae62124ccd4c99a652.tar.bz2 |
Merge pull request #600 from albert-github/feature/bug_778730
Bug 778730 - doxygen build fails
-rw-r--r-- | src/context.cpp | 4 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 26 | ||||
-rw-r--r-- | src/latexdocvisitor.h | 2 | ||||
-rw-r--r-- | src/latexgen.cpp | 18 |
4 files changed, 34 insertions, 16 deletions
diff --git a/src/context.cpp b/src/context.cpp index e5d98c1..de31202 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -3804,13 +3804,13 @@ class TextGeneratorLatex : public TextGeneratorIntf static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (!ref && pdfHyperlinks) { - m_ts << "\\hyperlink{"; + m_ts << "\\mbox{\\hyperlink{"; if (f) m_ts << stripPath(f); if (f && anchor) m_ts << "_"; if (anchor) m_ts << anchor; m_ts << "}{"; filterLatexString(m_ts,text); - m_ts << "}"; + m_ts << "}}"; } else { diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 9016c25..4ed61a4 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1344,7 +1344,7 @@ void LatexDocVisitor::visitPost(DocRef *ref) } else { - if (!ref->file().isEmpty()) endLink(ref->ref(),ref->file(),ref->anchor()); + if (!ref->file().isEmpty()) endLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable()); } } @@ -1355,7 +1355,7 @@ void LatexDocVisitor::visitPre(DocSecRefItem *ref) static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (pdfHyperlinks) { - m_t << "\\hyperlink{" << ref->file() << "_" << ref->anchor() << "}{" ; + m_t << "\\mbox{\\hyperlink{" << ref->file() << "_" << ref->anchor() << "}{" ; } } @@ -1365,7 +1365,7 @@ void LatexDocVisitor::visitPost(DocSecRefItem *ref) static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (pdfHyperlinks) { - m_t << "}"; + m_t << "}}"; } m_t << "}{\\ref{" << ref->file() << "_" << ref->anchor() << "}}{}" << endl; } @@ -1553,6 +1553,7 @@ void LatexDocVisitor::visitPost(DocParamList *pl) void LatexDocVisitor::visitPre(DocXRefItem *x) { + static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (m_hide) return; if (x->title().isEmpty()) return; m_t << "\\begin{DoxyRefDesc}{"; @@ -1560,9 +1561,9 @@ void LatexDocVisitor::visitPre(DocXRefItem *x) m_t << "}" << endl; bool anonymousEnum = x->file()=="@"; m_t << "\\item["; - if (Config_getBool(PDF_HYPERLINKS) && !anonymousEnum) + if (pdfHyperlinks && !anonymousEnum) { - m_t << "\\hyperlink{" << stripPath(x->file()) << "_" << x->anchor() << "}{"; + m_t << "\\mbox{\\hyperlink{" << stripPath(x->file()) << "_" << x->anchor() << "}{"; } else { @@ -1571,6 +1572,10 @@ void LatexDocVisitor::visitPre(DocXRefItem *x) m_insideItem=TRUE; filter(x->title()); m_insideItem=FALSE; + if (pdfHyperlinks && !anonymousEnum) + { + m_t << "}"; + } m_t << "}]"; } @@ -1657,7 +1662,7 @@ void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const Q } else { - m_t << "\\hyperlink{"; + m_t << "\\mbox{\\hyperlink{"; } if (!file.isEmpty()) m_t << stripPath(file); if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_"; @@ -1678,7 +1683,7 @@ void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const Q } } -void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor) +void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable) { m_t << "}"; static bool pdfHyperLinks = Config_getBool(PDF_HYPERLINKS); @@ -1690,6 +1695,13 @@ void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCS if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_"; m_t << anchor << "}"; } + if (ref.isEmpty() && pdfHyperLinks) // internal PDF link + { + if (!refToTable) + { + m_t << "}"; + } + } } void LatexDocVisitor::pushEnabled() diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 02df1ef..24f74ce 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -161,7 +161,7 @@ class LatexDocVisitor : public DocVisitor void startLink(const QCString &ref,const QCString &file, const QCString &anchor,bool refToTable=FALSE); void endLink(const QCString &ref,const QCString &file, - const QCString &anchor); + const QCString &anchor,bool refToTable=FALSE); QCString escapeMakeIndexChars(const char *s); void startDotFile(const QCString &fileName,const QCString &width, const QCString &height, bool hasCaption); 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 { |