summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2021-06-29 13:58:59 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-07-03 08:02:06 +0200
commita16ca67218be6dad183208694daf515d682b50d4 (patch)
tree813aeec036920db2dceb870f1aed6e70186a30d1
parentbump product version to 7.1.5.1.0+ (diff)
downloadcore-a16ca67218be6dad183208694daf515d682b50d4.tar.gz
core-a16ca67218be6dad183208694daf515d682b50d4.zip
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@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 67e2cc17bad3fd7aacb94da47f9024b731434a84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118293 Tested-by: Gabor Kelemen <kelemen.gabor2@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gabor2@nisz.hu> (cherry picked from commit 5a47501ec5856f32d652d492e9e144e64642b452) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118299 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 26e447de1d6b940588ea3ae8f22e35a18aa60754) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118301 Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--sc/qa/unit/data/xlsx/129969-min.xlsxbin0 -> 9474 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx19
-rw-r--r--sc/source/filter/excel/xecontent.cxx4
3 files changed, 21 insertions, 2 deletions
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/129969-min.xlsx
Binary files 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;
}