summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-08-30 10:36:57 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-08-30 11:20:44 -0400
commitc3148ae81b8458624b7ee829d34629dea29f8cdf (patch)
tree6460c09d77a2de0ddcb2d3b6622a7ce2538ff177 /sc/source/core
parent8d3ea9985e6defd2b6522b755a29c6406c8cdcb6 (diff)
fdo#53938: Check for null pointer, and don't proceed when error occurs.
This prevents the crash, the same error dialog from appearing 3 times in a row, and also prevents the pivot table outout from becoming empty on error condition. Change-Id: I09a72f78561f3f0446a95732fb9c242c1144878a Signed-off-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/dpobject.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index c21dfb662fcf..f4b39ffcf0e4 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -705,21 +705,27 @@ void ScDPObject::BuildAllDimensionMembers()
pSaveData->BuildAllDimensionMembers(GetTableData());
}
-void ScDPObject::SyncAllDimensionMembers()
+bool ScDPObject::SyncAllDimensionMembers()
{
if (!pSaveData)
- return;
+ return false;
// #i111857# don't always create empty mpTableData for external service.
// Ideally, xSource should be used instead of mpTableData.
if (pServDesc)
- return;
+ return false;
ScDPTableData* pData = GetTableData();
+ if (!pData)
+ // No table data exists. This can happen when refreshing from an
+ // external source which doesn't exist.
+ return false;
+
// Refresh the cache wrapper since the cache may have changed.
pData->SetEmptyFlags(pSaveData->GetIgnoreEmptyRows(), pSaveData->GetRepeatIfEmpty());
pData->ReloadCacheTable();
pSaveData->SyncAllDimensionMembers(pData);
+ return true;
}
bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence<OUString>& rNames )