Kaydet (Commit) 2bc52ff7 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Remove debug statements..

Change-Id: I10e0ef90ea7bfd92b46a54dc3d3feff90e50f724
üst a012bc60
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef __SC_DPMACROS_HXX__ #ifndef __SC_DPMACROS_HXX__
#define __SC_DPMACROS_HXX__ #define __SC_DPMACROS_HXX__
#define DEBUG_PIVOT_TABLE 1 #define DEBUG_PIVOT_TABLE 0
#if DEBUG_PIVOT_TABLE #if DEBUG_PIVOT_TABLE
#include <iostream> #include <iostream>
......
...@@ -12,14 +12,10 @@ ...@@ -12,14 +12,10 @@
#include "dpitemdata.hxx" #include "dpitemdata.hxx"
#include <map>
#include <vector> #include <vector>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#if DEBUG_PIVOT_TABLE
#include <map>
#endif
#include <boost/unordered_map.hpp>
namespace com { namespace sun { namespace star { namespace sheet { namespace com { namespace sun { namespace star { namespace sheet {
struct DataPilotFieldFilter; struct DataPilotFieldFilter;
...@@ -59,14 +55,8 @@ private: ...@@ -59,14 +55,8 @@ private:
struct MemberNode; struct MemberNode;
struct DimensionNode; struct DimensionNode;
#if DEBUG_PIVOT_TABLE
// To keep the entries sorted in the tree dump.
typedef std::map<ScDPItemData, MemberNode*> MembersType; typedef std::map<ScDPItemData, MemberNode*> MembersType;
typedef std::map<OUString, DimensionNode*> DimensionsType; 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 struct DimensionNode : boost::noncopyable
{ {
......
...@@ -85,13 +85,12 @@ ScDPResultFilterSet::~ScDPResultFilterSet() ...@@ -85,13 +85,12 @@ ScDPResultFilterSet::~ScDPResultFilterSet()
} }
void ScDPResultFilterSet::add( 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. // TODO: I'll work on the col / row to value node mapping later.
MemberNode* pMemNode = mpRoot; 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(); std::vector<ScDPResultFilter>::const_iterator itFilter = rFilters.begin(), itFilterEnd = rFilters.end();
for (; itFilter != itFilterEnd; ++itFilter) for (; itFilter != itFilterEnd; ++itFilter)
{ {
...@@ -102,12 +101,6 @@ void ScDPResultFilterSet::add( ...@@ -102,12 +101,6 @@ void ScDPResultFilterSet::add(
if (maPrimaryDimName.isEmpty()) if (maPrimaryDimName.isEmpty())
maPrimaryDimName = filter.maDimName; 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. // See if this dimension exists.
DimensionsType& rDims = pMemNode->maChildDimensions; DimensionsType& rDims = pMemNode->maChildDimensions;
DimensionsType::iterator itDim = rDims.find(filter.maDimName); DimensionsType::iterator itDim = rDims.find(filter.maDimName);
...@@ -146,7 +139,6 @@ void ScDPResultFilterSet::add( ...@@ -146,7 +139,6 @@ void ScDPResultFilterSet::add(
} }
pMemNode->maValues.push_back(fVal); pMemNode->maValues.push_back(fVal);
printf("\n");
} }
void ScDPResultFilterSet::swap(ScDPResultFilterSet& rOther) void ScDPResultFilterSet::swap(ScDPResultFilterSet& rOther)
......
...@@ -55,48 +55,6 @@ using ::std::vector; ...@@ -55,48 +55,6 @@ using ::std::vector;
using ::std::pair; using ::std::pair;
using ::com::sun::star::uno::Sequence; 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 { namespace {
sal_uInt16 nFuncStrIds[12] = // passend zum enum ScSubTotalFunc sal_uInt16 nFuncStrIds[12] = // passend zum enum ScSubTotalFunc
......
...@@ -69,48 +69,6 @@ using ::com::sun::star::uno::Sequence; ...@@ -69,48 +69,6 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Any;
using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; 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 #define SC_MINCOUNT_LIMIT 1000000
...@@ -424,7 +382,6 @@ long ScDPSource::GetSourceDim(long nDim) ...@@ -424,7 +382,6 @@ long ScDPSource::GetSourceDim(long nDim)
uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResults() uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResults()
throw(uno::RuntimeException) throw(uno::RuntimeException)
{ {
stack_printer __stack_printer__("ScDPSource::getResults");
CreateRes_Impl(); // create pColResRoot and pRowResRoot CreateRes_Impl(); // create pColResRoot and pRowResRoot
if ( bResultOverflow ) // set in CreateRes_Impl if ( bResultOverflow ) // set in CreateRes_Impl
...@@ -453,7 +410,6 @@ uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResult ...@@ -453,7 +410,6 @@ uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResult
pColResRoot, aFilterCxt, aSeq, pResData->GetRowStartMeasure()); pColResRoot, aFilterCxt, aSeq, pResData->GetRowStartMeasure());
maResFilterSet.swap(aFilterCxt.maFilterSet); // Keep this data for GETPIVOTDATA. maResFilterSet.swap(aFilterCxt.maFilterSet); // Keep this data for GETPIVOTDATA.
maResFilterSet.dump();
return aSeq; return aSeq;
} }
......
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