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

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Jun 28 17:58:52 PDT 2013


 sc/Library_sc.mk                       |    1 
 sc/inc/colorscale.hxx                  |   19 ---
 sc/inc/stylehelper.hxx                 |   29 ++++++
 sc/inc/styleuno.hxx                    |    9 -
 sc/source/core/data/colorscale.cxx     |   18 +++
 sc/source/core/data/table2.cxx         |    2 
 sc/source/core/tool/stylehelper.cxx    |  157 +++++++++++++++++++++++++++++++++
 sc/source/filter/xml/xmlcondformat.cxx |    5 -
 sc/source/filter/xml/xmlexprt.cxx      |    6 -
 sc/source/ui/unoobj/cellsuno.cxx       |    1 
 sc/source/ui/unoobj/fmtuno.cxx         |    1 
 sc/source/ui/unoobj/styleuno.cxx       |  143 ------------------------------
 12 files changed, 217 insertions(+), 174 deletions(-)

New commits:
commit 5b9bad7482a98f2d0d37c4b75a13292abe653ea3
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jun 29 02:50:48 2013 +0200

    handle localized default style names, fdo#61339
    
    We need to map localized style names during import and export from and
    to ODF. The default styles are the only localized style names and are
    not imported with the name written into the file.
    
    Change-Id: Ibdc2f750b7a4b7ce6994b22248e237fe95ac638d

diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 41f4f3d..afeec54 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -18,6 +18,7 @@
 #include "rangeutl.hxx"
 #include "docfunc.hxx"
 #include "XMLConverter.hxx"
+#include "stylehelper.hxx"
 
 
 ScXMLConditionalFormatsContext::ScXMLConditionalFormatsContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
@@ -566,7 +567,7 @@ ScXMLCondContext::ScXMLCondContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
                 sExpression = sValue;
                 break;
             case XML_TOK_CONDITION_APPLY_STYLE_NAME:
-                sStyle = sValue;
+                sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA );
                 break;
             case XML_TOK_CONDITION_BASE_CELL_ADDRESS:
                 sAddress = sValue;
@@ -764,7 +765,7 @@ ScXMLDateContext::ScXMLDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
                 sDateType = sValue;
                 break;
             case XML_TOK_COND_DATE_STYLE:
-                sStyle = sValue;
+                sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA );
                 break;
             default:
                 break;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 3c4a2b1..3dcb8ba 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -59,6 +59,7 @@
 #include "colorscale.hxx"
 #include "conditio.hxx"
 #include "cellvalue.hxx"
+#include "stylehelper.hxx"
 
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/xmlnmspe.hxx>
@@ -4000,7 +4001,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
                             default:
                                 SAL_WARN("sc", "unimplemented conditional format export");
                         }
-                        OUString sStyle = pEntry->GetStyle();
+                        OUString sStyle = ScStyleNameConversion::DisplayToProgrammaticName(pEntry->GetStyle(), SFX_STYLE_FAMILY_PARA);
                         AddAttribute(XML_NAMESPACE_CALC_EXT, XML_APPLY_STYLE_NAME, sStyle);
                         AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, aCond.makeStringAndClear());
 
@@ -4127,7 +4128,8 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
                     {
                         const ScCondDateFormatEntry& mrDateFormat = static_cast<const ScCondDateFormatEntry&>(*pFormatEntry);
                         OUString aDateType = getDateStringForType(mrDateFormat.GetDateType());
-                        AddAttribute( XML_NAMESPACE_CALC_EXT, XML_STYLE, mrDateFormat.GetStyleName());
+                        OUString aStyleName = ScStyleNameConversion::DisplayToProgrammaticName(mrDateFormat.GetStyleName(), SFX_STYLE_FAMILY_PARA );
+                        AddAttribute( XML_NAMESPACE_CALC_EXT, XML_STYLE, aStyleName);
                         AddAttribute( XML_NAMESPACE_CALC_EXT, XML_DATE, aDateType);
                         SvXMLElementExport aElementDateFormat(*this, XML_NAMESPACE_CALC_EXT, XML_DATE_IS, true, true);
                     }
commit b3aabf223ec7bc2678fd6dfbbbbb79ab7f079e5b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jun 29 02:06:25 2013 +0200

    extract this functionality from the uno code
    
    we need this code in our next step for some mappings in the filters code
    
    Change-Id: I059d9d05877846215e1a967123dc253de605417e

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 58a5406..c1d12a2 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -252,6 +252,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 	sc/source/core/tool/scopetools \
 	sc/source/core/tool/simplerangelist \
 	sc/source/core/tool/stringutil \
+	sc/source/core/tool/stylehelper \
 	sc/source/core/tool/subtotal \
 	sc/source/core/tool/token \
 	sc/source/core/tool/typedstrdata \
diff --git a/sc/inc/stylehelper.hxx b/sc/inc/stylehelper.hxx
new file mode 100644
index 0000000..31f79d1
--- /dev/null
+++ b/sc/inc/stylehelper.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <rtl/ustring.hxx>
+
+class ScStyleNameConversion
+{
+public:
+    static OUString DisplayToProgrammaticName( const OUString& rDispName, sal_uInt16 nType );
+    static OUString ProgrammaticToDisplayName( const OUString& rProgName, sal_uInt16 nType );
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx
index bd7d8a4..29ab960 100644
--- a/sc/inc/styleuno.hxx
+++ b/sc/inc/styleuno.hxx
@@ -43,15 +43,6 @@ class ScDocShell;
 class ScStyleFamilyObj;
 class ScStyleObj;
 
-
-class ScStyleNameConversion
-{
-public:
-    static String DisplayToProgrammaticName( const String& rDispName, sal_uInt16 nType );
-    static String ProgrammaticToDisplayName( const String& rProgName, sal_uInt16 nType );
-};
-
-
 class ScStyleFamiliesObj : public ::cppu::WeakImplHelper4<
                             ::com::sun::star::container::XIndexAccess,
                             ::com::sun::star::container::XNameAccess,
diff --git a/sc/source/core/tool/stylehelper.cxx b/sc/source/core/tool/stylehelper.cxx
new file mode 100644
index 0000000..a5e5b5b
--- /dev/null
+++ b/sc/source/core/tool/stylehelper.cxx
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <rsc/rscsfx.hxx>
+
+#include "stylehelper.hxx"
+#include "global.hxx"
+#include "globstr.hrc"
+
+//  conversion programmatic <-> display (visible) name
+//  currently, the core always has the visible names
+//  the api is required to use programmatic names for default styles
+//  these programmatic names must never change!
+
+#define SC_STYLE_PROG_STANDARD      "Default"
+#define SC_STYLE_PROG_RESULT        "Result"
+#define SC_STYLE_PROG_RESULT1       "Result2"
+#define SC_STYLE_PROG_HEADLINE      "Heading"
+#define SC_STYLE_PROG_HEADLINE1     "Heading1"
+#define SC_STYLE_PROG_REPORT        "Report"
+
+struct ScDisplayNameMap
+{
+    OUString  aDispName;
+    OUString  aProgName;
+};
+
+static const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType )
+{
+    if ( nType == SFX_STYLE_FAMILY_PARA )
+    {
+        static bool bCellMapFilled = false;
+        static ScDisplayNameMap aCellMap[6];
+        if ( !bCellMapFilled )
+        {
+            aCellMap[0].aDispName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD );
+            aCellMap[0].aProgName = OUString( SC_STYLE_PROG_STANDARD );
+
+            aCellMap[1].aDispName = ScGlobal::GetRscString( STR_STYLENAME_RESULT );
+            aCellMap[1].aProgName = OUString( SC_STYLE_PROG_RESULT );
+
+            aCellMap[2].aDispName = ScGlobal::GetRscString( STR_STYLENAME_RESULT1 );
+            aCellMap[2].aProgName = OUString( SC_STYLE_PROG_RESULT1 );
+
+            aCellMap[3].aDispName = ScGlobal::GetRscString( STR_STYLENAME_HEADLINE );
+            aCellMap[3].aProgName = OUString( SC_STYLE_PROG_HEADLINE );
+
+            aCellMap[4].aDispName = ScGlobal::GetRscString( STR_STYLENAME_HEADLINE1 );
+            aCellMap[4].aProgName = OUString( SC_STYLE_PROG_HEADLINE1 );
+
+            //  last entry remains empty
+
+            bCellMapFilled = true;
+        }
+        return aCellMap;
+    }
+    else if ( nType == SFX_STYLE_FAMILY_PAGE )
+    {
+        static bool bPageMapFilled = false;
+        static ScDisplayNameMap aPageMap[3];
+        if ( !bPageMapFilled )
+        {
+            aPageMap[0].aDispName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD );
+            aPageMap[0].aProgName = OUString( SC_STYLE_PROG_STANDARD );
+
+            aPageMap[1].aDispName = ScGlobal::GetRscString( STR_STYLENAME_REPORT );
+            aPageMap[1].aProgName = OUString( SC_STYLE_PROG_REPORT );
+
+            //  last entry remains empty
+
+            bPageMapFilled = true;
+        }
+        return aPageMap;
+    }
+    OSL_FAIL("invalid family");
+    return NULL;
+}
+
+//  programmatic name suffix for display names that match other programmatic names
+//  is " (user)" including a space
+
+#define SC_SUFFIX_USER      " (user)"
+#define SC_SUFFIX_USER_LEN  7
+
+static bool lcl_EndsWithUser( const OUString& rString )
+{
+    return rString.endsWith(SC_SUFFIX_USER);
+}
+
+OUString ScStyleNameConversion::DisplayToProgrammaticName( const OUString& rDispName, sal_uInt16 nType )
+{
+    bool bDisplayIsProgrammatic = false;
+
+    const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType );
+    if (pNames)
+    {
+        do
+        {
+            if (pNames->aDispName == rDispName)
+                return pNames->aProgName;
+            else if (pNames->aProgName == rDispName)
+                bDisplayIsProgrammatic = true;          // display name matches any programmatic name
+        }
+        while( !(++pNames)->aDispName.isEmpty() );
+    }
+
+    if ( bDisplayIsProgrammatic || lcl_EndsWithUser( rDispName ) )
+    {
+        //  add the (user) suffix if the display name matches any style's programmatic name
+        //  or if it already contains the suffix
+
+        String aRet(rDispName);
+        aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SC_SUFFIX_USER ) );
+        return aRet;
+    }
+
+    return rDispName;
+}
+
+OUString ScStyleNameConversion::ProgrammaticToDisplayName( const OUString& rProgName, sal_uInt16 nType )
+{
+    if ( lcl_EndsWithUser( rProgName ) )
+    {
+        //  remove the (user) suffix, don't compare to map entries
+        return rProgName.copy( 0, rProgName.getLength() - SC_SUFFIX_USER_LEN );
+    }
+
+    const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType );
+    if (pNames)
+    {
+        do
+        {
+            if (pNames->aProgName == rProgName)
+                return pNames->aDispName;
+        }
+        while( !(++pNames)->aDispName.isEmpty() );
+    }
+    return rProgName;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 93192ae..763bf67 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -121,6 +121,7 @@
 #include "stringutil.hxx"
 #include "formulaiter.hxx"
 #include "tokenarray.hxx"
+#include "stylehelper.hxx"
 
 #include <list>
 #include <boost/scoped_ptr.hpp>
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 1973213..67a2ad8 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -35,6 +35,7 @@
 #include "styleuno.hxx"     // ScStyleNameConversion
 #include "tokenarray.hxx"
 #include "tokenuno.hxx"
+#include "stylehelper.hxx"
 
 using namespace ::com::sun::star;
 using namespace ::formula;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 9c7cc58..246639d 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -63,6 +63,7 @@
 #include "unowids.hxx"
 #include "globstr.hrc"
 #include "cellsuno.hxx"
+#include "stylehelper.hxx"
 
 using namespace ::com::sun::star;
 
@@ -397,148 +398,6 @@ SC_SIMPLE_SERVICE_INFO( ScStyleFamilyObj, "ScStyleFamilyObj", "com.sun.star.styl
 
 //------------------------------------------------------------------------
 
-//  conversion programmatic <-> display (visible) name
-//  currently, the core always has the visible names
-//  the api is required to use programmatic names for default styles
-//  these programmatic names must never change!
-
-#define SC_STYLE_PROG_STANDARD      "Default"
-#define SC_STYLE_PROG_RESULT        "Result"
-#define SC_STYLE_PROG_RESULT1       "Result2"
-#define SC_STYLE_PROG_HEADLINE      "Heading"
-#define SC_STYLE_PROG_HEADLINE1     "Heading1"
-#define SC_STYLE_PROG_REPORT        "Report"
-
-struct ScDisplayNameMap
-{
-    String  aDispName;
-    String  aProgName;
-};
-
-static const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType )
-{
-    if ( nType == SFX_STYLE_FAMILY_PARA )
-    {
-        static sal_Bool bCellMapFilled = false;
-        static ScDisplayNameMap aCellMap[6];
-        if ( !bCellMapFilled )
-        {
-            aCellMap[0].aDispName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD );
-            aCellMap[0].aProgName = OUString( SC_STYLE_PROG_STANDARD );
-
-            aCellMap[1].aDispName = ScGlobal::GetRscString( STR_STYLENAME_RESULT );
-            aCellMap[1].aProgName = OUString( SC_STYLE_PROG_RESULT );
-
-            aCellMap[2].aDispName = ScGlobal::GetRscString( STR_STYLENAME_RESULT1 );
-            aCellMap[2].aProgName = OUString( SC_STYLE_PROG_RESULT1 );
-
-            aCellMap[3].aDispName = ScGlobal::GetRscString( STR_STYLENAME_HEADLINE );
-            aCellMap[3].aProgName = OUString( SC_STYLE_PROG_HEADLINE );
-
-            aCellMap[4].aDispName = ScGlobal::GetRscString( STR_STYLENAME_HEADLINE1 );
-            aCellMap[4].aProgName = OUString( SC_STYLE_PROG_HEADLINE1 );
-
-            //  last entry remains empty
-
-            bCellMapFilled = sal_True;
-        }
-        return aCellMap;
-    }
-    else if ( nType == SFX_STYLE_FAMILY_PAGE )
-    {
-        static sal_Bool bPageMapFilled = false;
-        static ScDisplayNameMap aPageMap[3];
-        if ( !bPageMapFilled )
-        {
-            aPageMap[0].aDispName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD );
-            aPageMap[0].aProgName = OUString( SC_STYLE_PROG_STANDARD );
-
-            aPageMap[1].aDispName = ScGlobal::GetRscString( STR_STYLENAME_REPORT );
-            aPageMap[1].aProgName = OUString( SC_STYLE_PROG_REPORT );
-
-            //  last entry remains empty
-
-            bPageMapFilled = sal_True;
-        }
-        return aPageMap;
-    }
-    OSL_FAIL("invalid family");
-    return NULL;
-}
-
-//  programmatic name suffix for display names that match other programmatic names
-//  is " (user)" including a space
-
-#define SC_SUFFIX_USER      " (user)"
-#define SC_SUFFIX_USER_LEN  7
-
-static sal_Bool lcl_EndsWithUser( const String& rString )
-{
-    const sal_Unicode *pChar = rString.GetBuffer();
-    xub_StrLen nLen = rString.Len();
-    return nLen >= SC_SUFFIX_USER_LEN &&
-           pChar[nLen-7] == ' ' &&
-           pChar[nLen-6] == '(' &&
-           pChar[nLen-5] == 'u' &&
-           pChar[nLen-4] == 's' &&
-           pChar[nLen-3] == 'e' &&
-           pChar[nLen-2] == 'r' &&
-           pChar[nLen-1] == ')';
-}
-
-String ScStyleNameConversion::DisplayToProgrammaticName( const String& rDispName, sal_uInt16 nType )
-{
-    sal_Bool bDisplayIsProgrammatic = false;
-
-    const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType );
-    if (pNames)
-    {
-        do
-        {
-            if (pNames->aDispName == rDispName)
-                return pNames->aProgName;
-            else if (pNames->aProgName == rDispName)
-                bDisplayIsProgrammatic = sal_True;          // display name matches any programmatic name
-        }
-        while( (++pNames)->aDispName.Len() );
-    }
-
-    if ( bDisplayIsProgrammatic || lcl_EndsWithUser( rDispName ) )
-    {
-        //  add the (user) suffix if the display name matches any style's programmatic name
-        //  or if it already contains the suffix
-
-        String aRet(rDispName);
-        aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SC_SUFFIX_USER ) );
-        return aRet;
-    }
-
-    return rDispName;
-}
-
-String ScStyleNameConversion::ProgrammaticToDisplayName( const String& rProgName, sal_uInt16 nType )
-{
-    if ( lcl_EndsWithUser( rProgName ) )
-    {
-        //  remove the (user) suffix, don't compare to map entries
-        return rProgName.Copy( 0, rProgName.Len() - SC_SUFFIX_USER_LEN );
-    }
-
-    const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType );
-    if (pNames)
-    {
-        do
-        {
-            if (pNames->aProgName == rProgName)
-                return pNames->aDispName;
-        }
-        while( (++pNames)->aDispName.Len() );
-    }
-    return rProgName;
-}
-
-//------------------------------------------------------------------------
-
 static sal_Bool lcl_AnyTabProtected( ScDocument& rDoc )
 {
     SCTAB nTabCount = rDoc.GetTableCount();
commit d4f631e8ceb7f02a18565cf0470c8170215e69f8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jun 29 01:08:22 2013 +0200

    only clean the cond format if we want to write attribs, fdo#62267
    
    Change-Id: I2f4feecb3180b165f6b9b299ecb3dcdbb65f87e3

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index cec4679..62dd91e 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -773,7 +773,7 @@ void ScTable::CopyFromClip(
             aCol[i].CopyFromClip(rCxt, nRow1, nRow2, nDy, pTable->aCol[i - nDx]);
 
 
-        if (rCxt.getInsertFlag() != IDF_OBJECTS)
+        if (rCxt.getInsertFlag() == IDF_ATTRIB)
         {
             // make sure that there are no old references to the cond formats
             sal_uInt16 nWhichArray[2];
commit 4911762d5e0c8f77c825f93a1fc6bec4831446ca
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jun 29 00:19:45 2013 +0200

    no need to have this class in the header file
    
    Change-Id: Ifc7c8f061861f61384e68ad30daed35e9870955a

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 832e09b..9441483 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -29,24 +29,7 @@ class ScFormulaCell;
 class ScTokenArray;
 struct ScDataBarInfo;
 class BitmapEx;
-
-class ScFormulaListener : public SvtListener
-{
-private:
-    std::vector<ScRange> maCells;
-    mutable bool mbDirty;
-    ScDocument* mpDoc;
-
-    void startListening(ScTokenArray* pTokens, const ScAddress& rPos);
-
-public:
-    ScFormulaListener(ScFormulaCell* pCell);
-    virtual ~ScFormulaListener();
-
-    void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
-
-    bool NeedsRepaint() const;
-};
+class ScFormulaListener;
 
 // don't change the order
 // they are also used in the dialog to determine the position
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 9d4d71b..a96711a 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -19,6 +19,24 @@
 
 #include <algorithm>
 
+class ScFormulaListener : public SvtListener
+{
+private:
+    std::vector<ScRange> maCells;
+    mutable bool mbDirty;
+    ScDocument* mpDoc;
+
+    void startListening(ScTokenArray* pTokens, const ScAddress& rPos);
+
+public:
+    ScFormulaListener(ScFormulaCell* pCell);
+    virtual ~ScFormulaListener();
+
+    void Notify( SvtBroadcaster& rBC, const SfxHint& rHint );
+
+    bool NeedsRepaint() const;
+};
+
 ScFormulaListener::ScFormulaListener(ScFormulaCell* pCell):
     mbDirty(false),
     mpDoc(pCell->GetDocument())


More information about the Libreoffice-commits mailing list