diff options
-rw-r--r-- | sc/inc/colorscale.hxx | 8 | ||||
-rw-r--r-- | sc/inc/conditio.hxx | 14 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 50 | ||||
-rw-r--r-- | sc/source/core/data/conditio.cxx | 11 |
5 files changed, 84 insertions, 0 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 8e7938547d68..942f60455303 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -223,6 +223,10 @@ public: const_iterator end() const; size_t size() const; + +#if DUMP_FORMAT_INFO + virtual void dumpInfo() const; +#endif }; class SC_DLLPUBLIC ScDataBarFormat : public ScColorFormat @@ -243,6 +247,10 @@ public: const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); virtual condformat::ScFormatEntryType GetType() const; + +#if DUMP_FORMAT_INFO + virtual void dumpInfo() const; +#endif private: double getMin(double nMin, double nMax) const; double getMax(double nMin, double nMax) const; diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index d25a39ff7a7b..4967e826242b 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -48,6 +48,8 @@ class ScTokenArray; // nOptions Flags #define SC_COND_NOBLANKS 1 +#define DUMP_FORMAT_INFO 1 + // ordering of ScConditionMode and ScQueryOp is equal, // to facilitate the merging of both in the future @@ -108,6 +110,10 @@ public: virtual ScFormatEntry* Clone( ScDocument* pDoc = NULL ) const = 0; virtual void SetParent( ScConditionalFormat* pNew ) = 0; + +#if DUMP_FORMAT_INFO + virtual void dumpInfo() const = 0; +#endif protected: ScDocument* mpDoc; @@ -204,6 +210,10 @@ public: static ScConditionMode GetModeFromApi(sal_Int32 nOperator); +#if DUMP_FORMAT_INFO + virtual void dumpInfo() const {} +#endif + protected: virtual void DataChanged( const ScRange* pModified ) const; ScDocument* GetDocument() const { return mpDoc; } @@ -303,6 +313,10 @@ public: bool MarkUsedExternalReferences() const; +#if DUMP_FORMAT_INFO + void dumpInfo() const; +#endif + // sorted (via PTRARR) by Index // operator== only for sorting bool operator ==( const ScConditionalFormat& r ) const { return nKey == r.nKey; } diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 32cfb76406c1..8d6a8043de3d 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1264,6 +1264,7 @@ void ScFiltersTest::testColorScale() ScConditionalFormatList* pCondFormatList = pDoc->GetCondFormList(0); const ScConditionalFormat* pFormat = pCondFormatList->GetFormat(nIndex); CPPUNIT_ASSERT(pFormat); + pFormat->dumpInfo(); pPattern = pDoc->GetPattern(1,5,0); nIndex = static_cast<const SfxUInt32Item&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetValue(); diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index dda1b63d1ac8..ae592f41e896 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -30,6 +30,9 @@ #include "document.hxx" #include "cell.hxx" #include "fillinfo.hxx" +#if DUMP_FORMAT_INFO +#include <iostream> +#endif ScColorScaleEntry::ScColorScaleEntry(): mnVal(0), @@ -487,6 +490,30 @@ Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const return new Color(aColor); } +#if DUMP_FORMAT_INFO +void ScColorScaleFormat::dumpInfo() const +{ + std::cout << "Color Scale" << std::endl; + const ScRangeList& rRange = GetRange(); + size_t n = rRange.size(); + for(size_t i = 0; i < n; ++i) + { + const ScRange* pRange = rRange[i]; + SCTAB nTab = pRange->aStart.Tab(); + for( SCCOL nCol = pRange->aStart.Col(), nEndCol = pRange->aEnd.Col(); nCol <= nEndCol; ++nCol) + { + for( SCROW nRow = pRange->aStart.Row(), nEndRow = pRange->aEnd.Row(); nRow <= nEndRow; ++nRow) + { + boost::scoped_ptr<Color> pColor( GetColor(ScAddress(nCol, nRow, nTab)) ); + std::cout << nCol << "," << nRow << "," << nTab << ","; + std::cout << ((int)pColor->GetRed()) << "," << ((int)pColor->GetGreen()) << "," << ((int)pColor->GetBlue()); + std::cout << std::endl; + } + } + } +} +#endif + void ScColorScaleFormat::UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab) { SCTAB nThisTab = GetRange().front()->aStart.Tab(); @@ -826,4 +853,27 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const return pInfo; } +#if DUMP_FORMAT_INFO +void ScDataBarFormat::dumpInfo() const +{ + const ScRangeList& rRange = GetRange(); + size_t n = rRange.size(); + for(size_t i = 0; i < n; ++i) + { + const ScRange* pRange = rRange[i]; + SCTAB nTab = pRange->aStart.Tab(); + for( SCCOL nCol = pRange->aStart.Col(), nEndCol = pRange->aEnd.Col(); nCol <= nEndCol; ++nCol) + { + for( SCROW nRow = pRange->aStart.Row(), nEndRow = pRange->aEnd.Row(); nRow <= nEndRow; ++nRow) + { + boost::scoped_ptr<ScDataBarInfo> pInfo( GetDataBarInfo(ScAddress(nCol, nRow, nTab)) ); + std::cout << nCol << "," << nRow << "," << nTab << "," << pInfo->mnZero << ","; + std::cout << pInfo->mnLength << "," << pInfo->mbGradient << "," << pInfo->mbShowValue << std::endl; + std::cout << std::endl; + } + } + } +} +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 3d3611b0badd..1438a788c620 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1425,6 +1425,17 @@ ScCondFormatData ScConditionalFormat::GetData( ScBaseCell* pCell, const ScAddres return aData; } + +#if DUMP_FORMAT_INFO +void ScConditionalFormat::dumpInfo() const +{ + for(CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + { + itr->dumpInfo(); + } +} +#endif + void ScConditionalFormat::DoRepaint( const ScRange* pModified ) { if(pModified) |