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

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Mar 23 01:42:58 PDT 2013


 sc/inc/colorscale.hxx                          |   17 ----
 sc/inc/conditio.hxx                            |   24 +-----
 sc/inc/globstr.hrc                             |    5 +
 sc/qa/unit/data/ods/new_cond_format_test.ods   |binary
 sc/qa/unit/helper/shared_test_impl.hxx         |    2 
 sc/qa/unit/subsequent_export-test.cxx          |   16 ++++
 sc/qa/unit/subsequent_filters-test.cxx         |   18 ++++
 sc/source/core/data/colorscale.cxx             |  100 -------------------------
 sc/source/core/data/conditio.cxx               |   30 ++-----
 sc/source/filter/excel/xecontent.cxx           |    8 +-
 sc/source/filter/excel/xeextlst.cxx            |    2 
 sc/source/filter/inc/xeextlst.hxx              |    2 
 sc/source/filter/oox/condformatbuffer.cxx      |   22 ++++-
 sc/source/filter/xml/xmlcondformat.cxx         |   18 ++++
 sc/source/filter/xml/xmlexprt.cxx              |   12 +++
 sc/source/ui/condformat/condformatdlgentry.cxx |   36 ++++++---
 sc/source/ui/condformat/condformathelper.cxx   |   14 ++-
 sc/source/ui/src/condformatdlg.src             |    2 
 sc/source/ui/src/globstr.src                   |    8 ++
 19 files changed, 151 insertions(+), 185 deletions(-)

New commits:
commit 73e74680d8c0cbf8baf869cc8bbc58dae432a0ef
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 23 08:33:22 2013 +0100

    add ODS test for above/below cond format rules
    
    Change-Id: I6ce6292a490ef39c111aa7f4c0a5ada0d45c16bc

diff --git a/sc/qa/unit/data/ods/new_cond_format_test.ods b/sc/qa/unit/data/ods/new_cond_format_test.ods
new file mode 100644
index 0000000..9418c43
Binary files /dev/null and b/sc/qa/unit/data/ods/new_cond_format_test.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index c73ba31..bf0ab4a 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -45,6 +45,7 @@ public:
 
     void test();
     void testPasswordExport();
+    void testConditionalFormatExportODS();
     void testConditionalFormatExportXLSX();
     void testColorScaleExportODS();
     void testColorScaleExportXLSX();
@@ -57,6 +58,7 @@ public:
 #if !defined(MACOSX) && !defined(DRAGONFLY)
     CPPUNIT_TEST(testPasswordExport);
 #endif
+    CPPUNIT_TEST(testConditionalFormatExportODS);
     CPPUNIT_TEST(testConditionalFormatExportXLSX);
     CPPUNIT_TEST(testColorScaleExportODS);
     CPPUNIT_TEST(testColorScaleExportXLSX);
@@ -150,6 +152,20 @@ void ScExportTest::testPasswordExport()
     CPPUNIT_ASSERT_DOUBLES_EQUAL(aVal, 1.0, 1e-8);
 }
 
+void ScExportTest::testConditionalFormatExportODS()
+{
+    ScDocShellRef xShell = loadDoc("new_cond_format_test.", ODS);
+    CPPUNIT_ASSERT(xShell.Is());
+
+    ScDocShellRef xDocSh = saveAndReload(&(*xShell), ODS);
+    CPPUNIT_ASSERT(xDocSh.Is());
+    ScDocument* pDoc = xDocSh->GetDocument();
+    OUString aCSVFile("new_cond_format_test.");
+    OUString aCSVPath;
+    createCSVPath( aCSVFile, aCSVPath );
+    testCondFile(aCSVPath, pDoc, 0);
+}
+
 void ScExportTest::testConditionalFormatExportXLSX()
 {
     ScDocShellRef xShell = loadDoc("new_cond_format_test.", XLSX);
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index bdb09fd..187a81a 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -127,6 +127,7 @@ public:
     void testDataBarXLSX();
     void testColorScaleODS();
     void testColorScaleXLSX();
+    void testNewCondFormatODS();
     void testNewCondFormatXLSX();
 
     //change this test file only in excel and not in calc
@@ -189,6 +190,7 @@ public:
     CPPUNIT_TEST(testDataBarXLSX);
     CPPUNIT_TEST(testColorScaleODS);
     CPPUNIT_TEST(testColorScaleXLSX);
+    CPPUNIT_TEST(testNewCondFormatODS);
     CPPUNIT_TEST(testNewCondFormatXLSX);
 
     CPPUNIT_TEST(testNumberFormatHTML);
@@ -1774,6 +1776,22 @@ void ScFiltersTest::testColorScaleXLSX()
     testColorScale3Entry_Impl(pDoc);
 }
 
+void ScFiltersTest::testNewCondFormatODS()
+{
+    ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc( "new_cond_format_test.", ODS );
+
+    CPPUNIT_ASSERT_MESSAGE("Failed to load new_cond_format_test.xlsx", xDocSh.Is());
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    OUString aCSVFile("new_cond_format_test.");
+    OUString aCSVPath;
+    createCSVPath( aCSVFile, aCSVPath );
+    testCondFile(aCSVPath, pDoc, 0);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testNewCondFormatXLSX()
 {
     ScDocShellRef xDocSh = ScBootstrapFixture::loadDoc( "new_cond_format_test.", XLSX );
commit 9513e13686f011b008764b3c5f184be47b9f4f5f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 23 08:34:13 2013 +0100

    fix above/below equal average ods import/export
    
    Change-Id: I1c305c67772b46cede6b4da3e79578f2f1a8ee89

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index dba9673..d5a55e3 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -62,6 +62,8 @@ enum ScConditionMode
     SC_COND_BOTTOM_PERCENT,
     SC_COND_ABOVE_AVERAGE,
     SC_COND_BELOW_AVERAGE,
+    SC_COND_ABOVE_EQUAL_AVERAGE,
+    SC_COND_BELOW_EQUAL_AVERAGE,
     SC_COND_ERROR,
     SC_COND_NOERROR,
     SC_COND_BEGINS_WITH,
@@ -244,8 +246,8 @@ private:
     bool IsTopNPercent( double nArg ) const;
     bool IsBottomNElement( double nArg ) const;
     bool IsBottomNPercent( double nArg ) const;
-    bool IsAboveAverage( double nArg ) const;
-    bool IsBelowAverage( double nArg ) const;
+    bool IsAboveAverage( double nArg, bool bEqual ) const;
+    bool IsBelowAverage( double nArg, bool bEqual ) const;
 
     bool IsError( const ScAddress& rPos ) const;
 
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index d49b1da..9eec9ce 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -665,7 +665,10 @@
 #define STR_DPFIELD_GROUP_BY_QUARTERS    533
 #define STR_DPFIELD_GROUP_BY_YEARS       534
 
-#define STR_COUNT                   535
+#define STR_COND_ABOVE_EQUAL_AVERAGE 535
+#define STR_COND_BELOW_EQUAL_AVERAGE 536
+
+#define STR_COUNT                   537
 
 #endif
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index cecb844..772a190 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -933,7 +933,7 @@ bool ScConditionEntry::IsBottomNPercent( double nArg ) const
     return true;
 }
 
-bool ScConditionEntry::IsBelowAverage( double nArg ) const
+bool ScConditionEntry::IsBelowAverage( double nArg, bool bEqual ) const
 {
     FillCache();
 
@@ -944,13 +944,13 @@ bool ScConditionEntry::IsBelowAverage( double nArg ) const
         nSum += itr->first * itr->second;
     }
 
-    if(nVal1)
+    if(bEqual)
         return (nArg <= nSum/mpCache->nValueItems);
     else
         return (nArg < nSum/mpCache->nValueItems);
 }
 
-bool ScConditionEntry::IsAboveAverage( double nArg ) const
+bool ScConditionEntry::IsAboveAverage( double nArg, bool bEqual ) const
 {
     FillCache();
 
@@ -961,7 +961,7 @@ bool ScConditionEntry::IsAboveAverage( double nArg ) const
         nSum += itr->first * itr->second;
     }
 
-    if(nVal1)
+    if(bEqual)
         return (nArg >= nSum/mpCache->nValueItems);
     else
         return (nArg > nSum/mpCache->nValueItems);
@@ -1084,10 +1084,12 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
             bValid = IsBottomNPercent( nArg );
             break;
         case SC_COND_ABOVE_AVERAGE:
-            bValid = IsAboveAverage( nArg );
+        case SC_COND_ABOVE_EQUAL_AVERAGE:
+            bValid = IsAboveAverage( nArg, eOp == SC_COND_ABOVE_EQUAL_AVERAGE );
             break;
         case SC_COND_BELOW_AVERAGE:
-            bValid = IsBelowAverage( nArg );
+        case SC_COND_BELOW_EQUAL_AVERAGE:
+            bValid = IsBelowAverage( nArg, eOp == SC_COND_BELOW_EQUAL_AVERAGE );
             break;
         case SC_COND_ERROR:
         case SC_COND_NOERROR:
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index e7069cd..7ad5874 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -833,6 +833,8 @@ const char* GetTypeString(ScConditionMode eMode)
             return "top10";
         case SC_COND_ABOVE_AVERAGE:
         case SC_COND_BELOW_AVERAGE:
+        case SC_COND_ABOVE_EQUAL_AVERAGE:
+        case SC_COND_BELOW_EQUAL_AVERAGE:
             return "aboveAverage";
         case SC_COND_NOTDUPLICATE:
             return "uniqueValues";
@@ -893,7 +895,10 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 {
     bool bFmla2 = false;
     ScConditionMode eOperation = mrFormatEntry.GetOperation();
-    sal_Int32 nAboveAverage = eOperation == SC_COND_ABOVE_AVERAGE;
+    sal_Int32 nAboveAverage = eOperation == SC_COND_ABOVE_AVERAGE ||
+                                eOperation == SC_COND_ABOVE_EQUAL_AVERAGE;
+    sal_Int32 nEqualAverage = eOperation == SC_COND_ABOVE_EQUAL_AVERAGE ||
+                                eOperation == SC_COND_BELOW_EQUAL_AVERAGE;
     sal_Int32 nBottom = eOperation == SC_COND_BOTTOM10
         || eOperation == SC_COND_BOTTOM_PERCENT;
     sal_Int32 nPercent = eOperation == SC_COND_TOP_PERCENT ||
@@ -922,6 +927,7 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
             XML_priority, OString::valueOf( mnPriority + 1 ).getStr(),
             XML_operator, GetOperatorString( mrFormatEntry.GetOperation(), bFmla2 ),
             XML_aboveAverage, OString::valueOf( nAboveAverage ).getStr(),
+            XML_equalAverage, OString::valueOf( nEqualAverage ).getStr(),
             XML_bottom, OString::valueOf( nBottom ).getStr(),
             XML_percent, OString::valueOf( nPercent ).getStr(),
             XML_rank, aRank.getStr(),
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index aec2f5d..15d1930 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -716,9 +716,19 @@ void CondFormatRule::finalizeImport()
         break;
         case XML_aboveAverage:
             if(maModel.mbAboveAverage)
-                eOperator = SC_COND_ABOVE_AVERAGE;
+            {
+                if(maModel.mbEqualAverage)
+                    eOperator = SC_COND_ABOVE_EQUAL_AVERAGE;
+                else
+                    eOperator = SC_COND_ABOVE_AVERAGE;
+            }
             else
-                eOperator = SC_COND_BELOW_AVERAGE;
+            {
+                if(maModel.mbEqualAverage)
+                    eOperator = SC_COND_BELOW_EQUAL_AVERAGE;
+                else
+                    eOperator = SC_COND_BELOW_AVERAGE;
+            }
         break;
         case XML_colorScale:
         break;
@@ -796,15 +806,15 @@ void CondFormatRule::finalizeImport()
         ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
         mpFormat->AddEntry(pNewEntry);
     }
-    else if( eOperator == SC_COND_ABOVE_AVERAGE || eOperator == SC_COND_BELOW_AVERAGE )
+    else if( eOperator == SC_COND_ABOVE_AVERAGE || eOperator == SC_COND_BELOW_AVERAGE ||
+            eOperator == SC_COND_ABOVE_EQUAL_AVERAGE || eOperator == SC_COND_BELOW_EQUAL_AVERAGE )
     {
         ScDocument& rDoc = getScDocument();
-        ScTokenArray aTokenArrayEqual;
-        aTokenArrayEqual.AddDouble( maModel.mbEqualAverage );
+        // actually that is still unsupported
         ScTokenArray aTokenArrayDev;
         aTokenArrayDev.AddDouble( maModel.mnStdDev );
         OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
-        ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArrayEqual, &aTokenArrayDev, &rDoc, aPos, aStyleName );
+        ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArrayDev, NULL, &rDoc, aPos, aStyleName );
         mpFormat->AddEntry(pNewEntry);
     }
     else if( eOperator == SC_COND_DUPLICATE || eOperator == SC_COND_NOTDUPLICATE )
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 5ca2cb7..ef0468a 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -485,7 +485,7 @@ void GetConditionData(const rtl::OUString& rValue, ScConditionMode& eMode, rtl::
     else if(rValue.indexOf("top-percent") == 0)
     {
         const sal_Unicode* pStr = rValue.getStr();
-        const sal_Unicode* pStart = pStr + 11;
+        const sal_Unicode* pStart = pStr + 12;
         const sal_Unicode* pEnd = pStr + rValue.getLength();
         rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')');
         eMode = SC_COND_TOP_PERCENT;
@@ -498,6 +498,22 @@ void GetConditionData(const rtl::OUString& rValue, ScConditionMode& eMode, rtl::
         rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')');
         eMode = SC_COND_BOTTOM_PERCENT;
     }
+    else if(rValue.indexOf("above-average") == 0)
+    {
+        eMode = SC_COND_ABOVE_AVERAGE;
+    }
+    else if(rValue.indexOf("below-average") == 0)
+    {
+        eMode = SC_COND_BELOW_AVERAGE;
+    }
+    else if(rValue.indexOf("above-equal-average") == 0)
+    {
+        eMode = SC_COND_ABOVE_EQUAL_AVERAGE;
+    }
+    else if(rValue.indexOf("below-equal-average") == 0)
+    {
+        eMode = SC_COND_BELOW_EQUAL_AVERAGE;
+    }
     else if(rValue.indexOf("is-error") == 0)
     {
         eMode = SC_COND_ERROR;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 11ba412..584219c 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3969,6 +3969,18 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
                                 aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
                                 aCond.append(")");
                                 break;
+                            case SC_COND_ABOVE_AVERAGE:
+                                aCond.append("above-average");
+                                break;
+                            case SC_COND_BELOW_AVERAGE:
+                                aCond.append("below-average");
+                                break;
+                            case SC_COND_ABOVE_EQUAL_AVERAGE:
+                                aCond.append("above-equal-average");
+                                break;
+                            case SC_COND_BELOW_EQUAL_AVERAGE:
+                                aCond.append("below-equal-average");
+                                break;
                             case SC_COND_ERROR:
                                 aCond.append("is-error");
                                 break;
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index b6338de..0d17859 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -243,26 +243,34 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, c
                 maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(15);
                 break;
-            case SC_COND_ERROR:
+            case SC_COND_ABOVE_EQUAL_AVERAGE:
                 maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(16);
                 break;
-            case SC_COND_NOERROR:
+            case SC_COND_BELOW_EQUAL_AVERAGE:
                 maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(17);
                 break;
-            case SC_COND_BEGINS_WITH:
+            case SC_COND_ERROR:
+                maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(18);
                 break;
-            case SC_COND_ENDS_WITH:
+            case SC_COND_NOERROR:
+                maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(19);
                 break;
-            case SC_COND_CONTAINS_TEXT:
+            case SC_COND_BEGINS_WITH:
                 maLbCondType.SelectEntryPos(20);
                 break;
-            case SC_COND_NOT_CONTAINS_TEXT:
+            case SC_COND_ENDS_WITH:
                 maLbCondType.SelectEntryPos(21);
                 break;
+            case SC_COND_CONTAINS_TEXT:
+                maLbCondType.SelectEntryPos(22);
+                break;
+            case SC_COND_NOT_CONTAINS_TEXT:
+                maLbCondType.SelectEntryPos(23);
+                break;
             case SC_COND_NONE:
                 break;
         }
@@ -356,21 +364,27 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const
             eMode = SC_COND_BELOW_AVERAGE;
             break;
         case 16:
-            eMode = SC_COND_ERROR;
+            eMode = SC_COND_ABOVE_EQUAL_AVERAGE;
             break;
         case 17:
-            eMode = SC_COND_NOERROR;
+            eMode = SC_COND_BELOW_EQUAL_AVERAGE;
             break;
         case 18:
-            eMode = SC_COND_BEGINS_WITH;
+            eMode = SC_COND_ERROR;
             break;
         case 19:
-            eMode = SC_COND_ENDS_WITH;
+            eMode = SC_COND_NOERROR;
             break;
         case 20:
-            eMode = SC_COND_CONTAINS_TEXT;
+            eMode = SC_COND_BEGINS_WITH;
             break;
         case 21:
+            eMode = SC_COND_ENDS_WITH;
+            break;
+        case 22:
+            eMode = SC_COND_CONTAINS_TEXT;
+            break;
+        case 23:
             eMode = SC_COND_NOT_CONTAINS_TEXT;
             break;
         default:
diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index 0c6b77e..6cbc8a2 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -75,16 +75,20 @@ rtl::OUString getExpression(sal_Int32 nIndex)
         case 16:
             return ScGlobal::GetRscString(STR_COND_BELOW_AVERAGE);
         case 17:
-            return ScGlobal::GetRscString(STR_COND_ERROR);
+            return ScGlobal::GetRscString(STR_COND_ABOVE_EQUAL_AVERAGE);
         case 18:
-            return ScGlobal::GetRscString(STR_COND_NOERROR);
+            return ScGlobal::GetRscString(STR_COND_BELOW_EQUAL_AVERAGE);
         case 19:
-            return ScGlobal::GetRscString(STR_COND_BEGINS_WITH);
+            return ScGlobal::GetRscString(STR_COND_ERROR);
         case 20:
-            return ScGlobal::GetRscString(STR_COND_ENDS_WITH);
+            return ScGlobal::GetRscString(STR_COND_NOERROR);
         case 21:
-            return ScGlobal::GetRscString(STR_COND_CONTAINS);
+            return ScGlobal::GetRscString(STR_COND_BEGINS_WITH);
         case 22:
+            return ScGlobal::GetRscString(STR_COND_ENDS_WITH);
+        case 23:
+            return ScGlobal::GetRscString(STR_COND_CONTAINS);
+        case 24:
             return ScGlobal::GetRscString(STR_COND_NOT_CONTAINS);
     }
     return rtl::OUString();
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index 53df59c..8e3132b 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -150,6 +150,8 @@ Control RID_COND_ENTRY
             "bottom 10 percent";
             "above average";
             "below average";
+            "above or equal average";
+            "below or equal average";
             "Error";
             "No Error";
             "Begins with";
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 1c5f224..06d1170 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1927,6 +1927,14 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "Below Average";
     };
