summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-07-06 21:06:59 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-06 21:06:59 -0400
commitbbcc5572caee525c354457ffc5df77644807523e (patch)
tree6ab4ac5e6eccf9ec9e847e3c69197d58829facec
parent2758492a670618262bd42e3b938f3fdf2e9141a2 (diff)
Test where the member count of a dimension changes after refresh.
Change-Id: I20d2d269c2ba8468a6743c9145e1c8b3552d12b4
-rw-r--r--sc/qa/unit/ucalc.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 46da7a093d52..93e5b803c3f6 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2768,6 +2768,32 @@ void Test::testPivotTableEmptyRows()
CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
}
+ // Modify the source to remove member 'A', then refresh the table.
+ m_pDoc->SetString(1, 2, 0, "B");
+
+ std::set<ScDPObject*> aRefs;
+ sal_uLong nErr = pDPs->ReloadCache(pDPObj, aRefs);
+ CPPUNIT_ASSERT_MESSAGE("Failed to reload cache.", !nErr);
+ CPPUNIT_ASSERT_MESSAGE("There should only be one pivot table linked to this cache.",
+ aRefs.size() == 1 && *aRefs.begin() == pDPObj);
+
+ pDPObj->ClearTableData();
+ aOutRange = refresh(pDPObj);
+
+ {
+ // Expected output table content. 0 = empty cell
+ const char* aOutputCheck[][2] = {
+ { "Name", 0 },
+ { "B", "3" },
+ { "C", "3" },
+ { "D", "4" },
+ { "Total Result", "10" },
+ };
+
+ bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
pDPs->FreeTable(pDPObj);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be no more tables.", pDPs->GetCount(), static_cast<size_t>(0));
CPPUNIT_ASSERT_EQUAL_MESSAGE("There shouldn't be any more cache stored.",