summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-03-21 11:41:37 (GMT)
committerGitHub <noreply@github.com>2020-03-21 11:41:37 (GMT)
commitd165a89863eab073702afb0e19b44cf2e85f7db5 (patch)
tree6d6dd92681f86df12bd8f270a1fe77a13f9ec164 /src
parent022dfa0527cc79a597a7b06db87dcb2f8b19eca7 (diff)
downloadDoxygen-d165a89863eab073702afb0e19b44cf2e85f7db5.zip
Doxygen-d165a89863eab073702afb0e19b44cf2e85f7db5.tar.gz
Doxygen-d165a89863eab073702afb0e19b44cf2e85f7db5.tar.bz2
Incorrect link generated for cite and xref (#7648)
Incorrect links were generated for the cite and xref commands, the link text was not translated to a RTF link label.
Diffstat (limited to 'src')
-rw-r--r--src/rtfdocvisitor.cpp34
-rw-r--r--src/util.cpp1
2 files changed, 26 insertions, 9 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index e1a9e31..f9b30f7 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -1107,14 +1107,30 @@ void RTFDocVisitor::visitPre(DocHRef *href)
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n");
if (Config_getBool(RTF_HYPERLINKS))
{
- m_t << "{\\field "
- "{\\*\\fldinst "
- "{ HYPERLINK \"" << href->url() << "\" "
- "}{}"
- "}"
- "{\\fldrslt "
- "{\\cs37\\ul\\cf2 ";
-
+ if (href->url().startsWith("#CITEREF"))
+ {
+ // when starting with #CITEREF it is a doxygen generated "url"a
+ // so a local link
+ QCString cite;
+ cite = "citelist_" + href->url().right(href->url().length()-1);
+ m_t << "{\\field "
+ "{\\*\\fldinst "
+ "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
+ "}{}"
+ "}"
+ "{\\fldrslt "
+ "{\\cs37\\ul\\cf2 ";
+ }
+ else
+ {
+ m_t << "{\\field "
+ "{\\*\\fldinst "
+ "{ HYPERLINK \"" << href->url() << "\" "
+ "}{}"
+ "}"
+ "{\\fldrslt "
+ "{\\cs37\\ul\\cf2 ";
+ }
}
else
{
@@ -1621,7 +1637,7 @@ void RTFDocVisitor::visitPre(DocXRefItem *x)
m_t << "{\\field "
"{\\*\\fldinst "
- "{ HYPERLINK \\\\l \"" << refName << "\" "
+ "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
"}{}"
"}"
"{\\fldrslt "
diff --git a/src/util.cpp b/src/util.cpp
index 7a7d56e..4b6729a 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6585,6 +6585,7 @@ QCString rtfFormatBmkStr(const char *name)
}
}
+ //printf("Name = %s RTF_tag = %s\n",name,(*tag).data());
return *tag;
}