+    String STR_COND_ABOVE_EQUAL_AVERAGE
+    {
+        Text [ en-US ] = "Above or equal Average";
+    };
+    String STR_COND_BELOW_EQUAL_AVERAGE
+    {
+        Text [ en-US ] = "Below or equal Average";
+    };
     String STR_COND_ERROR
     {
         Text [ en-US ] = "an Error code";
commit fb81adcda850b7456dbc274a37a2f12237c6ab82
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 22 09:45:26 2013 +0100

    fix spelling error
    
    Change-Id: I700f25f16ab77212c1f3fdc4be1eb24f4c614c30

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index d957ee1..be31eb7 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -95,7 +95,7 @@ public:
 namespace databar
 {
 
-enum ScAxisPostion
+enum ScAxisPosition
 {
     NONE,
     AUTOMATIC,
@@ -166,7 +166,7 @@ struct SC_DLLPUBLIC ScDataBarFormatData
      *
      * Default is false
      */
-    databar::ScAxisPostion meAxisPosition;
+    databar::ScAxisPosition meAxisPosition;
 
     /**
      * If TRUE we only show the bar and not the value
diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx
index 04f0547..1813cad 100644
--- a/sc/qa/unit/helper/shared_test_impl.hxx
+++ b/sc/qa/unit/helper/shared_test_impl.hxx
@@ -35,7 +35,7 @@ struct DataBarData
     ScRange aRange;
     ScColorScaleEntryType eLowerLimitType;
     ScColorScaleEntryType eUpperLimitType;
-    databar::ScAxisPostion eAxisPosition;
+    databar::ScAxisPosition eAxisPosition;
 };
 
 DataBarData aData[] = {
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index a02a101..c4ba7df 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -126,7 +126,7 @@ XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarForm
 
 namespace {
 
-const char* getAxisPosition(databar::ScAxisPostion eAxisPosition)
+const char* getAxisPosition(databar::ScAxisPosition eAxisPosition)
 {
     switch(eAxisPosition)
     {
diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx
index 4668111..fe0ccde 100644
--- a/sc/source/filter/inc/xeextlst.hxx
+++ b/sc/source/filter/inc/xeextlst.hxx
@@ -76,7 +76,7 @@ public:
     virtual void SaveXml( XclExpXmlStream& rStrm );
 
 private:
-    databar::ScAxisPostion meAxisPosition;
+    databar::ScAxisPosition meAxisPosition;
 
     boost::scoped_ptr<XclExpExtCfvo> mpLowerLimit;
     boost::scoped_ptr<XclExpExtCfvo> mpUpperLimit;
commit 07ae89ed8d49a81babbdc76604602da405012c74
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 22 09:34:55 2013 +0100

    remove the code for this old test concept
    
    Change-Id: I4c9c383cffa2cfadbee32ec1e19af4b569b13f0c

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index b63c721..d957ee1 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -90,9 +90,6 @@ public:
     ScColorScaleEntryType GetType() const;
     void SetType( ScColorScaleEntryType eType );
 
-#if DUMP_FORMAT_INFO
-    void dumpInfo(rtl::OUStringBuffer& rBuf) const;
-#endif
 };
 
 namespace databar
@@ -274,10 +271,6 @@ public:
     const_iterator end() const;
 
     size_t size() const;
-
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
-#endif
 };
 
 class SC_DLLPUBLIC ScDataBarFormat : public ScColorFormat
@@ -299,9 +292,6 @@ public:
 
     virtual condformat::ScFormatEntryType GetType() const;
 
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
-#endif
 private:
     double getMin(double nMin, double nMax) const;
     double getMax(double nMin, double nMax) const;
@@ -355,9 +345,6 @@ public:
     iterator end();
     const_iterator end() const;
 
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
-#endif
 private:
 
     double GetMinValue() const;
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index cb43313..dba9673 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -43,8 +43,6 @@ class ScTokenArray;
 //  nOptions Flags
 #define SC_COND_NOBLANKS    1
 
-#define DUMP_FORMAT_INFO 1
-
 enum ScConditionMode
 {
     SC_COND_EQUAL,
@@ -121,10 +119,6 @@ public:
 
     bool operator==( const ScFormatEntry& ) const;
 
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const = 0;
-#endif
-
     virtual void startRendering();
     virtual void endRendering();
 protected:
@@ -235,10 +229,6 @@ public:
 
     static ScConditionMode GetModeFromApi(sal_Int32 nOperator);
 
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& ) const {}
-#endif
-
     virtual void endRendering();
     virtual void startRendering();
 
@@ -361,10 +351,6 @@ public:
 
     bool operator==( const ScFormatEntry& ) const;
 
-#if DUMP_FORMAT_INFO
-    virtual void dumpInfo(rtl::OUStringBuffer& rBuf) const;
-#endif
-
     virtual void startRendering();
     virtual void endRendering();
 
@@ -431,10 +417,6 @@ public:
 
     bool            MarkUsedExternalReferences() const;
 
-#if DUMP_FORMAT_INFO
-    void dumpInfo(rtl::OUStringBuffer& rBuf) 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/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 16a8575..b4f58bc 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -32,9 +32,6 @@
 #include "fillinfo.hxx"
 #include "iconsets.hrc"
 #include "scresid.hxx"
-#if DUMP_FORMAT_INFO
-#include <iostream>
-#endif
 
 #include <algorithm>
 
@@ -158,44 +155,6 @@ 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( (sal_Int32)maColor.GetRed() ).append( "," ).append( (sal_Int32)maColor.GetGreen() ).append( "," ).append( (sal_Int32)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)
 {
@@ -487,34 +446,6 @@ Color* ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const
     return new Color(aColor);
 }
 
-#if DUMP_FORMAT_INFO
-void ScColorScaleFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const
-{
-    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)
-    {
-        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)) );
-                rBuf.append((sal_Int32)nCol).append(",").append(nRow).append(",").append((sal_Int32)nTab).append(",");
-                rBuf.append(((sal_Int32)pColor->GetRed())).append(",").append(((sal_Int32)pColor->GetGreen())).append(",").append(((sal_Int32)pColor->GetBlue())).append("\n");
-            }
-        }
-    }
-}
-#endif
-
 void ScColorScaleFormat::UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab)
 {
     SCTAB nThisTab = GetRange().front()->aStart.Tab();
@@ -835,28 +766,6 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
     return pInfo;
 }
 
-#if DUMP_FORMAT_INFO
-void ScDataBarFormat::dumpInfo(rtl::OUStringBuffer& rBuf) 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)) );
-                rBuf.append((sal_Int32) nCol).append(",").append(nRow).append(",").append((sal_Int32) nTab).append(",").append(pInfo->mnZero).append(",");
-                rBuf.append(pInfo->mnLength).append(",").append((sal_Bool)pInfo->mbGradient).append(",").append((sal_Bool)pInfo->mbShowValue).append("\n");
-            }
-        }
-    }
-}
-#endif
-
 ScIconSetFormat::ScIconSetFormat(ScDocument* pDoc):
     ScColorFormat(pDoc),
     mpFormatData(new ScIconSetFormatData)
@@ -964,15 +873,6 @@ void ScIconSetFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
     }
 }
 
-void ScIconSetFormat::dumpInfo( rtl::OUStringBuffer& rBuffer ) const
-{
-    rBuffer.append("IconSet: \n");
-    for(const_iterator itr = begin(); itr != end(); ++itr)
-    {
-        itr->dumpInfo(rBuffer);
-    }
-}
-
 ScIconSetFormat::iterator ScIconSetFormat::begin()
 {
     return mpFormatData->maEntries.begin();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index fbda302..cecb844 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1801,11 +1801,6 @@ bool ScCondDateFormatEntry::operator==( const ScFormatEntry& r ) const
     return rEntry.maStyleName == maStyleName;
 }
 
-void ScCondDateFormatEntry::dumpInfo( rtl::OUStringBuffer& rBuffer ) const
-{
-    rBuffer.append("Date Format");
-}
-
 void ScCondDateFormatEntry::startRendering()
 {
     mpCache.reset();
@@ -1954,17 +1949,6 @@ ScCondFormatData ScConditionalFormat::GetData( ScBaseCell* pCell, const ScAddres
     return aData;
 }
 
-
-#if DUMP_FORMAT_INFO
-void ScConditionalFormat::dumpInfo(rtl::OUStringBuffer& rBuf) const
-{
-    for(CondFormatContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
-    {
-        itr->dumpInfo(rBuf);
-    }
-}
-#endif
-
 void ScConditionalFormat::DoRepaint( const ScRange* pModified )
 {
     if(pModified)


More information about the Libreoffice-commits mailing list