[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/inc sc/source
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 28 10:47:11 UTC 2020
sc/inc/spellcheckcontext.hxx | 2 +-
sc/source/ui/view/gridwin.cxx | 2 ++
sc/source/ui/view/spellcheckcontext.cxx | 14 ++++++++------
3 files changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 5245723d92e92773d4679b3cd60a70706e3b4782
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Oct 26 19:31:56 2020 +0000
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Oct 28 11:46:33 2020 +0100
Don't let sc's spell-checking EditEngine linger around as long.
Attempted blind fix for problems with stale OutputDevice usage.
Change-Id: Ifa9eb000907aa18e2007cc1020c269d97d182e72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104848
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 8e2392ef5ff1..d4a0e0162530 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -57,7 +57,7 @@ public:
private:
void ensureResults(SCCOL nCol, SCROW nRow);
void resetCache(bool bContentChangeOnly = false);
- void resetEngine();
+ void setup();
};
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 9dfca179a4ed..3a7c0491133e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -500,6 +500,8 @@ void ScGridWindow::dispose()
mpDPFieldPopup.disposeAndClear();
aComboButton.SetOutputDevice(nullptr);
+ if (mpSpellCheckCxt)
+ mpSpellCheckCxt->reset();
mpSpellCheckCxt.reset();
vcl::Window::dispose();
diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx
index 8861e91a41e4..d75525d90b4d 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -269,7 +269,8 @@ void SpellCheckContext::reset()
{
meLanguage = ScGlobal::GetEditDefaultLanguage();
resetCache();
- resetEngine();
+ mpEngine.reset();
+ mpStatus.reset();
}
void SpellCheckContext::resetForContentChange()
@@ -279,8 +280,12 @@ void SpellCheckContext::resetForContentChange()
void SpellCheckContext::ensureResults(SCCOL nCol, SCROW nRow)
{
- if (!mpEngine || !mpCache)
+ if (!mpEngine || !mpCache ||
+ ScGlobal::GetEditDefaultLanguage() != meLanguage)
+ {
reset();
+ setup();
+ }
// perhaps compute the pivot rangelist once in some pivot-table change handler ?
if (pDoc->HasPivotTable())
@@ -306,8 +311,6 @@ void SpellCheckContext::ensureResults(SCCOL nCol, SCROW nRow)
return;
}
- if (ScGlobal::GetEditDefaultLanguage() != meLanguage)
- reset();
// Cell content is either shared-string or EditTextObject
@@ -366,7 +369,6 @@ void SpellCheckContext::ensureResults(SCCOL nCol, SCROW nRow)
mpResult->set(nCol, nRow, pRanges.get());
mpCache->set(nCol, nRow, aCell, std::move(pRanges));
-
}
void SpellCheckContext::resetCache(bool bContentChangeOnly)
@@ -384,7 +386,7 @@ void SpellCheckContext::resetCache(bool bContentChangeOnly)
mpCache->clear(meLanguage);
}
-void SpellCheckContext::resetEngine()
+void SpellCheckContext::setup()
{
mpEngine.reset(new ScTabEditEngine(pDoc));
mpStatus.reset(new SpellCheckStatus());
More information about the Libreoffice-commits
mailing list