sc/inc/spellcheckcontext.hxx            |    1 +
 sc/source/ui/view/spellcheckcontext.cxx |    8 ++++++++
 sc/source/ui/view/tabview3.cxx          |    4 ++++
 3 files changed, 13 insertions(+)

New commits:
commit c2eb3259894b56e0dc8fe4762c66e05f37d48e40
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Mon Oct 26 20:18:28 2020 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Tue Oct 27 13:55:29 2020 +0100

    calc: clear the spell-checking cache on tab switch.
    
    Change-Id: I187b5ff65c951e088e403f1a7a833bee248229fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104850
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 07cab368443b..8e2392ef5ff1 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -52,6 +52,7 @@ public:
 
     void reset();
     void resetForContentChange();
+    void setTabNo(SCTAB nTab);
 
 private:
     void ensureResults(SCCOL nCol, SCROW nRow);
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 4b90bdb0c099..8861e91a41e4 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -227,6 +227,14 @@ void SpellCheckContext::dispose()
     pDoc = nullptr;
 }
 
+void SpellCheckContext::setTabNo(SCTAB nTab)
+{
+    if (mnTab == nTab)
+        return;
+    mnTab = nTab;
+    reset();
+}
+
 bool SpellCheckContext::isMisspelled(SCCOL nCol, SCROW nRow) const
 {
     const_cast<SpellCheckContext*>(this)->ensureResults(nCol, nRow);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 01c363903004..736d47ace777 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -58,6 +58,7 @@
 #include <rangeutl.hxx>
 #include <client.hxx>
 #include <tabprotection.hxx>
+#include <spellcheckcontext.hxx>
 #include <markdata.hxx>
 #include <formula/FormulaCompiler.hxx>
 #include <comphelper/lok.hxx>
@@ -1851,6 +1852,9 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
         bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
 
         aViewData.SetTabNo( nTab );
+        if (mpSpellCheckCxt)
+            mpSpellCheckCxt->setTabNo( nTab );
+
         // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the 
correct
         // window  (is called from SetCursor)
         UpdateShow();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to