diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-30 10:45:27 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-08-30 10:45:27 -0400 |
commit | 6ad86f8cc036d01702e9d491874b2b3bde23fe77 (patch) | |
tree | 0d95d3815aa618786d4e780ca70435f4c8df24a5 /sc | |
parent | fdo#53938: Check for null pointer. (diff) | |
download | core-6ad86f8cc036d01702e9d491874b2b3bde23fe77.tar.gz core-6ad86f8cc036d01702e9d491874b2b3bde23fe77.zip |
fdo#53938: Don't proceed when error occurs.
This prevents the same error dialog from appearing 3 times in a row,
also the pivot table outout from becoming empty.
Change-Id: I09a72f78561f3f0446a95732fb9c242c1144878a
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dpobject.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 06ad5374b4fb..cba66ccb68b6 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -243,7 +243,7 @@ public: * Remove in the save data entries for members that don't exist anymore. * This is called during pivot table refresh. */ - void SyncAllDimensionMembers(); + bool SyncAllDimensionMembers(); static bool HasRegisteredSources(); static com::sun::star::uno::Sequence<rtl::OUString> GetRegisteredSources(); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index af6ac2dfc61f..78b1e0398405 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -859,26 +859,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; + 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 ) diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index d7cff6391edf..74674e6f5adb 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1470,7 +1470,8 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi) for (; it != itEnd; ++it) { ScDPObject* pObj = *it; - pObj->SyncAllDimensionMembers(); + if (!pObj->SyncAllDimensionMembers()) + continue; // This action is intentionally not undoable since it modifies cache. DataPilotUpdate(pObj, pObj, false, bApi); |