sc/qa/unit/data/xlsx/129969-min.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 19 +++++++++++++++++++ sc/source/filter/excel/xecontent.cxx | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-)
New commits: commit a16ca67218be6dad183208694daf515d682b50d4 Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Tue Jun 29 13:58:59 2021 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Sat Jul 3 08:02:06 2021 +0200 tdf#140431 XLSX export: fix double file:// prefix Regression from commit: fc58d7d65b9683db7b7632137126680b8483f6c5 (tdf#129969 XLSX export: file URLs need IURI encoding) Change-Id: I5bfb0ef9ba7fe82cd3f4d0e0b3fdcf8f705cba64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118090 Tested-by: Jenkins Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 67e2cc17bad3fd7aacb94da47f9024b731434a84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118293 Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu> (cherry picked from commit 5a47501ec5856f32d652d492e9e144e64642b452) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118299 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 26e447de1d6b940588ea3ae8f22e35a18aa60754) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118301 Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sc/qa/unit/data/xlsx/129969-min.xlsx b/sc/qa/unit/data/xlsx/129969-min.xlsx new file mode 100644 index 000000000000..b6fd8e9e2069 Binary files /dev/null and b/sc/qa/unit/data/xlsx/129969-min.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 4b0d5a0cb265..c4da03cc354c 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -281,6 +281,7 @@ public: void testTdf84874(); void testTdf136721_paper_size(); void testTdf139258_rotated_image(); + void testTdf140431(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -460,6 +461,7 @@ public: CPPUNIT_TEST(testTdf84874); CPPUNIT_TEST(testTdf136721_paper_size); CPPUNIT_TEST(testTdf139258_rotated_image); + CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST_SUITE_END(); @@ -5849,6 +5851,23 @@ void ScExportTest::testTdf139258_rotated_image() assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:row", "25"); } +void ScExportTest::testTdf140431() +{ + ScDocShellRef xShell = loadDoc(u"129969-min.", FORMAT_XLSX); + CPPUNIT_ASSERT(xShell.is()); + + ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + ScDocument& rDoc = xDocSh->GetDocument(); + ScAddress aPos(0, 2, 0); + const EditTextObject* pEditText = rDoc.GetEditText(aPos); + const SvxFieldData* pData = pEditText->GetFieldData(0, 0, text::textfield::Type::URL); + const SvxURLField* pURLData = static_cast<const SvxURLField*>(pData); + CPPUNIT_ASSERT(pURLData->GetURL().startsWith("file://ndhlis")); + + xDocSh->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 028ad89241d6..a3cd8dfa9e84 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -392,9 +392,9 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU for( int i = 0; i < nLevel; ++i ) msTarget = "../" + msTarget; } - else + else if (rRoot.GetOutput() != EXC_OUTPUT_XML_2007) { - // ooxml expects the file:/// part appended ( or at least + // xls expects the file:/// part appended ( or at least // ms2007 does, ms2010 is more tolerant ) msTarget = "file:///" + msTarget; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits