diff options
author | Tünde Tóth <tundeth@gmail.com> | 2019-07-02 10:07:24 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-07-03 11:14:57 +0200 |
commit | 3cdc1b35b9d86bcfa1277e3e94925ae7b18b8fde (patch) | |
tree | 538ae396fc66cd72dbf67dd2fe7ca54c6aaff546 /sc/qa | |
parent | 4e14253640faa8f3daada78b9462e6cfcd26b072 (diff) |
tdf#126177 XLSX export: fix hyperlinks to documents
After export hyperlinks to documents didn't work, because the
the hyperlink relationship targets contained also the anchor.
Change-Id: I0bfc5bd1ef2b37f769d6a6b97e31c1b4bbfcb9aa
Reviewed-on: https://gerrit.libreoffice.org/74988
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xlsx/hyperlink_export.xlsx | bin | 0 -> 9100 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/hyperlink_export.xlsx b/sc/qa/unit/data/xlsx/hyperlink_export.xlsx Binary files differnew file mode 100644 index 000000000000..4c3952d96290 --- /dev/null +++ b/sc/qa/unit/data/xlsx/hyperlink_export.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 9d628f97faa9..06eaf398407f 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -225,6 +225,7 @@ public: void testTdf125173XLSX(); void testTdf79972XLSX(); void testTdf126024XLSX(); + void testTdf126177XLSX(); void testXltxExport(); @@ -355,6 +356,7 @@ public: CPPUNIT_TEST(testTdf125173XLSX); CPPUNIT_TEST(testTdf79972XLSX); CPPUNIT_TEST(testTdf126024XLSX); + CPPUNIT_TEST(testTdf126177XLSX); CPPUNIT_TEST(testXltxExport); @@ -4437,6 +4439,23 @@ void ScExportTest::testTdf126024XLSX() assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "TargetMode", "External"); } +void ScExportTest::testTdf126177XLSX() +{ + ScDocShellRef xDocSh = loadDoc("hyperlink_export.", FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX); + + xmlDocPtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); + CPPUNIT_ASSERT(pDoc); + assertXPath(pDoc, "/x:worksheet/x:hyperlinks/x:hyperlink", "location", "Munka1!A5"); + + xmlDocPtr pXmlRels = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels"); + CPPUNIT_ASSERT(pXmlRels); + OUString aTarget = getXPath(pXmlRels, "/r:Relationships/r:Relationship", "Target"); + CPPUNIT_ASSERT(aTarget.endsWith("test.xlsx")); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "TargetMode", "External"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |