[Libreoffice-commits] core.git: Branch 'feature/pivot-table-result-tree' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Thu Apr 18 19:55:51 PDT 2013


 sc/inc/dpmacros.hxx                 |    2 -
 sc/inc/dpresfilter.hxx              |   12 ---------
 sc/source/core/data/dpresfilter.cxx |   10 --------
 sc/source/core/data/dptabres.cxx    |   42 ----------------------------------
 sc/source/core/data/dptabsrc.cxx    |   44 ------------------------------------
 5 files changed, 3 insertions(+), 107 deletions(-)

New commits:
commit c8407c7e05b91d03827eeb148d55ae904d5d09ea
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Apr 18 22:56:17 2013 -0400

    Remove debug statements..
    
    Change-Id: I10e0ef90ea7bfd92b46a54dc3d3feff90e50f724

diff --git a/sc/inc/dpmacros.hxx b/sc/inc/dpmacros.hxx
index ce91b06..79aafaf 100644
--- a/sc/inc/dpmacros.hxx
+++ b/sc/inc/dpmacros.hxx
@@ -29,7 +29,7 @@
 #ifndef __SC_DPMACROS_HXX__
 #define __SC_DPMACROS_HXX__
 
-#define DEBUG_PIVOT_TABLE 1
+#define DEBUG_PIVOT_TABLE 0
 
 #if DEBUG_PIVOT_TABLE
 #include <iostream>
diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx
index 9d4617d..a151bd3 100644
--- a/sc/inc/dpresfilter.hxx
+++ b/sc/inc/dpresfilter.hxx
@@ -12,14 +12,10 @@
 
 #include "dpitemdata.hxx"
 
+#include <map>
 #include <vector>
 #include <boost/noncopyable.hpp>
 
-#if DEBUG_PIVOT_TABLE
-#include <map>
-#endif
-
-#include <boost/unordered_map.hpp>
 
 namespace com { namespace sun { namespace star { namespace sheet {
     struct DataPilotFieldFilter;
@@ -59,14 +55,8 @@ private:
 
     struct MemberNode;
     struct DimensionNode;
-#if DEBUG_PIVOT_TABLE
-    // To keep the entries sorted in the tree dump.
     typedef std::map<ScDPItemData, MemberNode*> MembersType;
     typedef std::map<OUString, DimensionNode*> DimensionsType;
-#else
-    typedef boost::unordered_map<ScDPItemData, MemberNode*, ScDPItemData::Hash> MembersType;
-    typedef boost::unordered_map<OUString, DimensionNode*, OUStringHash> DimensionsType;
-#endif
 
     struct DimensionNode : boost::noncopyable
     {
diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx
index fbb74c1..9a23233 100644
--- a/sc/source/core/data/dpresfilter.cxx
+++ b/sc/source/core/data/dpresfilter.cxx
@@ -85,13 +85,12 @@ ScDPResultFilterSet::~ScDPResultFilterSet()
 }
 
 void ScDPResultFilterSet::add(
-    const std::vector<ScDPResultFilter>& rFilters, long nCol, long nRow, double fVal)
+    const std::vector<ScDPResultFilter>& rFilters, long /*nCol*/, long /*nRow*/, double fVal)
 {
     // TODO: I'll work on the col / row to value node mapping later.
 
     MemberNode* pMemNode = mpRoot;
 
-    fprintf(stdout, "(row=%ld; col=%ld; value=%g) : ", nRow, nCol, fVal);
     std::vector<ScDPResultFilter>::const_iterator itFilter = rFilters.begin(), itFilterEnd = rFilters.end();
     for (; itFilter != itFilterEnd; ++itFilter)
     {
@@ -102,12 +101,6 @@ void ScDPResultFilterSet::add(
         if (maPrimaryDimName.isEmpty())
             maPrimaryDimName = filter.maDimName;
 
-        printf("%s: ", rtl::OUStringToOString(filter.maDimName, RTL_TEXTENCODING_UTF8).getStr());
-        if (filter.maValue.IsValue())
-            printf("%g ", filter.maValue.GetValue());
-        else
-            printf("'%s' ", rtl::OUStringToOString(filter.maValue.GetString(), RTL_TEXTENCODING_UTF8).getStr());
-
         // See if this dimension exists.
         DimensionsType& rDims = pMemNode->maChildDimensions;
         DimensionsType::iterator itDim = rDims.find(filter.maDimName);
@@ -146,7 +139,6 @@ void ScDPResultFilterSet::add(
     }
 
     pMemNode->maValues.push_back(fVal);
-    printf("\n");
 }
 
 void ScDPResultFilterSet::swap(ScDPResultFilterSet& rOther)
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 379f5c1..7cc25bc 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -55,48 +55,6 @@ using ::std::vector;
 using ::std::pair;
 using ::com::sun::star::uno::Sequence;
 
-#include <stdio.h>
-#include <string>
-#include <sys/time.h>
-
-namespace {
-
-class stack_printer
-{
-public:
-    explicit stack_printer(const char* msg) :
-        msMsg(msg)
-    {
-        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-        mfStartTime = getTime();
-    }
-
-    ~stack_printer()
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime));
-    }
-
-    void printTime(int line) const
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime));
-    }
-
-private:
-    double getTime() const
-    {
-        timeval tv;
-        gettimeofday(&tv, NULL);
-        return tv.tv_sec + tv.tv_usec / 1000000.0;
-    }
-
-    ::std::string msMsg;
-    double mfStartTime;
-};
-
-}
-
 namespace {
 
 sal_uInt16 nFuncStrIds[12] =     // passend zum enum ScSubTotalFunc
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 5c0d519..8efadd5 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -69,48 +69,6 @@ using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Any;
 using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo;
 
-#include <stdio.h>
-#include <string>
-#include <sys/time.h>
-
-namespace {
-
-class stack_printer
-{
-public:
-    explicit stack_printer(const char* msg) :
-        msMsg(msg)
-    {
-        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-        mfStartTime = getTime();
-    }
-
-    ~stack_printer()
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime));
-    }
-
-    void printTime(int line) const
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime));
-    }
-
-private:
-    double getTime() const
-    {
-        timeval tv;
-        gettimeofday(&tv, NULL);
-        return tv.tv_sec + tv.tv_usec / 1000000.0;
-    }
-
-    ::std::string msMsg;
-    double mfStartTime;
-};
-
-}
-
 // -----------------------------------------------------------------------
 
 #define SC_MINCOUNT_LIMIT   1000000
@@ -424,7 +382,6 @@ long ScDPSource::GetSourceDim(long nDim)
 uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResults()
                                                             throw(uno::RuntimeException)
 {
-    stack_printer __stack_printer__("ScDPSource::getResults");
     CreateRes_Impl();       // create pColResRoot and pRowResRoot
 
     if ( bResultOverflow )      // set in CreateRes_Impl
@@ -453,7 +410,6 @@ uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResult
         pColResRoot, aFilterCxt, aSeq, pResData->GetRowStartMeasure());
 
     maResFilterSet.swap(aFilterCxt.maFilterSet); // Keep this data for GETPIVOTDATA.
-    maResFilterSet.dump();
 
     return aSeq;
 }


More information about the Libreoffice-commits mailing list