vcl/unx/gtk3/a11y/atkwrapper.cxx |   24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

New commits:
commit 5e1aaaf07d70cb8eda1c7f14a458680d9323ff74
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 8 10:26:55 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed May 8 13:56:16 2024 +0200

    gtk3 a11y: Drop superfluous check
    
    If `nStateSet` is 0, no states will be set int the
    loop anyway, so the extra check is not needed.
    
    Change-Id: Id26f2210c51cb6bf952720f9a84696a327992df6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167330
    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 a16e8f80834c..b83cf04d48b5 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -630,17 +630,13 @@ wrapper_ref_state_set( AtkObject *atk_obj )
     {
         try {
             sal_Int64 nStateSet = obj->mpContext->getAccessibleStateSet();
-
-            if( nStateSet )
+            for (int i = 0; i < 63; ++i)
             {
-                for (int i=0; i<63; ++i)
-                {
-                    // ATK_STATE_LAST_DEFINED is used to check if the state
-                    // is unmapped, do not report it to Atk
-                    sal_Int64 nState = sal_Int64(1) << i;
-                    if ( (nStateSet & nState) && mapAtkState( nState ) != 
ATK_STATE_LAST_DEFINED )
-                        atk_state_set_add_state( pSet, mapAtkState( nState ) );
-                }
+                // ATK_STATE_LAST_DEFINED is used to check if the state
+                // is unmapped, do not report it to Atk
+                sal_Int64 nState = sal_Int64(1) << i;
+                if ((nStateSet & nState) && mapAtkState(nState) != 
ATK_STATE_LAST_DEFINED)
+                    atk_state_set_add_state(pSet, mapAtkState(nState));
             }
         }
 
commit addb7abeb8ec1a145d9ba35d3be8518f2502325b
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 8 10:17:53 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed May 8 13:56:10 2024 +0200

    gtk3 a11y: No longer manually add focused state for focus object
    
    No longer manually add `ATK_STATE_FOCUSED` to the
    ATK focus object.
    
    The focused object should should have the
    `css::accessbibility::AccessibleStateType::FOCUSED`
    state set on UNO level, in which case this is already
    mapped to the focused state in the lines above the
    newly removed code, so explicitly addding it
    again shouldn't be necessary.
    
    If the state is missing, that most likely needs
    to be fixed in the underlying `XAccessibleStateSet`
    implementation.
    
    Therefore, remove what looks like a workaround.
    If any issues show up after this, let's rather take
    a look at the underlying issues and try to fix things
    there.
    
    Change-Id: Ie7252c4b2dd2ec15c7a3bbc6a1a5e2830cdd39a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167309
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index db0aa1dbc907..a16e8f80834c 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -641,14 +641,6 @@ wrapper_ref_state_set( AtkObject *atk_obj )
                     if ( (nStateSet & nState) && mapAtkState( nState ) != 
ATK_STATE_LAST_DEFINED )
                         atk_state_set_add_state( pSet, mapAtkState( nState ) );
                 }
-
-                // We need to emulate FOCUS state for menus, menu-items etc.
-                if( atk_obj == atk_get_focus_object() )
-                    atk_state_set_add_state( pSet, ATK_STATE_FOCUSED );
-/* FIXME - should we do this ?
-                else
-                    atk_state_set_remove_state( pSet, ATK_STATE_FOCUSED );
-*/
             }
         }
 

Reply via email to