[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - include/svtools svtools/source svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 15 08:49:10 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 b54404ade97d30c863d339fb85f56aeba5c4d5d1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 13 10:17:00 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jul 15 10:48:36 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/+/118798
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 004e939a7fbc..767b8a021619 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 e42dad407478..8303e0f55557 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