From 1b1999009962b9d79858139bd7573947f78e6669 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 21 Jan 2019 11:20:19 +0100 Subject: tdf#122748 Don't restore previous language selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8688c65695080804bae22209ed5d4890ced1a8dc Reviewed-on: https://gerrit.libreoffice.org/66678 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- cui/source/dialogs/SpellDialog.cxx | 7 ++++--- cui/source/inc/SpellDialog.hxx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index eb2d0ff4655f..f586f0eaf212 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -297,7 +297,7 @@ void SpellDialog::Init_Impl() LinguMgr::GetChangeAllList()->clear(); } -void SpellDialog::UpdateBoxes_Impl() +void SpellDialog::UpdateBoxes_Impl(bool bCallFromSelectHdl) { sal_Int32 i; m_pSuggestionLB->Clear(); @@ -324,7 +324,8 @@ void SpellDialog::UpdateBoxes_Impl() } else SetTitle_Impl( nAltLanguage ); - m_pLanguageLB->SelectLanguage( nAltLanguage ); + if( !bCallFromSelectHdl ) + m_pLanguageLB->SelectLanguage( nAltLanguage ); int nDicts = InitUserDicts(); // enter alternatives @@ -767,7 +768,7 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, ListBox&, rBox, void) m_pSentenceED->AddUndoAction(std::make_unique(SPELLUNDO_CHANGE_LANGUAGE, aDialogUndoLink)); } - SpellDialog::UpdateBoxes_Impl(); + SpellDialog::UpdateBoxes_Impl(true); } diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 9af4d9af83c9..83ea575f91f5 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -196,7 +196,7 @@ private: void AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu const *pMenu ); void StartSpellOptDlg_Impl(); int InitUserDicts(); - void UpdateBoxes_Impl(); + void UpdateBoxes_Impl(bool bCallFromSelectHdl = false); void Init_Impl(); void SpellContinue_Impl(bool UseSavedSentence = false, bool bIgnoreCurrentError = false ); void LockFocusChanges( bool bLock ) {bFocusLocked = bLock;} -- cgit