From 049d2ffd329f88934a92b72e4ec650ea46bf8c61 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Wed, 28 Sep 2016 07:38:22 +0200 Subject: Test the case for pivot tables sharing a group Fixed with 3b64a198568d5b2bb14066581aca112cc6182fd7 Change-Id: Ideea06ea95f6c565e1487f2b27ef249c38c5d4dd --- sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx | Bin 0 -> 20180 bytes sc/qa/unit/subsequent_filters-test.cxx | 29 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx (limited to 'sc/qa') diff --git a/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx b/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx new file mode 100644 index 000000000000..2bc5cddfc870 Binary files /dev/null and b/sc/qa/unit/data/xlsx/pivot-table/shared_group.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 4b53e2d4a3ff..3195fa850297 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -200,6 +200,7 @@ public: void testPivotTableNamedRangeSourceODS(); void testPivotTableSharedCacheGroupODS(); void testGetPivotDataXLS(); + void testPivotTableSharedGroupXLSX(); void testFormulaDependency(); @@ -305,6 +306,7 @@ public: CPPUNIT_TEST(testPivotTableNamedRangeSourceODS); CPPUNIT_TEST(testPivotTableSharedCacheGroupODS); CPPUNIT_TEST(testGetPivotDataXLS); + CPPUNIT_TEST(testPivotTableSharedGroupXLSX); CPPUNIT_TEST(testRowHeightODS); CPPUNIT_TEST(testFormulaDependency); CPPUNIT_TEST(testRichTextContentODS); @@ -2063,6 +2065,33 @@ void ScFiltersTest::testGetPivotDataXLS() xDocSh->DoClose(); } +void ScFiltersTest::testPivotTableSharedGroupXLSX() +{ + ScDocShellRef xDocSh = loadDoc("pivot-table/shared_group.", FORMAT_XLSX); + CPPUNIT_ASSERT_MESSAGE("Failed to load file", xDocSh.Is()); + ScDocument& rDoc = xDocSh->GetDocument(); + rDoc.CalcAll(); + + // Check whether right group names are imported for both tables + // First table + CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), rDoc.GetString(ScAddress(0,2,0))); + CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), rDoc.GetString(ScAddress(0,3,0))); + CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), rDoc.GetString(ScAddress(0,4,0))); + CPPUNIT_ASSERT_EQUAL(OUString("16"), rDoc.GetString(ScAddress(0,5,0))); + CPPUNIT_ASSERT_EQUAL(OUString("17"), rDoc.GetString(ScAddress(0,6,0))); + CPPUNIT_ASSERT_EQUAL(OUString("18"), rDoc.GetString(ScAddress(0,7,0))); + + // Second table + CPPUNIT_ASSERT_EQUAL(OUString("Csoport1"), rDoc.GetString(ScAddress(0,12,0))); + CPPUNIT_ASSERT_EQUAL(OUString("Csoport2"), rDoc.GetString(ScAddress(0,13,0))); + CPPUNIT_ASSERT_EQUAL(OUString("Csoport3"), rDoc.GetString(ScAddress(0,14,0))); + CPPUNIT_ASSERT_EQUAL(OUString("16"), rDoc.GetString(ScAddress(0,15,0))); + CPPUNIT_ASSERT_EQUAL(OUString("17"), rDoc.GetString(ScAddress(0,16,0))); + CPPUNIT_ASSERT_EQUAL(OUString("18"), rDoc.GetString(ScAddress(0,17,0))); + + xDocSh->DoClose(); +} + void ScFiltersTest::testRowHeightODS() { ScDocShellRef xDocSh = loadDoc("row-height-import.", FORMAT_ODS); -- cgit