diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-26 10:12:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-01-27 08:12:43 +0000 |
commit | f6de8eac453b11d5fcfd823ac926521a5e398f9d (patch) | |
tree | 7e354ec8473d629de6a454c8f149eb7bba475783 /cui | |
parent | 52d5f2e247e6b0a638fc0ec83f5dbc1cca30d1cd (diff) |
fix online crash in SpellDialog
program/libmergedlo.so
EditEngine::GetUndoManager()
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173
program/libcuilo.so
svx::SpellDialog::InitHdl(void*)
cui/source/dialogs/SpellDialog.cxx:2016
program/libmergedlo.so
ImplWindowFrameProc(vcl::Window*, SalEvent, void const*)
include/rtl/ref.hxx:128
program/libmergedlo.so
SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent)
vcl/headless/svpinst.cxx:317
Change-Id: Icd79faea8b066e0725c5d96f5d9b64445578f3a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146091
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'cui')
-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 c01173808aa2..7b671fd84dfa 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -161,6 +161,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 ) @@ -219,11 +220,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 @@ -387,6 +390,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 315e7febdcb1..3c6a7b229ebb 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; |