From b724106589a1bde5d1f3621051ffd8040f3861ba Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 1 Dec 2013 18:06:52 +0100 Subject: Bug 668424 - HTML links in RTF output are broken There are different types of hyperlinks: external and internal. The internal hyperlinks should have \\l behind the word HYPERLINK, the external shouldnt. --- src/rtfdocvisitor.cpp | 4 ++-- src/rtfgen.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 5d73c57..576581a 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -325,7 +325,7 @@ void RTFDocVisitor::visit(DocURL *u) { m_t << "{\\field " "{\\*\\fldinst " - "{ HYPERLINK \\\\l \""; + "{ HYPERLINK \""; if (u->isEmail()) m_t << "mailto:"; m_t << u->url(); m_t << "\" }" @@ -1130,7 +1130,7 @@ void RTFDocVisitor::visitPre(DocHRef *href) { m_t << "{\\field " "{\\*\\fldinst " - "{ HYPERLINK \\\\l \"" << href->url() << "\" " + "{ HYPERLINK \"" << href->url() << "\" " "}{}" "}" "{\\fldrslt " diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 9a7dbee..d8c34ee 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1049,7 +1049,7 @@ void RTFGenerator::startHtmlLink(const char *url) if (Config_getBool("RTF_HYPERLINKS")) { - t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \""; + t << "{\\field {\\*\\fldinst { HYPERLINK \""; t << url; t << "\" }{}"; t << "}{\\fldrslt {\\cs37\\ul\\cf2 "; -- cgit v0.12