diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-10-07 17:01:49 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-10-07 17:31:29 +0200 |
commit | fe6ea004872c86c4a2e5849c7c9e75905711d6f3 (patch) | |
tree | d1e0ab97642eb1a65d344305694926a7ef39a3e0 /sc/qa | |
parent | 7c757ade47bc47008d1292aac4989cfc995c3470 (diff) |
tdf#109016: Avoid to write the same pivot item member more times
It seems it's allowed to have the same member name in a pivot
table. We need to handle this in the filtering code.
Regression from:
625653c8d119e720fb93b0c9f6f50d1eb625b179
Change-Id: Ic6f4110da3d83f4bbf5284e1b772e9e31b250bf1
Reviewed-on: https://gerrit.libreoffice.org/43230
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc/qa')
-rwxr-xr-x | sc/qa/unit/data/xlsx/pivottable_duplicated_member_filter.xlsx | bin | 0 -> 16912 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/pivottable_duplicated_member_filter.xlsx b/sc/qa/unit/data/xlsx/pivottable_duplicated_member_filter.xlsx Binary files differnew file mode 100755 index 000000000000..21291a45ef96 --- /dev/null +++ b/sc/qa/unit/data/xlsx/pivottable_duplicated_member_filter.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 21837ff11152..72fe254d850c 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -227,6 +227,7 @@ public: void testPivotTableRowColPageFieldFilterXLSX(); void testPivotTableErrorItemFilterXLSX(); void testPivotTableOutlineModeXLSX(); + void testPivotTableDuplicatedMemberFilterXLSX(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -348,6 +349,7 @@ public: CPPUNIT_TEST(testPivotTableRowColPageFieldFilterXLSX); CPPUNIT_TEST(testPivotTableErrorItemFilterXLSX); CPPUNIT_TEST(testPivotTableOutlineModeXLSX); + CPPUNIT_TEST(testPivotTableDuplicatedMemberFilterXLSX); CPPUNIT_TEST_SUITE_END(); @@ -5270,6 +5272,20 @@ void ScExportTest::testPivotTableOutlineModeXLSX() assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[1]", "compact", "0"); } +void ScExportTest::testPivotTableDuplicatedMemberFilterXLSX() +{ + ScDocShellRef xShell = loadDoc("pivottable_duplicated_member_filter.", FORMAT_XLSX); + CPPUNIT_ASSERT(xShell.is()); + + std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); + xmlDocPtr pTable = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/pivotTables/pivotTable1.xml"); + CPPUNIT_ASSERT(pTable); + + // Check whether page field has the right number of items + assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[5]", "axis", "axisPage"); + assertXPath(pTable, "/x:pivotTableDefinition/x:pivotFields/x:pivotField[5]/x:items", "count", "21"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |