diff options
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 45f56d08fa03..10031f9f5b86 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -94,6 +94,7 @@ public: ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, SfxFilterFlags ); void test(); + void testTdf111876(); void testPasswordExportODS(); void testConditionalFormatExportODS(); void testConditionalFormatExportXLSX(); @@ -206,6 +207,7 @@ public: CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); + CPPUNIT_TEST(testTdf111876); CPPUNIT_TEST(testPasswordExportODS); CPPUNIT_TEST(testConditionalFormatExportODS); CPPUNIT_TEST(testConditionalFormatExportXLSX); @@ -396,6 +398,26 @@ void ScExportTest::test() xDocSh->DoClose(); } +void ScExportTest::testTdf111876() + { + // DOcument with relative path hyperlink + + ScDocShellRef xShell = loadDoc("tdf111876.", FORMAT_XLSX); + CPPUNIT_ASSERT(xShell.is()); + + ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + + xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels", FORMAT_XLSX); + CPPUNIT_ASSERT(pDoc); + OUString sTarget = getXPath(pDoc, "/r:Relationships/r:Relationship", "Target"); + + // Document is saved to the temporary directory, relative path should be different than original one + CPPUNIT_ASSERT(sTarget != "../xls/bug-fixes.xls"); + + xDocSh->DoClose(); +} + void ScExportTest::testPasswordExportODS() { ScDocShell* pShell = new ScDocShell( |