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

Kohei Yoshida kohei.yoshida at collabora.com
Sun Nov 13 02:38:16 UTC 2016


 sc/inc/calcmacros.hxx                   |    8 +++++++-
 sc/inc/dpcache.hxx                      |    2 +-
 sc/inc/dpfilteredcache.hxx              |    4 ++--
 sc/inc/dpgroup.hxx                      |    4 ++--
 sc/inc/dpnumgroupinfo.hxx               |    2 +-
 sc/inc/dpobject.hxx                     |    3 ++-
 sc/inc/dpsave.hxx                       |    6 +++---
 sc/inc/dpsdbtab.hxx                     |    4 ++++
 sc/inc/dpshttab.hxx                     |    4 ++++
 sc/inc/dptabdat.hxx                     |    2 +-
 sc/inc/dptabres.hxx                     |   10 +++++-----
 sc/inc/dptabsrc.hxx                     |    2 +-
 sc/source/core/data/dpcache.cxx         |   21 ++++++++++-----------
 sc/source/core/data/dpfilteredcache.cxx |    6 ++----
 sc/source/core/data/dpgroup.cxx         |    4 +---
 sc/source/core/data/dpnumgroupinfo.cxx  |    4 +---
 sc/source/core/data/dpobject.cxx        |   12 +++++++++++-
 sc/source/core/data/dpsave.cxx          |    6 +++---
 sc/source/core/data/dpsdbtab.cxx        |    9 +++++++++
 sc/source/core/data/dpshttab.cxx        |    9 +++++++++
 sc/source/core/data/dptabdat.cxx        |    2 +-
 sc/source/core/data/dptabres.cxx        |   32 ++++++++++++++++----------------
 sc/source/core/data/dptabsrc.cxx        |    6 +++++-
 sc/source/ui/view/gridwin_dbgutil.cxx   |   11 +++++++++++
 24 files changed, 112 insertions(+), 61 deletions(-)

New commits:
commit 892ad530b8898b5b6cb2e9c937c20599ea3e84fd
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 20:55:38 2016 -0500

    Actually this should be MAXROWCOUNT.
    
    Since the end value is non-inclusive in flat_segment_tree.
    
    Change-Id: I5f1febe378ab5c815d420ae77e38286fec8835b6

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 2158263..fd41b12 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -55,7 +55,7 @@ ScDPCache::Field::Field() : mnNumFormat(0) {}
 ScDPCache::ScDPCache(ScDocument* pDoc) :
     mpDoc( pDoc ),
     mnColumnCount ( 0 ),
-    maEmptyRows(0, MAXROW, true),
+    maEmptyRows(0, MAXROWCOUNT, true),
     mnDataSize(-1),
     mnRowCount(0),
     mbDisposing(false)
commit c000b8144ee494743571d10b4958c3c0ec2591bd
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 20:53:38 2016 -0500

    Address warning from the MSVC compiler.
    
    warning C4701: potentially uninitialized local variable 'aRange' used
    
    Change-Id: I06753a17f9b7efa35395f943f8a2ecccdd194be9

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 477112d..2158263 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -1310,15 +1310,14 @@ void ScDPCache::Dump() const
         {
             aRange.start = it->first;
             aRange.empty = it->second;
-            ++it;
-        }
 
-        for (; it != itEnd; ++it)
-        {
-            aRange.end = it->first-1;
-            cout << "    rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << endl;
-            aRange.start = it->first;
-            aRange.empty = it->second;
+            for (++it; it != itEnd; ++it)
+            {
+                aRange.end = it->first-1;
+                cout << "    rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << endl;
+                aRange.start = it->first;
+                aRange.empty = it->second;
+            }
         }
     }
 
commit 61228277fddba7e92f69bbee12010fb53835827d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 20:16:06 2016 -0500

    loplugin:staticmethods
    
    Change-Id: I674afe58964c27c349012de1117db3e362e72e5f

diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index 7496794..2b160f4 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -143,7 +143,7 @@ public:
     bool empty() const;
 
 #if DUMP_PIVOT_TABLE
-    void dumpRowFlag(const RowFlagType& rFlag) const;
+    static void dumpRowFlag( const RowFlagType& rFlag );
     void dump() const;
 #endif
 
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index 59c9316..e43132c 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -408,7 +408,7 @@ bool ScDPFilteredCache::isRowQualified(sal_Int32 nRow, const vector<Criterion>&
 
 #if DUMP_PIVOT_TABLE
 
-void ScDPFilteredCache::dumpRowFlag(const RowFlagType& rFlag) const
+void ScDPFilteredCache::dumpRowFlag( const RowFlagType& rFlag )
 {
     RowFlagType::const_iterator it = rFlag.begin(), itEnd = rFlag.end();
     bool bShow = it->second;
commit cc46bcc68b2f10ce01e70793589943723995ecc4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 19:50:49 2016 -0500

    loplugin:stringconstant
    
    Change-Id: Ia32a99530b8b32dc82dbca79d8c8ca1f2e090a96

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index c6f4edf..cba41fd 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -267,7 +267,7 @@ void ScDPInitState::RemoveMember()
 namespace {
 
 #if DUMP_PIVOT_TABLE
-void lcl_DumpRow(
+void dumpRow(
     const OUString& rType, const OUString& rName, const ScDPAggData* pAggData,
     ScDocument* pDoc, ScAddress& rPos )
 {
@@ -284,7 +284,7 @@ void lcl_DumpRow(
     rPos.SetRow( nRow + 1 );
 }
 
-void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos )
+void indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos )
 {
     SCCOL nCol = rPos.Col();
     SCTAB nTab = rPos.Tab();
@@ -1766,7 +1766,7 @@ void ScDPResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
 #if DUMP_PIVOT_TABLE
 void ScDPResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
-    lcl_DumpRow( OUString("ScDPResultMember"), GetName(), NULL, pDoc, rPos );
+    dumpRow("ScDPResultMember", GetName(), nullptr, pDoc, rPos);
     SCROW nStartRow = rPos.Row();
 
     if (pDataRoot)
@@ -1775,7 +1775,7 @@ void ScDPResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument
     if (pChildDimension)
         pChildDimension->DumpState( pRefMember, pDoc, rPos );
 
-    lcl_Indent( pDoc, nStartRow, rPos );
+    indent(pDoc, nStartRow, rPos);
 }
 
 void ScDPResultMember::Dump(int nIndent) const
@@ -2628,7 +2628,7 @@ void ScDPDataMember::UpdateRunningTotals(
 #if DUMP_PIVOT_TABLE
 void ScDPDataMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
-    lcl_DumpRow( OUString("ScDPDataMember"), GetName(), &aAggregate, pDoc, rPos );
+    dumpRow("ScDPDataMember", GetName(), &aAggregate, pDoc, rPos);
     SCROW nStartRow = rPos.Row();
 
     const ScDPDataDimension* pDataChild = GetChildDimension();
@@ -2636,7 +2636,7 @@ void ScDPDataMember::DumpState( const ScDPResultMember* pRefMember, ScDocument*
     if ( pDataChild && pRefChild )
         pDataChild->DumpState( pRefChild, pDoc, rPos );
 
-    lcl_Indent( pDoc, nStartRow, rPos );
+    indent(pDoc, nStartRow, rPos);
 }
 
 void ScDPDataMember::Dump(int nIndent) const
@@ -3444,7 +3444,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember(
 void ScDPResultDimension::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     OUString aDimName = bIsDataLayout ? OUString("(data layout)") : OUString(GetName());
-    lcl_DumpRow( OUString("ScDPResultDimension"), aDimName, NULL, pDoc, rPos );
+    dumpRow("ScDPResultDimension", aDimName, nullptr, pDoc, rPos);
 
     SCROW nStartRow = rPos.Row();
 
@@ -3455,7 +3455,7 @@ void ScDPResultDimension::DumpState( const ScDPResultMember* pRefMember, ScDocum
         pMember->DumpState( pRefMember, pDoc, rPos );
     }
 
-    lcl_Indent( pDoc, nStartRow, rPos );
+    indent(pDoc, nStartRow, rPos);
 }
 
 void ScDPResultDimension::Dump(int nIndent) const
@@ -3824,7 +3824,7 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim,
 void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const
 {
     OUString aDimName = bIsDataLayout ? OUString("(data layout)") : OUString("(unknown)");
-    lcl_DumpRow( OUString("ScDPDataDimension"), aDimName, NULL, pDoc, rPos );
+    dumpRow("ScDPDataDimension", aDimName, nullptr, pDoc, rPos);
 
     SCROW nStartRow = rPos.Row();
 
@@ -3836,7 +3836,7 @@ void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocumen
         pDataMember->DumpState( pRefMember, pDoc, rPos );
     }
 
-    lcl_Indent( pDoc, nStartRow, rPos );
+    indent(pDoc, nStartRow, rPos);
 }
 
 void ScDPDataDimension::Dump(int nIndent) const
commit 8ce6e2e8bc4c1d8e8963f7fb5cdc651b2445d4ea
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 19:25:00 2016 -0500

    Dump the state of the "save" data as well.
    
    The "save" data is basically a section of the pivot table data that
    needs to be saved to the file.
    
    Change-Id: I2589c0fcd6df2458d35397b358064645fd97687f

diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index bb1e8ac..a264ce7 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -84,7 +84,7 @@ public:
     void WriteToSource( const css::uno::Reference<css::uno::XInterface>& xMember,
                             sal_Int32 nPosition );
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void Dump(int nIndent = 0) const;
 #endif
 };
@@ -226,7 +226,7 @@ public:
 
     void RemoveObsoleteMembers(const MemberSetType& rMembers);
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void Dump(int nIndent = 0) const;
 #endif
 };
@@ -363,7 +363,7 @@ public:
      */
     SC_DLLPUBLIC bool HasInvisibleMember(const OUString& rDimName) const;
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void Dump() const;
 #endif
 
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 3b78fe8..4c07fb1 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2884,10 +2884,11 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS
 
 void ScDPObject::Dump() const
 {
-    if (!mpTableData)
-        return;
+    if (pSaveData)
+        pSaveData->Dump();
 
-    mpTableData->Dump();
+    if (mpTableData)
+        mpTableData->Dump();
 }
 
 void ScDPObject::DumpCache() const
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index f3bfef7..320be4d 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -166,7 +166,7 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
     }
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 
 void ScDPSaveMember::Dump(int nIndent) const
 {
@@ -746,7 +746,7 @@ void ScDPSaveDimension::RemoveObsoleteMembers(const MemberSetType& rMembers)
     maMemberList.swap(aNew);
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 
 void ScDPSaveDimension::Dump(int nIndent) const
 {
@@ -1424,7 +1424,7 @@ bool ScDPSaveData::HasInvisibleMember(const OUString& rDimName) const
     return pDim->HasInvisibleMember();
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 
 void ScDPSaveData::Dump() const
 {
commit b090a7c9a8e49fb3e4ca28ac5c5bd3fcc9800a8d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 19:13:37 2016 -0500

    Let's just dump the result tree in dbgutil build.
    
    Change-Id: I491a36152bb2106a7917a0fd548bd5b34d7021c6

diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 112525c..05efe99 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -185,7 +185,7 @@ public:
     const ScDPAggData*  GetExistingChild() const    { return pChild; }
     ScDPAggData*        GetChild();
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void Dump(int nIndent) const;
 #endif
 };
@@ -408,7 +408,7 @@ public:
 
     void ResetResults();
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
 
     void Dump(int nIndent) const;
@@ -479,7 +479,7 @@ public:
 
     void                ResetResults();
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
     void Dump(int nIndent) const;
 #endif
@@ -577,7 +577,7 @@ public:
         const ScDPRelativePos* pMemberPos, const OUString* pName,
         long nRefDimPos, const ScDPRunningTotalState& rRunning );
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
     void Dump(int nIndent) const;
 #endif
@@ -641,7 +641,7 @@ public:
 
     void                ResetResults();
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const;
     void Dump(int nIndent) const;
 #endif
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index 99c23f8..3fca6ce 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -250,7 +250,7 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
                                 throw(css::uno::RuntimeException, std::exception) override;
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
     void DumpResults() const;
 #endif
 };
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 2d5e72d..c6f4edf 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -266,7 +266,7 @@ void ScDPInitState::RemoveMember()
 
 namespace {
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void lcl_DumpRow(
     const OUString& rType, const OUString& rName, const ScDPAggData* pAggData,
     ScDocument* pDoc, ScAddress& rPos )
@@ -643,7 +643,7 @@ void ScDPAggData::Reset()
     pChild = nullptr;
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPAggData::Dump(int nIndent) const
 {
     std::string aIndent(nIndent*2, ' ');
@@ -1763,7 +1763,7 @@ void ScDPResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember,
     }
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     lcl_DumpRow( OUString("ScDPResultMember"), GetName(), NULL, pDoc, rPos );
@@ -2625,7 +2625,7 @@ void ScDPDataMember::UpdateRunningTotals(
     }
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPDataMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     lcl_DumpRow( OUString("ScDPDataMember"), GetName(), &aAggregate, pDoc, rPos );
@@ -3440,7 +3440,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember(
     return pColMember;
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPResultDimension::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
 {
     OUString aDimName = bIsDataLayout ? OUString("(data layout)") : OUString(GetName());
@@ -3820,7 +3820,7 @@ void ScDPDataDimension::UpdateRunningTotals( const ScDPResultDimension* pRefDim,
     }
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPDataDimension::DumpState( const ScDPResultDimension* pRefDim, ScDocument* pDoc, ScAddress& rPos ) const
 {
     OUString aDimName = bIsDataLayout ? OUString("(data layout)") : OUString("(unknown)");
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index a0e145e..2454bdf 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -976,6 +976,10 @@ void ScDPSource::CreateRes_Impl()
     ScDPRunningTotalState aRunning( pColResRoot, pRowResRoot );
     ScDPRowTotals aTotals;
     pRowResRoot->UpdateRunningTotals( pColResRoot, pResData->GetRowStartMeasure(), aRunning, aTotals );
+
+#if DUMP_PIVOT_TABLE
+    DumpResults();
+#endif
 }
 
 void ScDPSource::FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList )
@@ -1180,7 +1184,7 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const OUString& aPropertyName )
     return aRet;
 }
 
-#if DEBUG_PIVOT_TABLE
+#if DUMP_PIVOT_TABLE
 void ScDPSource::DumpResults() const
 {
     std::cout << "+++++ column root" << std::endl;
commit e8ccf9a2e37ea69fd92974125f824c70af4ef304
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Nov 12 18:58:17 2016 -0500

    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

diff --git a/sc/inc/calcmacros.hxx b/sc/inc/calcmacros.hxx
index d2fc1da..d5cffd5 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 304f1b5..bee579f 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 427144c..7496794 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 703dc5d..e45f3f4 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 fab299e..48906f1 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 c2305c7..753df75 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 a01053f..2b6e6c3 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 b197250..c69cd47 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 fe9a52c..0f8a0f0 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 03ba6588..477112d 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 805c301..59c9316 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 b2b162e..50aeeb6 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 be496da..37aa36d 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 6397c6d..3b78fe8 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 474ab27..079fb9b 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 cd96b08..3fc321a 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 d25a08f..634e7eb 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 904c850..517bbe0 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());
 }
 


More information about the Libreoffice-commits mailing list