sc/inc/rangeutl.hxx                |    8 ++++++++
 sc/inc/refupdatecontext.hxx        |    4 ++--
 sc/source/core/data/colorscale.cxx |    1 +
 sc/source/core/tool/rangeutl.cxx   |   17 +++++++++++++++++
 4 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 3d6b2fb2cdfbe6c06af8138b443f44f1140e8af6
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Tue Jun 27 01:45:46 2017 +0200

    add way to handle update refs for addresses, related tdf#107289
    
    Change-Id: I97d1724d7aa1652619edda1cbe6a4ae4db277563
    Reviewed-on: https://gerrit.libreoffice.org/39316
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx
index 92ceaa99d84d..47cace7db2ad 100644
--- a/sc/inc/rangeutl.hxx
+++ b/sc/inc/rangeutl.hxx
@@ -269,6 +269,14 @@ public:
     bool WasDBName() const { return !bFirstPass; }
 };
 
+struct SC_DLLPUBLIC ScRangeUpdater
+{
+    ScRangeUpdater() = delete;
+
+    static void UpdateInsertTab(ScAddress& rAddr, const 
sc::RefUpdateInsertTabContext& rCxt);
+    static void UpdateDeleteTab(ScAddress& rAddr, const 
sc::RefUpdateDeleteTabContext& rCxt);
+};
+
 #endif // INCLUDED_SC_INC_RANGEUTL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/refupdatecontext.hxx b/sc/inc/refupdatecontext.hxx
index 2c47563dd34c..167eb0bec2d3 100644
--- a/sc/inc/refupdatecontext.hxx
+++ b/sc/inc/refupdatecontext.hxx
@@ -107,7 +107,7 @@ struct RefUpdateResult
     RefUpdateResult(const RefUpdateResult& r);
 };
 
-struct RefUpdateInsertTabContext
+struct SC_DLLPUBLIC RefUpdateInsertTabContext
 {
     ScDocument& mrDoc;
     SCTAB mnInsertPos;
@@ -117,7 +117,7 @@ struct RefUpdateInsertTabContext
     RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB 
nSheets);
 };
 
-struct RefUpdateDeleteTabContext
+struct SC_DLLPUBLIC RefUpdateDeleteTabContext
 {
     ScDocument& mrDoc;
     SCTAB mnDeletePos;
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 0d8ee77dd82d..872435378244 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -29,6 +29,7 @@
 #include "convuno.hxx"
 #include "externalrefmgr.hxx"
 #include "compiler.hxx"
+#include "refupdatecontext.hxx"
 
 using ::formula::FormulaGrammar;
 using namespace ::com::sun::star;
@@ -1014,4 +1015,20 @@ bool ScAreaNameIterator::Next( OUString& rName, ScRange& 
rRange )
     }
 }
 
+void ScRangeUpdater::UpdateInsertTab(ScAddress& rAddr, const 
sc::RefUpdateInsertTabContext& rCxt)
+{
+    if (rCxt.mnInsertPos <= rAddr.Tab())
+    {
+        rAddr.IncTab(rCxt.mnSheets);
+    }
+}
+
+void ScRangeUpdater::UpdateDeleteTab(ScAddress& rAddr, const 
sc::RefUpdateDeleteTabContext& rCxt)
+{
+    if (rCxt.mnDeletePos <= rAddr.Tab())
+    {
+        rAddr.IncTab(-rCxt.mnSheets);
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 87fa01674b1418c060b20a7f5af1d0d6eebe99cd
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Tue Jun 27 00:36:32 2017 +0200

    clear the lists with listened cells after we stop listening
    
    Change-Id: I4bc21ff9085c0033f3ee16b7e22a73091d57c7a9
    Reviewed-on: https://gerrit.libreoffice.org/39315
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 916143664b81..25a029024e28 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -127,6 +127,7 @@ void ScFormulaListener::stopListening()
         return;
 
     std::for_each(maCells.begin(), maCells.end(), StopListeningCell(mpDoc, 
this));
+    maCells.clear();
 }
 
 ScFormulaListener::~ScFormulaListener()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to