[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/qa
Aron Budea
aron.budea at collabora.com
Mon Dec 4 05:01:53 UTC 2017
sc/qa/unit/data/xlsx/built-in_ranges.xlsx |binary
sc/qa/unit/subsequent_export-test.cxx | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
New commits:
commit 1416a420d0045267b37711ce02db043960e4d771
Author: Aron Budea <aron.budea at collabora.com>
Date: Tue Nov 28 07:23:12 2017 +0100
tdf#109240, tdf#112571: add unit test
Follow-up to bba57a7eb9dd118df5772068b3a70aedb3602003
(cherry picked from commit f8b9d0fb0767d8bbe8477f92abaf6b8e0ff65546)
Change-Id: Ib61fa81e34440681f0e3eb88a10de45062bc981f
Reviewed-on: https://gerrit.libreoffice.org/45770
Reviewed-by: Aron Budea <aron.budea at collabora.com>
Tested-by: Aron Budea <aron.budea at collabora.com>
diff --git a/sc/qa/unit/data/xlsx/built-in_ranges.xlsx b/sc/qa/unit/data/xlsx/built-in_ranges.xlsx
new file mode 100644
index 000000000000..b18a4862fdd6
Binary files /dev/null and b/sc/qa/unit/data/xlsx/built-in_ranges.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 4b6370ba64c8..b72346c284e8 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -103,6 +103,7 @@ public:
void testConditionalFormatRangeListXLSX();
void testMiscRowHeightExport();
void testNamedRangeBugfdo62729();
+ void testBuiltinRangesXLSX();
void testRichTextExportODS();
void testRichTextCellFormat();
void testFormulaRefSheetNameODS();
@@ -231,6 +232,7 @@ public:
CPPUNIT_TEST(testConditionalFormatRangeListXLSX);
CPPUNIT_TEST(testMiscRowHeightExport);
CPPUNIT_TEST(testNamedRangeBugfdo62729);
+ CPPUNIT_TEST(testBuiltinRangesXLSX);
CPPUNIT_TEST(testRichTextExportODS);
CPPUNIT_TEST(testRichTextCellFormat);
CPPUNIT_TEST(testFormulaRefSheetNameODS);
@@ -1307,6 +1309,32 @@ void ScExportTest::testNamedRangeBugfdo62729()
xDocSh->DoClose();
}
+void ScExportTest::testBuiltinRangesXLSX()
+{
+ ScDocShellRef xShell = loadDoc("built-in_ranges.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xShell.is());
+ ScDocShellRef xDocSh = saveAndReload(xShell.get(), FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh.is());
+ xShell->DoClose();
+
+ xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/workbook.xml", FORMAT_XLSX);
+ CPPUNIT_ASSERT(pDoc);
+
+ //assert the existing OOXML built-in names are still there
+ assertXPathContent(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm._FilterDatabase'][@localSheetId='0']", "'Sheet1 Test'!$A$1:$A$5");
+ assertXPathContent(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm._FilterDatabase'][@localSheetId='1']", "'Sheet2 Test'!$K$10:$K$14");
+ assertXPathContent(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area'][@localSheetId='0']", "'Sheet1 Test'!$A$1:$A$5");
+ assertXPathContent(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area'][@localSheetId='1']", "'Sheet2 Test'!$K$10:$M$18");
+
+ //...and that no extra ones are added (see tdf#112571)
+ assertXPath(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm._FilterDatabase_0'][@localSheetId='0']", 0);
+ assertXPath(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm._FilterDatabase_0'][@localSheetId='1']", 0);
+ assertXPath(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area_0'][@localSheetId='0']", 0);
+ assertXPath(pDoc, "/x:workbook/x:definedNames/x:definedName[@name='_xlnm.Print_Area_0'][@localSheetId='1']", 0);
+
+ xDocSh->DoClose();
+}
+
void ScExportTest::testRichTextExportODS()
{
struct
More information about the Libreoffice-commits
mailing list