svx/source/dialog/rubydialog.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit edaed837865eed2ff2025bf370f3f78b82dc415d
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Dec 14 14:28:50 2022 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Dec 14 19:45:52 2022 +0000

    Resolves: tdf#152495 crash on dismissing ruby dialog with ESC
    
    Change-Id: I26af008a7ee7b105255a1aaacff7ff30813172a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144175
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index 9bc87b222fd4..30ae2f1a30d7 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()
@@ -271,9 +275,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

Reply via email to