summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-12-05 14:16:25 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-12-05 14:17:33 -0500
commit6e57e691fa87b4b60678cc3f9a89ac7034a0ebdd (patch)
tree85fbdff9ed21bf4cc8266001ef7ce9659508a7e8
parent56bb08e75c12cb85041607f7f34451018b09414f (diff)
Same logic without using the boolean variable.
Slightly simpler to follow its logic. Change-Id: I988158c93c813fbeffe8e0319c7970d2d3cf3e02
-rw-r--r--sc/source/ui/view/dbfunc3.cxx25
1 files changed, 9 insertions, 16 deletions
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 5925e3f483e0..84754c2c94cc 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1238,8 +1238,6 @@ void ScDBFunc::UngroupDataPilot()
ScDPDimensionSaveData* pDimData = aData.GetDimensionData();
- bool bApply = false;
-
ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName );
const ScDPSaveNumGroupDimension* pNumGroupDim = pDimData->GetNumGroupDim( aDimName );
if ( ( pGroupDim && pGroupDim->GetDatePart() != 0 ) ||
@@ -1249,10 +1247,10 @@ void ScDBFunc::UngroupDataPilot()
// This is done using DateGroupDataPilot with nParts=0.
DateGroupDataPilot( ScDPNumGroupInfo(), 0 );
- // bApply remains FALSE
- // dimension pointers become invalid
+ return;
}
- else if ( pGroupDim )
+
+ if ( pGroupDim )
{
ScDPUniqueStringSet::const_iterator it = aEntries.begin(), itEnd = aEntries.end();
for (; it != itEnd; ++it)
@@ -1275,26 +1273,21 @@ void ScDBFunc::UngroupDataPilot()
// also remove SaveData settings for the dimension that no longer exists
aData.RemoveDimensionByName( aDimName );
}
- bApply = true;
}
else if ( pNumGroupDim )
{
// remove the numerical grouping
pDimData->RemoveNumGroupDimension( aDimName );
// SaveData settings can remain unchanged - the same dimension still exists
- bApply = true;
}
- if ( bApply )
- {
- // apply changes
- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
- pDPObj->SetSaveData( aData );
- aFunc.RefreshPivotTableGroups(pDPObj);
+ // apply changes
+ ScDBDocFunc aFunc( *GetViewData()->GetDocShell() );
+ pDPObj->SetSaveData( aData );
+ aFunc.RefreshPivotTableGroups(pDPObj);
- // unmark cell selection
- Unmark();
- }
+ // unmark cell selection
+ Unmark();
}
static OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName)