sc/qa/unit/subsequent_export-test.cxx | 8 +++----- sc/source/filter/excel/xestream.cxx | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-)
New commits: commit 95b1411e26c1a82e110a8ccf970b8b3590427cb9 Author: Attila Szűcs <szucs.atti...@nisz.hu> AuthorDate: Mon Dec 21 23:54:43 2020 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jan 19 11:38:57 2021 +0100 tdf#121472 XLSX export: fix external Linux path Removed the extra 4th '/' after 'file:///' from aData.maBasePath at exportDocument(). In Linux, the root path could start with '/'.. like /home/... in that case 'file:///'+'/home/..' resulted 'file:////home/ that is invalid. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ia37a11def80df2747578807ee021fafe38d48ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108131 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109535 diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index e173f856dbb0..3d57725ce3df 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -5699,11 +5699,9 @@ void ScExportTest::testTdf138824_linkToParentDirectory() pXPathFile, m_xSFactory, "xl/externalLinks/_rels/externalLink1.xml.rels"); CPPUNIT_ASSERT(pDoc); - // it should be "../tdf138824_externalSource.ods" but because of an other bug, - // on linux some other directory names may added into the middle - OUString aValue = getXPath(pDoc, "/r:Relationships/r:Relationship", "Target"); - CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(aValue.indexOf("../"))); - CPPUNIT_ASSERT(aValue.indexOf("/tdf138824_externalSource.ods") > 0); + // test also the Linux specific bug tdf#121472 + assertXPath(pDoc, "/r:Relationships/r:Relationship", "Target", + "../tdf138824_externalSource.ods"); xDocSh->DoClose(); } diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 37e00dbf9715..5158c1987e21 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1036,8 +1036,9 @@ bool XclExpXmlStream::exportDocument() aData.mpCompileFormulaCxt = std::make_shared<sc::CompileFormulaContext>(rDoc); // set target path to get correct relative links to target document, not source INetURLObject aPath(getFileUrl()); - aData.maBasePath = aPath.GetPath() + "\\"; - aData.maBasePath = "file:///" + aData.maBasePath.replace('\\', '/'); + aData.maBasePath = OUString("file:///" + aPath.GetPath() + "\\").replace('\\', '/') + // fix for Linux + .replaceFirst("file:////", "file:///"); XclExpRoot aRoot( aData ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits