diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-09-01 11:39:57 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-09-01 14:48:49 -0400 |
commit | 16c8c46d85d7aafcb9159b12e2d44bc0bf322c69 (patch) | |
tree | 0820f331edc68ef59d78c6f3cf62652b657119a0 /sc | |
parent | a50fe4298d6761567230a1570a544398cca850c6 (diff) |
Reset autospell data when inserting/deleting cells.
Change-Id: I4ec48afe4a1aebe96dfb0fe5d507c786bdecae66
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/tabview.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 11 |
6 files changed, 32 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d0b0e50a21ed..acbee874b274 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2010,6 +2010,9 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, rDocShell.ErrorMessage(STR_INSERT_FULL); // Spalte/Zeile voll } + if (pViewSh) + pViewSh->ResetAutoSpell(); + aModificator.SetDocumentModified(); SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); @@ -2490,6 +2493,11 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, rDocShell.PostPaint( nPaintStartCol, nPaintStartRow, *itr, nPaintEndCol, nPaintEndRow, *itr+nScenarioCount, PAINT_TOP ); } } + + ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); + if (pViewSh) + pViewSh->ResetAutoSpell(); + aModificator.SetDocumentModified(); SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 91a3774c5811..cbb774b85035 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -393,6 +393,7 @@ public: void DrawLayerCreated(); bool ContinueOnlineSpelling(); void EnableAutoSpell( bool bEnable ); + void ResetAutoSpell(); void DeleteCopySourceOverlay(); void UpdateCopySourceOverlay(); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 75215e878eca..cb94eb81b8d4 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -523,6 +523,7 @@ public: bool ContinueOnlineSpelling(); void EnableAutoSpell( bool bEnable ); + void ResetAutoSpell(); }; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 03dc2aa101ef..6949b8f0dc8f 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5523,6 +5523,16 @@ void ScGridWindow::EnableAutoSpell( bool bEnable ) mpSpellCheckCxt.reset(); } +void ScGridWindow::ResetAutoSpell() +{ + if (mpSpellCheckCxt) + { + mpSpellCheckCxt->reset(); + mpSpellCheckCxt->maPos.mnCol = maVisibleRange.mnCol1; + mpSpellCheckCxt->maPos.mnRow = maVisibleRange.mnRow1; + } +} + // #114409# void ScGridWindow::CursorChanged() { diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 2a057b5d07d1..ba286049933f 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -607,10 +607,7 @@ bool ScGridWindow::UpdateVisibleRange() // Store the current visible range. bool bChanged = maVisibleRange.set(nPosX, nPosY, nXRight, nYBottom); if (bChanged) - { - if (mpSpellCheckCxt) - mpSpellCheckCxt->reset(); - } + ResetAutoSpell(); return bChanged; } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 599b5a6e7560..2e9e61235c38 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2358,4 +2358,15 @@ void ScTabView::EnableAutoSpell( bool bEnable ) } } +void ScTabView::ResetAutoSpell() +{ + for (int i = 0; i < 4; ++i) + { + if (!pGridWin[i]) + continue; + + pGridWin[i]->ResetAutoSpell(); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |