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

Kohei Yoshida kohei.yoshida at gmail.com
Thu Feb 14 18:51:29 PST 2013


 sc/inc/dptabres.hxx              |   17 +++++++++++++----
 sc/source/core/data/dptabres.cxx |   18 +++++++++++++++---
 2 files changed, 28 insertions(+), 7 deletions(-)

New commits:
commit 5e4b9d960e88b6137d952845fe121836e73f3ca3
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Feb 14 21:51:41 2013 -0500

    Disable DumpState() and its friends when not debugging pivot code.
    
    I was just about to add a similar set of functions to dump the internals,
    but I can re-use these.
    
    Change-Id: I212f0a6ea7a32233991f6cdb64e27be39c5af2ee

diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 8ebdc8a..70c2b14 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -22,6 +22,7 @@
 
 #include "global.hxx"
 #include "dpfilteredcache.hxx"
+#include "dpmacros.hxx"
 
 #include <tools/string.hxx>
 #include <com/sun/star/sheet/MemberResult.hpp>
@@ -413,7 +414,9 @@ public:
 
     void ResetResults();
 
-    void                DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#if DEBUG_PIVOT_TABLE
+    void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#endif
 
                         //! this will be removed!
     const ScDPResultDimension*  GetChildDimension() const   { return pChildDimension; }
@@ -478,7 +481,9 @@ public:
 
     void                ResetResults();
 
-    void                DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#if DEBUG_PIVOT_TABLE
+    void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#endif
 
                         //! this will be removed!
     const ScDPDataDimension*    GetChildDimension() const   { return pChildDimension; }
@@ -572,7 +577,9 @@ public:
         const ScDPRelativePos* pMemberPos, const OUString* pName,
         long nRefDimPos, const ScDPRunningTotalState& rRunning );
 
-    void                DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#if DEBUG_PIVOT_TABLE
+    void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
+#endif
 
                         //  for ScDPDataDimension::InitFrom
     long                GetMemberCount() const;
@@ -632,7 +639,9 @@ public:
 
     void                ResetResults();
 
-    void                DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const;
+#if DEBUG_PIVOT_TABLE
+    void DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const;
+#endif
 
     long                GetMemberCount() const;
     const ScDPDataMember*     GetMember(long n) const;
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 58d0c2e..7d571bb 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -237,7 +237,10 @@ void ScDPInitState::RemoveMember()
         maMembers.pop_back();
 }
 
-static void lcl_DumpRow(
+namespace {
+
+#if DEBUG_PIVOT_TABLE
+void lcl_DumpRow(
     const OUString& rType, const OUString& rName, const ScDPAggData* pAggData,
     ScDocument* pDoc, ScAddress& rPos )
 {
@@ -254,7 +257,7 @@ static void lcl_DumpRow(
     rPos.SetRow( nRow + 1 );
 }
 
-static void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos )
+void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos )
 {
     SCCOL nCol = rPos.Col();
     SCTAB nTab = rPos.Tab();
@@ -270,8 +273,9 @@ static void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos
         }
     }
 }
+#endif
 
-// -----------------------------------------------------------------------
+}
 
 ScDPRunningTotalState::ScDPRunningTotalState( ScDPResultMember* pColRoot, ScDPResultMember* pRowRoot ) :
     pColResRoot(pColRoot), pRowResRoot(pRowRoot)
@@ -1707,6 +1711,7 @@ void ScDPResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
     }
 }
 
+#if DEBUG_PIVOT_TABLE
 void ScDPResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     lcl_DumpRow( rtl::OUString("ScDPResultMember"), GetName(), NULL, pDoc, rPos );
@@ -1720,6 +1725,7 @@ void ScDPResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument
 
     lcl_Indent( pDoc, nStartRow, rPos );
 }
+#endif
 
 ScDPAggData* ScDPResultMember::GetColTotal( long nMeasure ) const
 {
@@ -2546,6 +2552,7 @@ void ScDPDataMember::UpdateRunningTotals(
     }
 }
 
+#if DEBUG_PIVOT_TABLE
 void ScDPDataMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     lcl_DumpRow( rtl::OUString("ScDPDataMember"), GetName(), &aAggregate, pDoc, rPos );
@@ -2558,6 +2565,7 @@ void ScDPDataMember::DumpState( const ScDPResultMember* pRefMember, ScDocument*
 
     lcl_Indent( pDoc, nStartRow, rPos );
 }
+#endif
 
 // -----------------------------------------------------------------------
 
@@ -3357,6 +3365,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember(
     return pColMember;
 }
 
+#if DEBUG_PIVOT_TABLE
 void ScDPResultDimension::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     rtl::OUString aDimName = bIsDataLayout ? rtl::OUString("(data layout)") : rtl::OUString(GetName());
@@ -3373,6 +3382,7 @@ void ScDPResultDimension::DumpState( const ScDPResultMember* pRefMember, ScDocum
 
     lcl_Indent( pDoc, nStartRow, rPos );
 }
+#endif
 
 long ScDPResultDimension::GetMemberCount() const
 {
@@ -3717,6 +3727,7 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim,
     }
 }
 
+#if DEBUG_PIVOT_TABLE
 void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const
 {
     rtl::OUString aDimName = bIsDataLayout ? rtl::OUString("(data layout)") : rtl::OUString("(unknown)");
@@ -3734,6 +3745,7 @@ void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocumen
 
     lcl_Indent( pDoc, nStartRow, rPos );
 }
+#endif
 
 long ScDPDataDimension::GetMemberCount() const
 {


More information about the Libreoffice-commits mailing list