vcl/unx/gtk3/a11y/atkwrapper.cxx |   20 --------------------
 vcl/unx/gtk3/a11y/atkwrapper.hxx |    2 --
 2 files changed, 22 deletions(-)

New commits:
commit 9f308ba42f44e7d8e2f73a92923b0374e39083aa
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu May 1 19:36:06 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 1 23:19:13 2025 +0200

    gtk3 a11y: Drop obsolete handling when notifying child removal
    
    This special handling with the comment saying
    
        /*
         * the atk-bridge GTK+ module gets back to the event source to ref the 
child just
         * vanishing, so we keep this reference because the semantic on OOo 
side is different.
         */
    
    was added long ago, in
    
        commit d66cef09e7d7b19d8c85487f3b34e17f44d0ed98
        Author: Oliver Bolte <o...@openoffice.org>
        Date:   Fri Jul 25 08:11:58 2008 +0000
    
            INTEGRATION: CWS aqua11y02 (1.8.34); FILE MERGED
            2008/06/12 13:32:40 obr 1.8.34.3: #i86659# add support for 
XAccessibleMultiLineText
            2008/06/06 10:19:20 obr 1.8.34.2: #i85292# wrapper now cache the 
name, suppress unload of gtk plugin when atk-bridge module gets loaded as the 
shutdown symbol is no longer in global address space
            2008/06/02 04:32:34 obr 1.8.34.1: #i88047# role mapping reworked
    
    and no longer applies. It doesn't for more than a decade, see
    e.g. ATK/at-spi2-core commit [1]
    
        commit 69ac4b1ac14a6da7fd248e97918088eee59e3d6d
        Author: Mark Doffman <mark.doff...@codethink.co.uk>
        Date:   Mon Jan 11 10:24:57 2010 -0800
    
            Ensure the child data is added to children-changed events properly.
    
    where ATK already only calls `atk_object_ref_accessible_child`
    for the "children-changed:add", not the "children-changed:remove"
    event, and that is still true today, see [2].
    
    Therefore, drop the special handling.
    
    [1] 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/commit/69ac4b1ac14a6da7fd248e97918088eee59e3d6d
    [2] 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/a5dcfe006aac552f4e0ca0b8b337febd52426ae4/atk-adaptor/event.c#L1195-1214
    
    Change-Id: I663780826289f7486eb2d73cdfbcc1733e081233
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184873
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 20c978cfcd3c..2087f76ffd38 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -508,13 +508,6 @@ wrapper_ref_child( AtkObject *atk_obj,
 
     AtkObject* child = nullptr;
 
-    // see comments above atk_object_wrapper_remove_child
-    if( -1 < i && obj->index_of_child_about_to_be_removed == i )
-    {
-        g_object_ref( obj->child_about_to_be_removed );
-        return obj->child_about_to_be_removed;
-    }
-
     if( obj->mpContext.is() )
     {
         try {
@@ -967,9 +960,6 @@ atk_object_wrapper_new( const css::uno::Reference< 
css::accessibility::XAccessib
         pWrap = ATK_OBJECT_WRAPPER( obj );
         pWrap->mpAccessible = rxAccessible;
 
-        pWrap->index_of_child_about_to_be_removed = -1;
-        pWrap->child_about_to_be_removed = nullptr;
-
         pWrap->mpContext = xContext;
         pWrap->mpOrig = orig;
         if (pWrap->mpOrig)
@@ -1067,17 +1057,7 @@ void atk_object_wrapper_add_child(AtkObjectWrapper* 
wrapper, AtkObject *child, g
 
 void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject 
*child, gint index)
 {
-    /*
-     * the atk-bridge GTK+ module gets back to the event source to ref the 
child just
-     * vanishing, so we keep this reference because the semantic on OOo side 
is different.
-     */
-    wrapper->child_about_to_be_removed = child;
-    wrapper->index_of_child_about_to_be_removed = index;
-
     g_signal_emit_by_name( ATK_OBJECT( wrapper ), "children_changed::remove", 
index, child, nullptr );
-
-    wrapper->index_of_child_about_to_be_removed = -1;
-    wrapper->child_about_to_be_removed = nullptr;
 }
 
 /*****************************************************************************/
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.hxx b/vcl/unx/gtk3/a11y/atkwrapper.hxx
index b3af41975b4d..480c4645daa3 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.hxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.hxx
@@ -72,8 +72,6 @@ struct AtkObjectWrapper
         mpTextAttributes;
     css::uno::Reference<css::accessibility::XAccessibleValue> mpValue;
 
-    AtkObject *child_about_to_be_removed;
-    gint       index_of_child_about_to_be_removed;
 //    OString * m_pKeyBindings
 };
 

Reply via email to