summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2016-11-12 18:58:17 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2016-11-12 21:36:25 -0500
commite8ccf9a2e37ea69fd92974125f824c70af4ef304 (patch)
tree35ed8f0bd5568a1193c78a1972a7b1270d71155a
parent73e21792efb36209b6ca8c14377e40756f9173b0 (diff)
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
-rw-r--r--sc/inc/calcmacros.hxx8
-rw-r--r--sc/inc/dpcache.hxx2
-rw-r--r--sc/inc/dpfilteredcache.hxx2
-rw-r--r--sc/inc/dpgroup.hxx4
-rw-r--r--sc/inc/dpnumgroupinfo.hxx2
-rw-r--r--sc/inc/dpobject.hxx3
-rw-r--r--sc/inc/dpsdbtab.hxx4
-rw-r--r--sc/inc/dpshttab.hxx4
-rw-r--r--sc/inc/dptabdat.hxx2
-rw-r--r--sc/source/core/data/dpcache.cxx4
-rw-r--r--sc/source/core/data/dpfilteredcache.cxx4
-rw-r--r--sc/source/core/data/dpgroup.cxx4
-rw-r--r--sc/source/core/data/dpnumgroupinfo.cxx4
-rw-r--r--sc/source/core/data/dpobject.cxx11
-rw-r--r--sc/source/core/data/dpsdbtab.cxx9
-rw-r--r--sc/source/core/data/dpshttab.cxx9
-rw-r--r--sc/source/core/data/dptabdat.cxx2
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx11
18 files changed, 68 insertions, 21 deletions
diff --git a/sc/inc/calcmacros.hxx b/sc/inc/calcmacros.hxx
index d2fc1da94b15..d5cffd5db88b 100644
--- a/sc/inc/calcmacros.hxx
+++ b/sc/inc/calcmacros.hxx
@@ -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>
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 304f1b59007f..bee579f59a10 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -198,7 +198,7 @@ public:
ScDPCache(ScDocument* pDoc);
~ScDPCache();
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
void Dump() const;
#endif
diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index 427144ccefe2..74967948d255 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -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
diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index 703dc5d21960..e45f3f45eda9 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -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
};
diff --git a/sc/inc/dpnumgroupinfo.hxx b/sc/inc/dpnumgroupinfo.hxx
index fab299e881a3..48906f151ffe 100644
--- a/sc/inc/dpnumgroupinfo.hxx
+++ b/sc/inc/dpnumgroupinfo.hxx
@@ -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
};
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index c2305c75dd24..753df75519ec 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -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
};
diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx
index a01053feaf71..2b6e6c37744a 100644
--- a/sc/inc/dpsdbtab.hxx
+++ b/sc/inc/dpsdbtab.hxx
@@ -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
diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index b1972500e4fc..c69cd479fc49 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -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
diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx
index fe9a52ce83e9..0f8a0f0e0da6 100644
--- a/sc/inc/dptabdat.hxx
+++ b/sc/inc/dptabdat.hxx
@@ -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
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 03ba6588301b..477112d5af8b 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -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 {
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index 805c3012da07..59c931680d2b 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -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
{
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index b2b162e9b19f..50aeeb6d2534 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -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
{
diff --git a/sc/source/core/data/dpnumgroupinfo.cxx b/sc/source/core/data/dpnumgroupinfo.cxx
index be496da51298..37aa36d6091d 100644
--- a/sc/source/core/data/dpnumgroupinfo.cxx
+++ b/sc/source/core/data/dpnumgroupinfo.cxx
@@ -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
{
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 6397c6de694e..3b78fe85f982 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -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)
diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx
index 474ab273da58..079fb9b0b34f 100644
--- a/sc/source/core/data/dpsdbtab.cxx
+++ b/sc/source/core/data/dpsdbtab.cxx
@@ -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: */
diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index cd96b08178e7..3fc321a03c89 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -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) {}
diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx
index d25a08f80ae0..634e7ebe3f55 100644
--- a/sc/source/core/data/dptabdat.cxx
+++ b/sc/source/core/data/dptabdat.cxx
@@ -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
{
}
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
index 904c850755ee..517bbe08dd8f 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -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());
}