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

New commits:
commit bf715f188a511a49104afec6ceec88771639ad3e
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Mon Oct 26 20:18:28 2020 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 29 10:59:17 2020 +0100

    calc: clear the spell-checking cache on tab switch.
    
    Change-Id: I187b5ff65c951e088e403f1a7a833bee248229fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104852
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index ac2b19141360..d4a0e0162530 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 026c0c5a7968..971fa481c04f 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -209,6 +209,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 ccc47fb2c06b..f9334be17c2a 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>
@@ -1869,6 +1870,8 @@ 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