sc/source/ui/view/dbfunc3.cxx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
New commits: commit 6e57e691fa87b4b60678cc3f9a89ac7034a0ebdd Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Wed Dec 5 14:16:25 2012 -0500 Same logic without using the boolean variable. Slightly simpler to follow its logic. Change-Id: I988158c93c813fbeffe8e0319c7970d2d3cf3e02 diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 5925e3f..84754c2 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits