sc/inc/conditio.hxx                |    1 -
 sc/source/core/data/colorscale.cxx |   26 +-------------------------
 2 files changed, 1 insertion(+), 26 deletions(-)

New commits:
commit 068755d9313b61a1e4691c27eea122116d3623df
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Tue Jun 27 19:29:02 2017 +0200

    no need to manually keep track of listener range
    
    Change-Id: I833a2336f0c0ce8cc61eab4c56e1ffac3e36ae62
    Reviewed-on: https://gerrit.libreoffice.org/39319
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 631d0449cc13..8dff0355a648 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -89,7 +89,6 @@ enum ScConditionMode
 class ScFormulaListener : public SvtListener
 {
 private:
-    std::vector<ScRange> maCells;
     mutable bool mbDirty;
     ScDocument* mpDoc;
     std::function<void()> maCallbackFunction;
diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 4bc29e669006..5b2a942e8ca9 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -52,8 +52,6 @@ void ScFormulaListener::startListening(ScTokenArray* pArr, 
const ScRange& rRange
                 ScRange aRange(aCell, aCell2);
                 if (aRange.IsValid())
                     mpDoc->StartListeningArea(aRange, false, this);
-
-                maCells.push_back(aRange);
             }
             break;
             case formula::svDoubleRef:
@@ -81,7 +79,6 @@ void ScFormulaListener::startListening(ScTokenArray* pArr, 
const ScRange& rRange
                         }
                     }
                     mpDoc->StartListeningArea(aRange1, false, this);
-                    maCells.push_back(aRange1);
                 }
             }
             break;
@@ -101,33 +98,12 @@ void ScFormulaListener::setCallback(const 
std::function<void()>& aCallback)
     maCallbackFunction = aCallback;
 }
 
-namespace {
-
-struct StopListeningCell
-{
-    StopListeningCell(ScDocument* pDoc, SvtListener* pListener):
-        mpDoc(pDoc), mpListener(pListener) {}
-
-    // TODO: moggi: use EndListeningArea
-    void operator()(const ScRange& rRange)
-    {
-        mpDoc->EndListeningArea(rRange, false, mpListener);
-    }
-
-private:
-    ScDocument* mpDoc;
-    SvtListener* mpListener;
-};
-
-}
-
 void ScFormulaListener::stopListening()
 {
     if (mpDoc->IsClipOrUndo())
         return;
 
-    std::for_each(maCells.begin(), maCells.end(), StopListeningCell(mpDoc, 
this));
-    maCells.clear();
+    this->EndListeningAll();
 }
 
 ScFormulaListener::~ScFormulaListener()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to