vcl/unx/gtk3/a11y/atkwrapper.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 8698b354ca9cd3b48aee513dd1564e46ca513261
Author:     Colomban Wendling <cwendl...@hypra.fr>
AuthorDate: Wed May 31 19:20:40 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jun 5 06:37:29 2023 +0200

    gtk3 a11y: Consolidate reporting accessible name
    
    Just like in I61c4d8d4713b2b82ebb40d9de2a8a773405591ba, avoid the any
    assumption on what the parent would do in its own implementation, and
    return ourselves when we mean to.
    
    The case of AtkObjectWrapper::get_name() is actually currently fine,
    because AtkObject::get_name() does what we think it does, and
    GtkWidgetAccessible doesn't override it, but it's safer not to rely on
    those assumptions.
    
    Change-Id: Ib500d8efa8501206da66c3cca4f6b93bd426cb7d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152457
    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 b8cb62cf8b30..f322987dbbcd 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -377,6 +377,8 @@ wrapper_get_name( AtkObject *atk_obj )
                 if( atk_obj->name )
                     g_free(atk_obj->name);
                 atk_obj->name = g_strdup(aName.getStr());
+
+                return atk_obj->name;
             }
         }
         catch(const uno::Exception&) {
commit ac643f1ae48bae7af6e7c0a5cc5a8dc83beac49b
Author:     Colomban Wendling <cwendl...@hypra.fr>
AuthorDate: Wed May 31 19:12:33 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jun 5 06:37:22 2023 +0200

    gtk3 a11y: Fix reporting accessible description
    
    AtkObjectWrapper::get_description() sets the AtkObject::description
    field and chains up to its parent, expecting it to return that member
    to the caller.
    
    This is a questionable assumption, but that's what AtkObject does.
    However, since f3b0a95f9c2f85604808c21485e46e43aebbbfed which fixed
    tdf#150496, the direct parent is GtkWidgetAccessible, not AtkObject.
    And the assumption about returning AtkObject::description doesn't hold
    then, because GtkWidgetAccessible short-circuits the call if it can't
    find the associate GtkWidget, which doesn't exist.
    
    To fix this, return the member directly when we set it, but leave it
    to the parent if we don't have anything better in case it could
    actually do something useful, and because it's customary.
    
    Change-Id: I61c4d8d4713b2b82ebb40d9de2a8a773405591ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152456
    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 22a6715d3037..b8cb62cf8b30 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -404,6 +404,8 @@ wrapper_get_description( AtkObject *atk_obj )
 
             g_free(atk_obj->description);
             atk_obj->description = g_strdup(aDescription.getStr());
+
+            return atk_obj->description;
         }
         catch(const uno::Exception&) {
             g_warning( "Exception in getAccessibleDescription()" );

Reply via email to