Let's hook up the pivot table dumper code to Ctrl-Shift-F8 as well.

It dumps the pivot data if the cursor is over a pivot table output,
else it dumps the column storage info.

Change-Id: I403e381be3f64d139f8bfaca7e477742a65dde9c
This commit is contained in:
Kohei Yoshida
2016-11-12 18:58:17 -05:00
parent 73e21792ef
commit e8ccf9a2e3
18 changed files with 68 additions and 21 deletions

View File

@@ -16,13 +16,19 @@
#define DEBUG_AREA_BROADCASTER 0
#define DUMP_COLUMN_STORAGE 0
#define DUMP_PIVOT_TABLE 0
#ifdef DBG_UTIL
#undef DUMP_COLUMN_STORAGE
#define DUMP_COLUMN_STORAGE 1
#undef DUMP_PIVOT_TABLE
#define DUMP_PIVOT_TABLE 1
#endif
#if DEBUG_PIVOT_TABLE || DUMP_COLUMN_STORAGE || DEBUG_COLUMN_STORAGE || DEBUG_FORMULA_COMPILER || DEBUG_AREA_BROADCASTER
#if DUMP_PIVOT_TABLE || DEBUG_PIVOT_TABLE || \
DUMP_COLUMN_STORAGE || DEBUG_COLUMN_STORAGE || \
DEBUG_FORMULA_COMPILER || \
DEBUG_AREA_BROADCASTER
#include <iostream>
#include <string>
#include <cstdio>

View File

@@ -198,7 +198,7 @@ public:
ScDPCache(ScDocument* pDoc);
~ScDPCache();
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void Dump() const;
#endif

View File

@@ -142,7 +142,7 @@ public:
void clear();
bool empty() const;
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void dumpRowFlag(const RowFlagType& rFlag) const;
void dump() const;
#endif

View File

@@ -179,8 +179,8 @@ public:
virtual bool HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex,
const ScDPItemData& rSecondData, long nSecondIndex ) const override;
#if DEBUG_PIVOT_TABLE
virtual void Dump() const;
#if DUMP_PIVOT_TABLE
virtual void Dump() const override;
#endif
};

View File

@@ -27,7 +27,7 @@ struct ScDPNumGroupInfo
SC_DLLPUBLIC ScDPNumGroupInfo();
SC_DLLPUBLIC ScDPNumGroupInfo(const ScDPNumGroupInfo& r);
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void Dump() const;
#endif
};

View File

@@ -251,7 +251,8 @@ public:
static bool IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags );
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void Dump() const;
void DumpCache() const;
#endif
};

View File

@@ -77,6 +77,10 @@ public:
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) override;
virtual const ScDPFilteredCache& GetCacheTable() const override;
virtual void ReloadCacheTable() override;
#if DUMP_PIVOT_TABLE
virtual void Dump() const override;
#endif
};
#endif

View File

@@ -119,6 +119,10 @@ public:
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) override;
virtual const ScDPFilteredCache& GetCacheTable() const override;
virtual void ReloadCacheTable() override;
#if DUMP_PIVOT_TABLE
virtual void Dump() const override;
#endif
};
#endif

View File

@@ -142,7 +142,7 @@ public:
virtual long GetSourceDim( long nDim );
virtual long Compare( long nDim, long nDataId1, long nDataId2);
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
virtual void Dump() const;
#endif

View File

@@ -37,7 +37,7 @@
#include <svl/zforlist.hxx>
#include <o3tl/make_unique.hxx>
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#endif
@@ -1211,7 +1211,7 @@ SCROW ScDPCache::GetOrder(long /*nDim*/, SCROW nIndex)
}
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
namespace {

View File

@@ -406,9 +406,7 @@ bool ScDPFilteredCache::isRowQualified(sal_Int32 nRow, const vector<Criterion>&
return true;
}
#if DEBUG_PIVOT_TABLE
using std::cout;
using std::endl;
#if DUMP_PIVOT_TABLE
void ScDPFilteredCache::dumpRowFlag(const RowFlagType& rFlag) const
{

View File

@@ -1038,9 +1038,7 @@ long ScDPGroupTableData::Compare(long nDim, long nDataId1, long nDataId2)
return ScDPItemData::Compare( *GetMemberById(nDim, nDataId1),*GetMemberById(nDim, nDataId2) );
}
#if DEBUG_PIVOT_TABLE
using std::cout;
using std::endl;
#if DUMP_PIVOT_TABLE
void ScDPGroupTableData::Dump() const
{

View File

@@ -26,9 +26,7 @@ ScDPNumGroupInfo::ScDPNumGroupInfo(const ScDPNumGroupInfo& r) :
mfStart(r.mfStart),
mfEnd(r.mfEnd), mfStep(r.mfStep) {}
#if DEBUG_PIVOT_TABLE
using std::cout;
using std::endl;
#if DUMP_PIVOT_TABLE
void ScDPNumGroupInfo::Dump() const
{

View File

@@ -2880,7 +2880,16 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS
return xRet;
}
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void ScDPObject::Dump() const
{
if (!mpTableData)
return;
mpTableData->Dump();
}
void ScDPObject::DumpCache() const
{
if (!mpTableData)

View File

@@ -159,4 +159,13 @@ void ScDatabaseDPData::ReloadCacheTable()
CreateCacheTable();
}
#if DUMP_PIVOT_TABLE
void ScDatabaseDPData::Dump() const
{
// TODO : Implement this.
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -209,6 +209,15 @@ void ScSheetDPData::ReloadCacheTable()
CreateCacheTable();
}
#if DUMP_PIVOT_TABLE
void ScSheetDPData::Dump() const
{
// TODO : Implement this.
}
#endif
ScSheetSourceDesc::ScSheetSourceDesc(ScDocument* pDoc) :
mpDoc(pDoc) {}

View File

@@ -293,7 +293,7 @@ long ScDPTableData::Compare( long nDim, long nDataId1, long nDataId2)
return -1;
}
#if DEBUG_PIVOT_TABLE
#if DUMP_PIVOT_TABLE
void ScDPTableData::Dump() const
{
}

View File

@@ -17,6 +17,7 @@
#include "patattr.hxx"
#include <svl/poolitem.hxx>
#include "userdat.hxx"
#include <dpobject.hxx>
namespace {
@@ -118,6 +119,16 @@ void ScGridWindow::dumpColumnCellStorage()
ScAddress aCurPos = pViewData->GetCurPos();
ScDocument* pDoc = pViewData->GetDocument();
const ScDPObject* pDP = pDoc->GetDPAtCursor(aCurPos.Col(), aCurPos.Row(), aCurPos.Tab());
if (pDP)
{
// Dump the pivot table info if the cursor is over a pivot table.
pDP->Dump();
pDP->DumpCache();
return;
}
// Dump the column cell storage info.
pDoc->DumpColumnStorage(aCurPos.Tab(), aCurPos.Col());
}