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

Move up the less common case and reduce indentation for the main case.

Change-Id: Id30a849af718629515251cac39eead39a2d9e5e6
üst a4c97429
...@@ -1580,34 +1580,33 @@ void ScDBDocFunc::RefreshPivotTableGroups(ScDPObject* pDPObj) ...@@ -1580,34 +1580,33 @@ void ScDBDocFunc::RefreshPivotTableGroups(ScDPObject* pDPObj)
if (!pSaveData) if (!pSaveData)
return; return;
if (!pDPs->HasTable(pDPObj))
{
// This table is under construction so no need for a whole update (UpdatePivotTable()).
pDPObj->ReloadGroupTableData();
return;
}
// Update all linked tables, if this table is part of the cache (ScDPCollection) // Update all linked tables, if this table is part of the cache (ScDPCollection)
if (pDPs->HasTable(pDPObj)) std::set<ScDPObject*> aRefs;
if (!pDPs->ReloadGroupsInCache(pDPObj, aRefs))
return;
// We allow pDimData being NULL.
const ScDPDimensionSaveData* pDimData = pSaveData->GetExistingDimensionData();
std::set<ScDPObject*>::iterator it = aRefs.begin(), itEnd = aRefs.end();
for (; it != itEnd; ++it)
{ {
std::set<ScDPObject*> aRefs; ScDPObject* pObj = *it;
if (!pDPs->ReloadGroupsInCache(pDPObj, aRefs)) if (pObj != pDPObj)
return;
// We allow pDimData being NULL.
const ScDPDimensionSaveData* pDimData = pSaveData->GetExistingDimensionData();
std::set<ScDPObject*>::iterator it = aRefs.begin(), itEnd = aRefs.end();
for (; it != itEnd; ++it)
{ {
ScDPObject* pObj = *it; pSaveData = pObj->GetSaveData();
if (pObj != pDPObj) if (pSaveData)
{ pSaveData->SetDimensionData(pDimData);
pSaveData = pObj->GetSaveData();
if (pSaveData)
pSaveData->SetDimensionData(pDimData);
}
// This action is intentionally not undoable since it modifies cache.
UpdatePivotTable(*pObj, false, false);
} }
}
else // Otherwise update only this single table // This action is intentionally not undoable since it modifies cache.
{ UpdatePivotTable(*pObj, false, false);
// This table is under construction so no need for a whole update (UpdatePivotTable()).
pDPObj->ReloadGroupTableData();
} }
} }
......
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