summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/gridwin.cxx7
-rw-r--r--sc/source/ui/view/tabview.cxx10
-rw-r--r--sc/source/ui/view/tabview5.cxx7
3 files changed, 17 insertions, 7 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 569395c99d6b..9dfca179a4ed 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5528,12 +5528,9 @@ void ScGridWindow::DrawLayerCreated()
ImpCreateOverlayObjects();
}
-void ScGridWindow::EnableAutoSpell( bool bEnable )
+void ScGridWindow::SetAutoSpellContext( const std::shared_ptr<sc::SpellCheckContext> &ctx )
{
- if (bEnable)
- mpSpellCheckCxt.reset(new sc::SpellCheckContext(pViewData->GetDocument(), pViewData->GetTabNo()));
- else
- mpSpellCheckCxt.reset();
+ mpSpellCheckCxt = ctx;
}
void ScGridWindow::ResetAutoSpell()
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 2c6dd86e368d..1f924ddaf8f9 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -45,6 +45,7 @@
#include <viewuno.hxx>
#include <appoptio.hxx>
#include <attrib.hxx>
+#include <spellcheckcontext.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/lokhelper.hxx>
@@ -2237,12 +2238,19 @@ void ScTabView::EnableRefInput(bool bFlag)
void ScTabView::EnableAutoSpell( bool bEnable )
{
+ if (bEnable)
+ mpSpellCheckCxt.reset(
+ new sc::SpellCheckContext(aViewData.GetDocument(),
+ aViewData.GetTabNo()));
+ else
+ mpSpellCheckCxt.reset();
+
for (VclPtr<ScGridWindow> & pWin : pGridWin)
{
if (!pWin)
continue;
- pWin->EnableAutoSpell(bEnable);
+ pWin->SetAutoSpellContext(mpSpellCheckCxt);
}
}
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index e504cf231698..a81772131d12 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -46,6 +46,7 @@
#include <docsh.hxx>
#include <viewuno.hxx>
#include <postit.hxx>
+#include <spellcheckcontext.hxx>
#include <vcl/settings.hxx>
@@ -193,6 +194,10 @@ ScTabView::~ScTabView()
pSelEngine.reset();
+ if (mpSpellCheckCxt)
+ mpSpellCheckCxt->dispose();
+ mpSpellCheckCxt.reset();
+
mxInputHintOO.reset();
for (i=0; i<4; i++)
pGridWin[i].disposeAndClear();
@@ -269,9 +274,9 @@ void ScTabView::DoAddWin( ScGridWindow* pWin )
if (pDrawView)
{
pDrawView->AddWindowToPaintView(pWin, nullptr);
-
pWin->DrawLayerCreated();
}
+ pWin->SetAutoSpellContext(mpSpellCheckCxt);
}
void ScTabView::TabChanged( bool bSameTabButMoved )