[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source
Tünde Tóth (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 30 18:57:19 UTC 2021
sc/qa/unit/data/xlsx/129969-min.xlsx |binary
sc/qa/unit/subsequent_export-test2.cxx | 19 +++++++++++++++++++
sc/source/filter/excel/xecontent.cxx | 4 ++--
3 files changed, 21 insertions(+), 2 deletions(-)
New commits:
commit 900ec0ac2b5fa0eb3bf42220077dc391e1aa4522
Author: Tünde Tóth <toth.tunde at nisz.hu>
AuthorDate: Tue Jun 29 13:58:59 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jun 30 20:56:40 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 <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit 67e2cc17bad3fd7aacb94da47f9024b731434a84)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118173
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
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-test2.cxx b/sc/qa/unit/subsequent_export-test2.cxx
index 8e4f77ebbd79..1c088c813f21 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -186,6 +186,7 @@ public:
void testTdf136721_paper_size();
void testTdf139258_rotated_image();
void testTdf126541_SheetVisibilityImportXlsx();
+ void testTdf140431();
CPPUNIT_TEST_SUITE(ScExportTest2);
@@ -280,6 +281,7 @@ public:
CPPUNIT_TEST(testTdf136721_paper_size);
CPPUNIT_TEST(testTdf139258_rotated_image);
CPPUNIT_TEST(testTdf126541_SheetVisibilityImportXlsx);
+ CPPUNIT_TEST(testTdf140431);
CPPUNIT_TEST_SUITE_END();
@@ -2282,6 +2284,23 @@ void ScExportTest2::testTdf126541_SheetVisibilityImportXlsx()
CPPUNIT_ASSERT(xShell->GetDocument().GetViewOptions().GetOption(VOPT_GRID));
}
+void ScExportTest2::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(ScExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index cf0c3777f39f..0848745b8d4a 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -394,9 +394,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;
}
More information about the Libreoffice-commits
mailing list