Kaydet (Commit) 6ad86f8c authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 286ce144
...@@ -243,7 +243,7 @@ public: ...@@ -243,7 +243,7 @@ public:
* Remove in the save data entries for members that don't exist anymore. * Remove in the save data entries for members that don't exist anymore.
* This is called during pivot table refresh. * This is called during pivot table refresh.
*/ */
void SyncAllDimensionMembers(); bool SyncAllDimensionMembers();
static bool HasRegisteredSources(); static bool HasRegisteredSources();
static com::sun::star::uno::Sequence<rtl::OUString> GetRegisteredSources(); static com::sun::star::uno::Sequence<rtl::OUString> GetRegisteredSources();
......
...@@ -859,26 +859,27 @@ void ScDPObject::BuildAllDimensionMembers() ...@@ -859,26 +859,27 @@ void ScDPObject::BuildAllDimensionMembers()
pSaveData->BuildAllDimensionMembers(GetTableData()); pSaveData->BuildAllDimensionMembers(GetTableData());
} }
void ScDPObject::SyncAllDimensionMembers() bool ScDPObject::SyncAllDimensionMembers()
{ {
if (!pSaveData) if (!pSaveData)
return; return false;
// #i111857# don't always create empty mpTableData for external service. // #i111857# don't always create empty mpTableData for external service.
// Ideally, xSource should be used instead of mpTableData. // Ideally, xSource should be used instead of mpTableData.
if (pServDesc) if (pServDesc)
return; return false;
ScDPTableData* pData = GetTableData(); ScDPTableData* pData = GetTableData();
if (!pData) if (!pData)
// No table data exists. This can happen when refreshing from an // No table data exists. This can happen when refreshing from an
// external source which doesn't exist. // external source which doesn't exist.
return; return false;
// Refresh the cache wrapper since the cache may have changed. // Refresh the cache wrapper since the cache may have changed.
pData->SetEmptyFlags(pSaveData->GetIgnoreEmptyRows(), pSaveData->GetRepeatIfEmpty()); pData->SetEmptyFlags(pSaveData->GetIgnoreEmptyRows(), pSaveData->GetRepeatIfEmpty());
pData->ReloadCacheTable(); pData->ReloadCacheTable();
pSaveData->SyncAllDimensionMembers(pData); pSaveData->SyncAllDimensionMembers(pData);
return true;
} }
bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence<OUString>& rNames ) bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence<OUString>& rNames )
......
...@@ -1470,7 +1470,8 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi) ...@@ -1470,7 +1470,8 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi)
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
{ {
ScDPObject* pObj = *it; ScDPObject* pObj = *it;
pObj->SyncAllDimensionMembers(); if (!pObj->SyncAllDimensionMembers())
continue;
// This action is intentionally not undoable since it modifies cache. // This action is intentionally not undoable since it modifies cache.
DataPilotUpdate(pObj, pObj, false, bApi); DataPilotUpdate(pObj, pObj, false, bApi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment