summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2019-07-15 13:35:41 +0200
committerLászló Németh <nemeth@numbertext.org>2019-07-17 13:56:06 +0200
commit217a80fd205c7f61794c863898cb7cfd1a17e78f (patch)
tree8d710ee09999525717d099162b94123989bef88d /sw
parente045fcca8699c745a2788bc73ba9b5946734eb17 (diff)
tdf#123627 DOCX import: fix relative hyperlinks to documents
Revert "tdf#86087 DOCX Import link as relative if preferred" This reverts commit 40acf8d6447065077acba9e800c56239f58c8262. Relativ urls aren't converted to absolute urls, if the "Save URLs relative to filesystem" setting is checked. Change-Id: Ie6d277e54e5f0136fed6e2804a56d29bc78e202f Reviewed-on: https://gerrit.libreoffice.org/75682 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmllinks.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 5b03e7ddf532..e6a1c8abc9d0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -141,7 +141,9 @@ DECLARE_LINKS_IMPORT_TEST(testRelativeToRelativeImport, "relative-link.docx", US
{
uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
uno::Reference<text::XTextRange> xText = getRun(xParagraph, 1);
- CPPUNIT_ASSERT_EQUAL(OUString("relative.docx"), getProperty<OUString>(xText, "HyperLinkURL"));
+ OUString sTarget = getProperty<OUString>(xText, "HyperLinkURL");
+ CPPUNIT_ASSERT(sTarget.startsWith("file:///"));
+ CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
}
DECLARE_LINKS_IMPORT_TEST(testRelativeToAbsoluteImport, "relative-link.docx", USE_ABSOLUTE)
@@ -179,8 +181,9 @@ DECLARE_LINKS_EXPORT_TEST(testRelativeToRelativeExport, "relative-link.docx", US
xmlDocPtr pXmlDoc = parseExport("word/_rels/document.xml.rels");
if (!pXmlDoc)
return;
-
- assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target", "relative.docx");
+ OUString sTarget = getXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[2]", "Target");
+ CPPUNIT_ASSERT(sTarget.startsWith("../"));
+ CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
}
DECLARE_LINKS_EXPORT_TEST(testRelativeToAbsoluteExport, "relative-link.docx", USE_ABSOLUTE,