diff options
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 6 | ||||
-rw-r--r-- | cui/source/inc/SpellDialog.hxx | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 9f110c6a5aa1..1c847e8ed97c 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -160,6 +160,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, : SfxModelessDialogController (_pBindings, pChildWindow, pParent, "cui/ui/spellingdialog.ui", "SpellingDialog") , aDialogUndoLink(LINK (this, SpellDialog, DialogUndoHdl)) + , m_pInitHdlEvent(nullptr) , bFocusLocked(true) , rParent(*pChildWindow) , pImpl( new SpellDialog_Impl ) @@ -218,11 +219,13 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, //InitHdl wants to use virtual methods, so it //can't be called during the ctor, so init //it on next event cycle post-ctor - Application::PostUserEvent(LINK(this, SpellDialog, InitHdl)); + m_pInitHdlEvent = Application::PostUserEvent(LINK(this, SpellDialog, InitHdl)); } SpellDialog::~SpellDialog() { + if (m_pInitHdlEvent) + Application::RemoveUserEvent(m_pInitHdlEvent); if (pImpl) { // save possibly modified user-dictionaries @@ -392,6 +395,7 @@ void SpellDialog::SpellContinue_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGua */ IMPL_LINK_NOARG( SpellDialog, InitHdl, void*, void) { + m_pInitHdlEvent = nullptr; m_xDialog->freeze(); //show or hide AutoCorrect depending on the modules abilities m_xAutoCorrPB->set_visible(rParent.HasAutoCorrection()); diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 69f491fc6586..da5fee960c84 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -130,7 +130,7 @@ private: OUString m_sTitleSpellingGrammar; Link<SpellUndoAction_Impl&,void> aDialogUndoLink; - + ImplSVEvent * m_pInitHdlEvent; bool bFocusLocked; svx::SpellDialogChildWindow& rParent; |