[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 13 11:06:49 UTC 2021


 include/svtools/brwbox.hxx        |    2 ++
 svtools/source/brwbox/brwbox1.cxx |   14 ++++++++++----
 svx/source/fmcomp/fmgridif.cxx    |    3 +++
 3 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 3aa1152ccee13869b2c1d64a296524cf4fb73fa8
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 13 10:17:00 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 13 13:06:16 2021 +0200

    a11y crash on teardown of FmXGridPeer
    
    the XAccessible is destroyed before the attempt to dispose via
    the IAccessibleBrowseBox*
    
    so call that first before the XAccessible is destroyed
    
    Change-Id: I908a3fbc05f92b5e56b8b6f2bc0b27757d39d1fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118825
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index ad2100a0854a..e7ea12a985f2 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -449,6 +449,8 @@ protected:
 
     bool            IsDropFormatSupported( SotClipboardFormatId nFormat );     // need this because the base class' IsDropFormatSupported is not const ...
 
+    void            DisposeAccessible();
+
 protected:
     // callbacks for the data window
     virtual void    ImplStartTracking();
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index bc57b31426f7..1641b39f8b41 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -173,16 +173,22 @@ BrowseBox::~BrowseBox()
     disposeOnce();
 }
 
-void BrowseBox::dispose()
+void BrowseBox::DisposeAccessible()
 {
-    SAL_INFO("svtools", "BrowseBox:dispose " << this );
-
-    if ( m_pImpl->m_pAccessible )
+    if (m_pImpl->m_pAccessible )
     {
         disposeAndClearHeaderCell(m_pImpl->m_aColHeaderCellMap);
         disposeAndClearHeaderCell(m_pImpl->m_aRowHeaderCellMap);
         m_pImpl->m_pAccessible->dispose();
+        m_pImpl->m_pAccessible = nullptr;
     }
+}
+
+void BrowseBox::dispose()
+{
+    SAL_INFO("svtools", "BrowseBox:dispose " << this );
+
+    DisposeAccessible();
 
     Hide();
     pDataWin->pHeaderBar.disposeAndClear();
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 64c9c6029f64..6d866003e5e3 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2085,7 +2085,10 @@ void FmXGridPeer::dispose()
 
     VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
     if (pGrid)
+    {
         pGrid->setDataSource(Reference< XRowSet > ());
+        pGrid->DisposeAccessible();
+    }
 
     VCLXWindow::dispose();
 }


More information about the Libreoffice-commits mailing list