summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/htmlexport/data/tdf90905.odtbin11824 -> 12166 bytes
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx3
-rw-r--r--sw/source/filter/html/wrthtml.cxx3
3 files changed, 4 insertions, 2 deletions
diff --git a/sw/qa/extras/htmlexport/data/tdf90905.odt b/sw/qa/extras/htmlexport/data/tdf90905.odt
index cab8a04fa12e..19a51bdf8fcf 100644
--- a/sw/qa/extras/htmlexport/data/tdf90905.odt
+++ b/sw/qa/extras/htmlexport/data/tdf90905.odt
Binary files differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 77db88b1e95d..2ce1040b2d16 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -250,7 +250,8 @@ DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt")
CPPUNIT_ASSERT(pDoc);
// Internal url should be valid
- assertXPath(pDoc, "/html/body/p/a", "href", "#0.0.1.Text|outline");
+ assertXPath(pDoc, "/html/body/p[1]/a", "href", "#0.0.1.Text|outline");
+ assertXPath(pDoc, "/html/body/p[2]/a", "href", "#bookmark");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index ad50a1440578..c341eab2d1bc 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1198,8 +1198,9 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL)
}
}
}
- else
+ else if (!sURL.isEmpty() && sURL[0] != '#')
{
+ // Link is not started from "#", so looks like external link. Encode this URL.
INetURLObject aURL(sURL);
sURL = aURL.GetMainURL(INetURLObject::NO_DECODE);
}