[Libreoffice-commits] core.git: sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Thu Feb 14 13:31:10 PST 2013


 sc/inc/dptabres.hxx              |    3 ++
 sc/source/core/data/dptabres.cxx |   57 +++++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 29 deletions(-)

New commits:
commit 245ef21024d10be5fcbc22bf09aa4a7673fdcf26
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Feb 14 16:32:03 2013 -0500

    Misc cleanup - scope reduction, string, class description etc.
    
    Change-Id: I607efcda0f24d6d6c6b1359858fed417475ccde1

diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index b905b45..c9c168f 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -281,6 +281,9 @@ public:
     bool IsEnd( size_t nPos ) const ;
 };
 
+/**
+ * The term 'measure' here roughly equals "data dimension" ?
+ */
 class ScDPResultData
 {
 private:
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 7810ba5..5d80477 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -237,8 +237,9 @@ void ScDPInitState::RemoveMember()
         maMembers.pop_back();
 }
 
-static void lcl_DumpRow( const String& rType, const String& rName, const ScDPAggData* pAggData,
-                    ScDocument* pDoc, ScAddress& rPos )
+static void lcl_DumpRow(
+    const OUString& rType, const OUString& rName, const ScDPAggData* pAggData,
+    ScDocument* pDoc, ScAddress& rPos )
 {
     SCCOL nCol = rPos.Col();
     SCROW nRow = rPos.Row();
@@ -1603,38 +1604,37 @@ void ScDPResultMember::UpdateDataResults( const ScDPResultMember* pRefMember, lo
     bool bHasChild = ( pChildDimension != NULL );
 
     long nUserSubCount = GetSubTotalCount();
+
     // process subtotals even if not shown
-//  if ( nUserSubCount || !bHasChild )
-    {
-        // Calculate at least automatic if no subtotals are selected,
-        // show only own values if there's no child dimension (innermost).
-        if ( !nUserSubCount || !bHasChild )
-            nUserSubCount = 1;
 
-        long nMemberMeasure = nMeasure;
-        long nSubSize = pResultData->GetCountForMeasure(nMeasure);
+    // Calculate at least automatic if no subtotals are selected,
+    // show only own values if there's no child dimension (innermost).
+    if (!nUserSubCount || !bHasChild)
+        nUserSubCount = 1;
 
-        if ( pDataRoot )
-        {
-            ScDPSubTotalState aSubState;        // initial state
+    long nMemberMeasure = nMeasure;
+    long nSubSize = pResultData->GetCountForMeasure(nMeasure);
 
-            for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++)   // including hidden "automatic"
+    if (pDataRoot)
+    {
+        ScDPSubTotalState aSubState;        // initial state
+
+        for (long nUserPos = 0; nUserPos < nUserSubCount; ++nUserPos)   // including hidden "automatic"
+        {
+            if (bHasChild && nUserSubCount > 1)
             {
-                if ( bHasChild && nUserSubCount > 1 )
-                {
-                    aSubState.nRowSubTotalFunc = nUserPos;
-                    aSubState.eRowForce = lcl_GetForceFunc( /*pParentLevel*/GetParentLevel() , nUserPos );
-                }
+                aSubState.nRowSubTotalFunc = nUserPos;
+                aSubState.eRowForce = lcl_GetForceFunc(GetParentLevel(), nUserPos);
+            }
 
-                for ( long nSubCount=0; nSubCount<nSubSize; nSubCount++ )
-                {
-                    if ( nMeasure == SC_DPMEASURE_ALL )
-                        nMemberMeasure = nSubCount;
-                    else if ( pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL )
-                        nMemberMeasure = SC_DPMEASURE_ALL;
+            for (long nSubCount = 0; nSubCount < nSubSize; ++nSubCount)
+            {
+                if (nMeasure == SC_DPMEASURE_ALL)
+                    nMemberMeasure = nSubCount;
+                else if (pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL)
+                    nMemberMeasure = SC_DPMEASURE_ALL;
 
-                    pDataRoot->UpdateDataRow( pRefMember, nMemberMeasure, bHasChild, aSubState );
-                }
+                pDataRoot->UpdateDataRow(pRefMember, nMemberMeasure, bHasChild, aSubState);
             }
         }
     }
@@ -1871,8 +1871,6 @@ void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const ve
         InitFrom( pResultMember->GetChildDimension() );
     }
 
-    ScDPSubTotalState aLocalSubState(rSubState);        // keep row state, modify column
-
     long nUserSubCount = pResultMember ? pResultMember->GetSubTotalCount() : 0;
 
     // Calculate at least automatic if no subtotals are selected,
@@ -1880,6 +1878,7 @@ void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const ve
     if ( !nUserSubCount || !pChildDimension )
         nUserSubCount = 1;
 
+    ScDPSubTotalState aLocalSubState = rSubState;        // keep row state, modify column
     for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++)   // including hidden "automatic"
     {
         if ( pChildDimension && nUserSubCount > 1 )


More information about the Libreoffice-commits mailing list