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 610153dd28b57ea2670f5cf240e4da9655fb7093 Author: Attila Szűcs <szucs.atti...@nisz.hu> AuthorDate: Mon Dec 21 23:54:43 2020 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Wed Dec 23 11:16:03 2020 +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> diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index bcfa926c9314..e29e7a5ee648 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -5636,11 +5636,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 another bug, - // on linux some other directory names may be 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 28f9e9f815ab..5d8723d026ef 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1035,8 +1035,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