summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2019-08-14 12:37:00 +0200
committerLászló Németh <nemeth@numbertext.org>2019-08-21 12:30:28 +0200
commitd053d573d8bb70ba02ed60eecc590485e2e19497 (patch)
treea1689ed5298d8eb9467bde88970edc5e8c4b524a /sw
parent5f979e05ff06e34a6914d76211e000fe7f7ec895 (diff)
tdf#127070 DOCX export:fix encoding of hyperlinks with non-ASCII letters
Non-ASCII file links in DOCX documents created with Microsoft Word didn't work in Word after export. non_ascii_link.docx: Test file from Word 2016. Change-Id: Ib8c4e2e7b0402b88419d200c55cc1b881a4cde86 Reviewed-on: https://gerrit.libreoffice.org/77450 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/non_ascii_link.docxbin0 -> 12061 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmllinks.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx
new file mode 100644
index 000000000000..345a55b5cff7
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 406af22d6ada..4be6351a12f1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -259,6 +259,20 @@ DECLARE_LINKS_EXPORT_TEST(testTdf126768_export, "tdf126768.docx", USE_ABSOLUTE,
assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
"file:///C:/TEMP/test.docx");
}
+
+DECLARE_LINKS_EXPORT_TEST(testNon_ascii_link_export, "non_ascii_link.docx", USE_ABSOLUTE,
+ DONT_MODIFY_LINK)
+{
+ xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
+ if (!pXmlDoc)
+ return;
+
+ OUString sTarget = "file:///C:/TEMP/%C3%A9kezet.docx";
+ assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@TargetMode='External']", "Target",
+ INetURLObject::decode( sTarget, INetURLObject::DecodeMechanism::Unambiguous,
+ RTL_TEXTENCODING_UTF8));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */