diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-14 14:28:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-14 19:39:11 +0000 |
commit | a5e9c08da60b66d91517633b9a677ebb84350ca9 (patch) | |
tree | a50f6403f221519b63529dc92901c5f44a0a8f6e /svx | |
parent | c5d262518d917a7a6a4f9ccac7b74b488f5b2269 (diff) |
Resolves: tdf#152495 crash on dismissing ruby dialog with ESC
Change-Id: I26af008a7ee7b105255a1aaacff7ff30813172a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144174
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 4059e8d35c8c..3fefb5e74641 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -83,6 +83,7 @@ class SvxRubyData_Impl : public cppu::WeakImplHelper<css::view::XSelectionChange Sequence<PropertyValues> aRubyValues; Reference<XController> xController; bool bHasSelectionChanged; + bool bDisposing; public: SvxRubyData_Impl(); @@ -98,6 +99,7 @@ public: return xModel; } bool HasSelectionChanged() const { return bHasSelectionChanged; } + bool IsDisposing() const { return bDisposing; } Reference<XRubySelection> const& GetRubySelection() { xSelection.set(xController, UNO_QUERY); @@ -120,6 +122,7 @@ public: SvxRubyData_Impl::SvxRubyData_Impl() : bHasSelectionChanged(false) + , bDisposing(false) { } @@ -161,6 +164,7 @@ void SvxRubyData_Impl::disposing(const EventObject&) { } xController = nullptr; + bDisposing = true; } void SvxRubyData_Impl::AssertOneEntry() @@ -269,9 +273,9 @@ void SvxRubyDialog::Close() void SvxRubyDialog::Activate() { SfxModelessDialogController::Activate(); - if (!m_xContentArea) + if (m_pImpl->IsDisposing()) { - // tdf#141967 if Activate is called during tear down bail early + // tdf#141967/tdf#152495 if Activate is called during tear down bail early return; } //get selection from current view frame |