diff options
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r-- | vcl/unx/gtk3/a11y/atklistener.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/atkwrapper.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/gtk3/a11y/atkwrapper.hxx | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/a11y/atklistener.cxx b/vcl/unx/gtk3/a11y/atklistener.cxx index b9a053d83a7b..b826ea03061a 100644 --- a/vcl/unx/gtk3/a11y/atklistener.cxx +++ b/vcl/unx/gtk3/a11y/atklistener.cxx @@ -759,7 +759,7 @@ void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEven case accessibility::AccessibleEventId::ROLE_CHANGED: { uno::Reference< accessibility::XAccessibleContext > xContext = getAccessibleContextFromSource( aEvent.Source ); - atk_object_wrapper_set_role( mpWrapper, xContext->getAccessibleRole() ); + atk_object_wrapper_set_role(mpWrapper, xContext->getAccessibleRole(), xContext->getAccessibleStateSet()); break; } diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx index 49b1d371ae12..c946a6e3daaf 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx @@ -167,7 +167,7 @@ AtkStateType mapAtkState( sal_Int64 nState ) return type; } -static AtkRole mapToAtkRole( sal_Int16 nRole ) +static AtkRole mapToAtkRole(sal_Int16 nRole, sal_Int64 nStates) { switch (nRole) { @@ -310,7 +310,11 @@ static AtkRole mapToAtkRole( sal_Int16 nRole ) case accessibility::AccessibleRole::WINDOW: return ATK_ROLE_WINDOW; case accessibility::AccessibleRole::BUTTON_DROPDOWN: + { + if (nStates & css::accessibility::AccessibleStateType::CHECKABLE) + return ATK_ROLE_TOGGLE_BUTTON; return ATK_ROLE_PUSH_BUTTON; + } case accessibility::AccessibleRole::BUTTON_MENU: #if ATK_CHECK_VERSION(2, 46, 0) return ATK_ROLE_PUSH_BUTTON_MENU; @@ -972,7 +976,7 @@ atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessib pWrap->mpOrig = orig; AtkObject* atk_obj = ATK_OBJECT(pWrap); - atk_obj->role = mapToAtkRole( xContext->getAccessibleRole() ); + atk_obj->role = mapToAtkRole(xContext->getAccessibleRole(), xContext->getAccessibleStateSet()); atk_obj->accessible_parent = parent; ooo_wrapper_registry_add( rxAccessible, atk_obj ); @@ -1070,10 +1074,10 @@ void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child /*****************************************************************************/ -void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role) +void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role, sal_Int64 nStates) { AtkObject *atk_obj = ATK_OBJECT( wrapper ); - atk_object_set_role( atk_obj, mapToAtkRole( role ) ); + atk_object_set_role(atk_obj, mapToAtkRole(role, nStates)); } /*****************************************************************************/ diff --git a/vcl/unx/gtk3/a11y/atkwrapper.hxx b/vcl/unx/gtk3/a11y/atkwrapper.hxx index 911433fc8a6f..8d1aeb359bca 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.hxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.hxx @@ -93,7 +93,7 @@ AtkObject * atk_object_wrapper_new( void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index); void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index); -void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role); +void atk_object_wrapper_set_role(AtkObjectWrapper* wrapper, sal_Int16 role, sal_Int64 nStates); void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper); |