summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2018-11-22 11:30:29 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-11-29 00:57:59 +0100
commit6481bda69ade61cb5420156272fcf17edd43d620 (patch)
treeacf8dfdb8404c76bf4002f426493ba9ab30f67ae /sc/qa/unit
parent00caf3994cab5a25fd4ff147e2860a439b69c731 (diff)
tdf#121612: update pivot caches during saving to XLSX
Cache was empty so pivot table was not exported completely and pivot table filter were missing. Change-Id: Ib0b9e98a5588159c5c7de1e2e5d2bdcbfe986d8d Reviewed-on: https://gerrit.libreoffice.org/63785 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/ods/tdf121612.odsbin0 -> 48719 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf121612.ods b/sc/qa/unit/data/ods/tdf121612.ods
new file mode 100644
index 000000000000..6afc4e0c931c
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf121612.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 1425ff330954..f084ad015f29 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -39,6 +39,7 @@
#include <validat.hxx>
#include <global.hxx>
#include <scmod.hxx>
+#include <dpobject.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdograf.hxx>
@@ -206,6 +207,7 @@ public:
void testKeepSettingsOfBlankRows();
void testTdf118990();
+ void testTdf121612();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -319,6 +321,7 @@ public:
CPPUNIT_TEST(testKeepSettingsOfBlankRows);
CPPUNIT_TEST(testTdf118990);
+ CPPUNIT_TEST(testTdf121612);
CPPUNIT_TEST_SUITE_END();
@@ -4169,6 +4172,23 @@ void ScExportTest::testTdf118990()
xDocSh->DoClose();
}
+void ScExportTest::testTdf121612()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf121612.", FORMAT_ODS);
+ CPPUNIT_ASSERT(xDocSh.is());
+ xDocSh = saveAndReload(xDocSh.get(), FORMAT_XLSX);
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // There should be a pivot table
+ CPPUNIT_ASSERT(rDoc.HasPivotTable());
+
+ // DP collection is not lost after export and has one entry
+ ScDPCollection* pDPColl = rDoc.GetDPCollection();
+ CPPUNIT_ASSERT(pDPColl);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pDPColl->GetCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();