summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx28
1 files changed, 28 insertions, 0 deletions
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