diff options
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/non_ascii_link.docx | bin | 0 -> 12061 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmllinks.cxx | 14 |
3 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 54f8b9f6ca83..a5d565e93839 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -67,6 +67,7 @@ #include <oox/crypto/DocumentEncryption.hxx> #include <tools/date.hxx> #include <tools/datetime.hxx> +#include <tools/urlobj.hxx> #include <com/sun/star/util/Duration.hpp> #include <sax/tools/converter.hxx> #include <oox/token/namespacemap.hxx> @@ -516,7 +517,7 @@ OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal aEntry[0].First = "Type"; aEntry[0].Second = rType; aEntry[1].First = "Target"; - aEntry[1].Second = rTarget; + aEntry[1].Second = INetURLObject::decode(rTarget, INetURLObject::DecodeMechanism::Unambiguous, RTL_TEXTENCODING_UTF8); if( bExternal ) { aEntry[2].First = "TargetMode"; diff --git a/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx Binary files differnew file mode 100644 index 000000000000..345a55b5cff7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/non_ascii_link.docx 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: */ |