diff options
author | Justin Luth <justin_luth@sil.org> | 2021-12-14 11:52:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2022-02-01 00:03:14 +0100 |
commit | d098e027cb9899e31ae3ff7ba245b78a009681fb (patch) | |
tree | bf74c5825b836e69fba48688682c2c1d451277d9 /sc | |
parent | 3564b5c6e93b2bf5881b359015efae351dbe8342 (diff) |
tdf#120896 sc: commit change after PopupSpelling
Although PopupSpelling visually has changed the screen,
the underlying document still contained the
old cached string or spelling status.
Thus spell-check still thought it was spelled wrong,
and right-clicking got very confused.
Steps to reproduce:
1.) type aaa and hit enter. (spelling error noted)
2.) right-click on "aaa" and chose various options.
2a.) --- replace with a suggestion
2b.) --- ignore word
2c.) --- add to dictionary
2d.) --- change language
2d.) --- autocorrect
(note we are still in editing mode)
3.) right-click again on the new or approved word
(no pop-up at all.)
The fix is to stop editing, so the changes are
applied to the various caches.
Steps that should NOT stop editing the cell
2e.) --- press ESC (or anything that cancels the pop-up)
2f.) --- choose Autocorrect Options
Change-Id: I9965ede6f6a5c31a811ff89abb687497306d6d1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126802
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1bc40626c81a..80cbf4e3728a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -489,6 +489,13 @@ IMPL_LINK( ScGridWindow, PopupSpellingHdl, SpellCallbackInfo&, rInfo, void ) mrViewData.GetDispatcher().Execute( SID_SPELL_DIALOG, SfxCallMode::ASYNCHRON ); else if (rInfo.nCommand == SpellCallbackCommand::AUTOCORRECT_OPTIONS) mrViewData.GetDispatcher().Execute( SID_AUTO_CORRECT_DLG, SfxCallMode::ASYNCHRON ); + else //IGNOREWORD, ADDTODICTIONARY, WORDLANGUAGE, PARALANGUAGE + { + // The spelling status of the word has changed. Close the cell to reset the caches + ScInputHandler* pHdl = SC_MOD()->GetInputHdl(mrViewData.GetViewShell()); + if (pHdl) + pHdl->EnterHandler(); + } } namespace { @@ -3294,9 +3301,14 @@ void ScGridWindow::Command( const CommandEvent& rCEvt ) if (pHdl) pHdl->SetModified(); + const OUString sOldText = pHdl ? pHdl->GetEditString() : ""; + Link<SpellCallbackInfo&,void> aLink = LINK( this, ScGridWindow, PopupSpellingHdl ); pEditView->ExecuteSpellPopup(aMenuPos, aLink); + if (pHdl && pHdl->GetEditString() != sOldText) + pHdl->EnterHandler(); + bDone = true; } } |