summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-23 19:51:02 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-23 20:07:47 +0200
commitb3d5de767c6dbd30ded0881da9de8ae9638abb54 (patch)
tree12479acfe4c6f72481f71aa45977824dad9ad12e /sc/source
parent31018fa81f2fa51a3c7c2d6c992cef03b17c378d (diff)
improve the dump code for cond formats
Change-Id: Icefaa4777f64ca934928ae2ad95496000df364e9
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/colorscale.cxx54
-rw-r--r--sc/source/core/data/conditio.cxx4
2 files changed, 50 insertions, 8 deletions
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 1303e0165096..4ca1bc7c6baf 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -147,6 +147,44 @@ void ScColorScaleEntry::SetColor(const Color& rColor)
maColor = rColor;
}
+#if DUMP_FORMAT_INFO
+
+void ScColorScaleEntry::dumpInfo(rtl::OUStringBuffer& rBuf) const
+{
+ rBuf.append("Color Scale Entry\n");
+ rBuf.append("Type: ");
+ switch(meType)
+ {
+ case COLORSCALE_VALUE:
+ rBuf.append( "Value\n" );
+ break;
+ case COLORSCALE_MIN:
+ rBuf.append( "Min\n" );
+ break;
+ case COLORSCALE_MAX:
+ rBuf.append( "Max\n" );
+ break;
+ case COLORSCALE_PERCENT:
+ rBuf.append( "Percent\n" );
+ break;
+ case COLORSCALE_PERCENTILE:
+ rBuf.append( "Percentile\n" );
+ break;
+ case COLORSCALE_FORMULA:
+ rBuf.append( "Formual\n" );
+ break;
+ default:
+ rBuf.append( "Unsupported Type\n" );
+ }
+ rBuf.append( "Color: " ).append( (int)maColor.GetRed() ).append( "," ).append( (int)maColor.GetGreen() ).append( "," ).append( (int)maColor.GetBlue() ).append( "\n" );
+ if(meType == COLORSCALE_FORMULA)
+ rBuf.append( "Formula: " ).append( GetFormula( formula::FormulaGrammar::GRAM_DEFAULT ) ).append("\n");
+ else if( meType != COLORSCALE_MIN && meType != COLORSCALE_MAX )
+ rBuf.append( "Value: " ).append( mnVal ).append( "\n" );
+}
+
+#endif
+
ScColorFormat::ScColorFormat(ScDocument* pDoc):
ScFormatEntry(pDoc)
{
@@ -491,9 +529,14 @@ Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const
}
#if DUMP_FORMAT_INFO
-void ScColorScaleFormat::dumpInfo() const
+void ScColorScaleFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const
{
- std::cout << "Color Scale" << std::endl;
+ rBuf.append("Color Scale with ").append(static_cast<sal_Int32>(size())).append(" entries\n");
+ for(const_iterator itr = begin(); itr != end(); ++itr)
+ {
+ itr->dumpInfo(rBuf);
+ }
+
const ScRangeList& rRange = GetRange();
size_t n = rRange.size();
for(size_t i = 0; i < n; ++i)
@@ -505,9 +548,8 @@ void ScColorScaleFormat::dumpInfo() const
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;
+ rBuf.append(nCol).append(",").append(nRow).append(",").append(nTab).append(",");
+ rBuf.append(((int)pColor->GetRed())).append(",").append(((int)pColor->GetGreen())).append(",").append(((int)pColor->GetBlue())).append("\n");
}
}
}
@@ -852,7 +894,7 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
}
#if DUMP_FORMAT_INFO
-void ScDataBarFormat::dumpInfo() const
+void ScDataBarFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const
{
const ScRangeList& rRange = GetRange();
size_t n = rRange.size();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 7f0c2d97b004..c8e2dbc5409b 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1457,11 +1457,11 @@ ScCondFormatData ScConditionalFormat::GetData( ScBaseCell* pCell, const ScAddres
#if DUMP_FORMAT_INFO
-void ScConditionalFormat::dumpInfo() const
+void ScConditionalFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const
{
for(CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- itr->dumpInfo();
+ itr->dumpInfo(rBuf);
}
}
#endif