diff options
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/data/xlsx/tdf166413.xlsx | bin | 0 -> 8903 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export_test4.cxx | 35 | ||||
-rw-r--r-- | sc/qa/unit/tiledrendering/data/split-panes.ods | bin | 0 -> 8685 bytes | |||
-rw-r--r-- | sc/qa/unit/tiledrendering/data/split-panes.xlsx | bin | 0 -> 8224 bytes | |||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering2.cxx | 36 |
5 files changed, 71 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf166413.xlsx b/sc/qa/unit/data/xlsx/tdf166413.xlsx Binary files differnew file mode 100644 index 000000000000..ae6e58a8fa09 --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdf166413.xlsx diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index ef9d49c775da..7709a1451fe2 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -2241,6 +2241,41 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf165886) assertXPathContent(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]/x:f", u"OR(D4=0,D4<>’’)"); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166413) +{ + createScDoc("xlsx/tdf166413.xlsx"); + + save(u"Calc Office Open XML"_ustr); + + xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); + CPPUNIT_ASSERT(pSheet); + + // Without the accompanying fix in place, this test would have failed with + // - Expected: NOT(ISERROR(SEARCH("""ABC""",A1))) + // - Actual : NOT(ISERROR(SEARCH(""ABC"",A1))) + assertXPathContent(pSheet, + "/x:worksheet/x:conditionalFormatting[@sqref=\"A1:C1\"]/x:cfRule/x:formula", + u"NOT(ISERROR(SEARCH(\"\"\"ABC\"\"\",A1)))"); + // Similarly + // - Expected: ISERROR(SEARCH("""ABC""",A2)) + // - Actual : ISERROR(SEARCH(""ABC"",A2)) + assertXPathContent(pSheet, + "/x:worksheet/x:conditionalFormatting[@sqref=\"A2:C2\"]/x:cfRule/x:formula", + u"ISERROR(SEARCH(\"\"\"ABC\"\"\",A2))"); + // Similarly + // - Expected: LEFT(A3,LEN("""ABC"""))="""ABC""" + // - Actual : LEFT(A3,LEN(""ABC""))=""ABC"" + assertXPathContent(pSheet, + "/x:worksheet/x:conditionalFormatting[@sqref=\"A3:C3\"]/x:cfRule/x:formula", + u"LEFT(A3,LEN(\"\"\"ABC\"\"\"))=\"\"\"ABC\"\"\""); + // Similarly + // - Expected: RIGHT(A4,LEN("""ABC"""))="""ABC""" + // - Actual : RIGHT(A4,LEN(""ABC""))=""ABC"" + assertXPathContent(pSheet, + "/x:worksheet/x:conditionalFormatting[@sqref=\"A4:C4\"]/x:cfRule/x:formula", + u"RIGHT(A4,LEN(\"\"\"ABC\"\"\"))=\"\"\"ABC\"\"\""); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/tiledrendering/data/split-panes.ods b/sc/qa/unit/tiledrendering/data/split-panes.ods Binary files differnew file mode 100644 index 000000000000..f34df2ebd901 --- /dev/null +++ b/sc/qa/unit/tiledrendering/data/split-panes.ods diff --git a/sc/qa/unit/tiledrendering/data/split-panes.xlsx b/sc/qa/unit/tiledrendering/data/split-panes.xlsx Binary files differnew file mode 100644 index 000000000000..5687f7c0872f --- /dev/null +++ b/sc/qa/unit/tiledrendering/data/split-panes.xlsx diff --git a/sc/qa/unit/tiledrendering/tiledrendering2.cxx b/sc/qa/unit/tiledrendering/tiledrendering2.cxx index 41fdcb17b936..ff6ed1881542 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering2.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering2.cxx @@ -165,6 +165,42 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCool11739LocaleDialogFieldUnit) CPPUNIT_ASSERT_EQUAL(FieldUnit::CM, eMetric); } +CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSplitPanes) +{ + createDoc("split-panes.ods"); + + save(u"calc8"_ustr); + + xmlDocUniquePtr pSettings = parseExport(u"settings.xml"_ustr); + CPPUNIT_ASSERT(pSettings); + + // Without the fix in place, this test would have failed with + // - Expected: 0 + // - Actual : 2 + assertXPathContent(pSettings, + "/office:document-settings/office:settings/config:config-item-set[1]/" + "config:config-item-map-indexed/config:config-item-map-entry/" + "config:config-item-map-named/config:config-item-map-entry/" + "config:config-item[@config:name='VerticalSplitMode']", + u"0"); +} + +CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSplitPanesXLSX) +{ + createDoc("split-panes.xlsx"); + + save(u"Calc Office Open XML"_ustr); + + xmlDocUniquePtr pSheet = parseExport(u"xl/worksheets/sheet1.xml"_ustr); + CPPUNIT_ASSERT(pSheet); + + // Without the fix in place, this test would have failed with + // - Expected: topRight + // - Actual : bottomRight + // which also results in invalid XLSX + assertXPath(pSheet, "/x:worksheet/x:sheetViews/x:sheetView/x:pane", "activePane", u"topRight"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |