[Libreoffice-commits] .: Branch 'libreoffice-4-0' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 5 11:17:53 PST 2012


 sc/source/ui/view/dbfunc3.cxx |   25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

New commits:
commit 233d840bd2f56ea50e0a26b96e42c2fae802c427
Author: Kohei Yoshida <kohei.yoshida at 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)


More information about the Libreoffice-commits mailing list