Kaydet (Commit) 5e4b9d96 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 2230dd01
......@@ -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;
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment