summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorofftkp <parisoplop@gmail.com>2022-11-23 11:34:52 +0200
committerTomaž Vajngerl <quikee@gmail.com>2022-11-30 14:24:27 +0100
commit8b9e182f90c681d55848f08605470d2bff39078c (patch)
tree5dd1992321e6900af7b93eb3fc866026135ff39e /sc
parent933e045422957e15cad47ef925d4f9a852c826b1 (diff)
xlsx: Add test for totalsRowFunction roundtrip
Change-Id: I3b7539a88abbe2f9bab3331d8550c1050c52059a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143137 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/totalsRowFunction.xlsxbin0 -> 18719 bytes
-rw-r--r--sc/qa/unit/subsequent_export_test2.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/totalsRowFunction.xlsx b/sc/qa/unit/data/xlsx/totalsRowFunction.xlsx
new file mode 100644
index 000000000000..3731caf86491
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/totalsRowFunction.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx
index b3d46d1cdd58..628401167d5a 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -188,6 +188,7 @@ public:
void testTdf91286();
void testTdf148820();
void testEmbeddedTextInDecimal();
+ void testTotalsRowFunction();
CPPUNIT_TEST_SUITE(ScExportTest2);
@@ -313,6 +314,7 @@ public:
CPPUNIT_TEST(testTdf91286);
CPPUNIT_TEST(testTdf148820);
CPPUNIT_TEST(testEmbeddedTextInDecimal);
+ CPPUNIT_TEST(testTotalsRowFunction);
CPPUNIT_TEST_SUITE_END();
};
@@ -2824,6 +2826,29 @@ void ScExportTest2::testEmbeddedTextInDecimal()
lcl_TestEmbeddedTextInDecimal(*getScDoc());
}
+void ScExportTest2::testTotalsRowFunction()
+{
+ createScDoc("xlsx/totalsRowFunction.xlsx");
+ saveAndReload("Calc Office Open XML");
+ {
+ xmlDocUniquePtr pDocXml = parseExport("xl/tables/table1.xml");
+ CPPUNIT_ASSERT(pDocXml);
+ assertXPath(pDocXml, "/x:table/x:tableColumns/x:tableColumn[5]", "totalsRowFunction",
+ "sum");
+ }
+ ScDocument* pDoc = getScDoc();
+ pDoc->InsertCol(ScRange(3, 0, 0, 3, pDoc->MaxRow(), 0)); // Insert col 4
+ saveAndReload("Calc Office Open XML");
+ {
+ xmlDocUniquePtr pDocXml = parseExport("xl/tables/table1.xml");
+ CPPUNIT_ASSERT(pDocXml);
+ assertXPathNoAttribute(pDocXml, "/x:table/x:tableColumns/x:tableColumn[5]",
+ "totalsRowFunction");
+ assertXPath(pDocXml, "/x:table/x:tableColumns/x:tableColumn[6]", "totalsRowFunction",
+ "sum");
+ }
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();