diff options
author | tundet <tundeth@gmail.com> | 2019-04-12 10:21:42 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-04-17 10:17:47 +0200 |
commit | dc091e7fd952b0530db8583247c2f910d627700a (patch) | |
tree | b9f9e791329be94147fb932806a98ec897fa57b6 /sc/qa/unit/subsequent_export-test.cxx | |
parent | 185e01c015528cafbddcda5dfdabf816ce8be20e (diff) |
tdf#123645 XLSX export: fix hyperlink inserted to chart
Hyperlink inserted to chart lost after export.
chart_hyperlink.xlsx: Test file from Excel 2016.
Change-Id: Ideca10e544193ba43d7c2ef6e9dd8e393383edc1
Reviewed-on: https://gerrit.libreoffice.org/70648
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 17158933ec34..57c4469355f7 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -214,6 +214,7 @@ public: void testTdf115192XLSX(); void testTdf91634XLSX(); void testTdf115159(); + void testTdf123645XLSX(); void testXltxExport(); @@ -335,6 +336,7 @@ public: CPPUNIT_TEST(testTdf115192XLSX); CPPUNIT_TEST(testTdf91634XLSX); CPPUNIT_TEST(testTdf115159); + CPPUNIT_TEST(testTdf123645XLSX); CPPUNIT_TEST(testXltxExport); @@ -4225,6 +4227,28 @@ void ScExportTest::testTdf115159() xDocSh->DoClose(); } +void ScExportTest::testTdf123645XLSX() +{ + ScDocShellRef xDocSh = loadDoc("chart_hyperlink.", 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/drawings/drawing1.xml"); + CPPUNIT_ASSERT(pDoc); + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/a:hlinkClick", 1); + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/a:hlinkClick", 1); + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[3]/xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/a:hlinkClick", 1); + + xmlDocPtr pXmlRels = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels"); + CPPUNIT_ASSERT(pXmlRels); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "TargetMode", "External"); + assertXPathNoAttribute(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId3']", "TargetMode"); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId5']", "TargetMode", "External"); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "Target", "file:///C:/TEMP/test.xlsx"); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId3']", "Target", "#Sheet2!A1"); + assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId5']", "Target", "https://bugs.documentfoundation.org/show_bug.cgi?id=123645"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |