svx/source/accessibility/AccessibleFrameSelector.cxx |    6 +++++-
 svx/source/dialog/frmsel.cxx                         |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 95fe393ab804a170b71c6cd84ab74dbd5440ae9a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Apr 28 17:55:43 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Apr 28 21:42:16 2025 +0200

    svx a11y: Move a11y code into corresponding block
    
    The Any variables here aren't relevant if a11y
    is disabled, so move them into the
    
        #if !ENABLE_WASM_STRIP_ACCESSIBILITY
    
    section, too.
    
    Change-Id: I87a7e171db43bfa7cf0ba9684b700266b4c2fd93
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184727
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index d477131ba013..3984432b28d3 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -756,12 +756,12 @@ void FrameSelectorImpl::DoInvalidate( bool bFullRepaint )
 void FrameSelectorImpl::SetBorderState( FrameBorder& rBorder, FrameBorderState 
eState )
 {
     DBG_ASSERT( rBorder.IsEnabled(), "svx::FrameSelectorImpl::SetBorderState - 
access to disabled border" );
+
+#if !ENABLE_WASM_STRIP_ACCESSIBILITY
     Any aOld;
     Any aNew;
     Any& rMod = eState == FrameBorderState::Show ? aNew : aOld;
     rMod <<= AccessibleStateType::CHECKED;
-
-#if !ENABLE_WASM_STRIP_ACCESSIBILITY
     rtl::Reference< a11y::AccFrameSelectorChild > xRet;
     size_t nVecIdx = static_cast< size_t >( rBorder.GetType() );
     if( GetBorder(rBorder.GetType()).IsEnabled() && (1 <= nVecIdx) && (nVecIdx 
<= maChildVec.size()) )
commit 8b9b77fde9af5430bdafd6c8abef9ac9123b3954
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Apr 28 17:47:27 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Apr 28 21:42:08 2025 +0200

    svx a11y: Report checked/checkable state for borders
    
    AccFrameSelectorChild is using an accessible role of
    AccessibleRole::CHECK_BOX and when the status/visibility
    of a border changes in FrameSelectorImpl::SetBorderState,
    an a11y STATE_CHANGED event was already sent for the
    CHECKED state. However, the CHECKABLED and CHECKED states
    themselves were never reported in
    AccFrameSelectorChild::getAccessibleStateSet.
    
    Extend AccFrameSelectorChild::getAccessibleStateSet
    accordingly to match the criterion used in
    FrameSelectorImpl::SetBorderState.
    
    The state now shows up as expected with the qt6 VCL plugin
    in Accerciser for the border's a11y objects in Writer's
    "Format" -> "Paragraph" dialog, tab "Borders" when
    one of the borders in the drawing area under the "User-defined"
    label gets selected in Accerciser's tree view of the
    a11y hierarchy.
    
    In addition, Orca now announces the state as well, e.g.
    "tick box ticked" when such a border receives focus,
    and toggling the state using the space key results in the
    new state getting announced ("not ticked"/"ticked" when
    using Orca with en_GB locale).
    
    Change-Id: Ia6dbe668a32829a94bc31726a434cad4ac1159cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184726
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx 
b/svx/source/accessibility/AccessibleFrameSelector.cxx
index 317c364fa75e..7bd808283aa8 100644
--- a/svx/source/accessibility/AccessibleFrameSelector.cxx
+++ b/svx/source/accessibility/AccessibleFrameSelector.cxx
@@ -290,7 +290,8 @@ sal_Int64 AccFrameSelectorChild::getAccessibleStateSet(  )
     if(!mpFrameSel)
         return AccessibleStateType::DEFUNC;
 
-    sal_Int64 nStateSet = AccessibleStateType::EDITABLE
+    sal_Int64 nStateSet = AccessibleStateType::CHECKABLE
+                          | AccessibleStateType::EDITABLE
                           | AccessibleStateType::FOCUSABLE
                           | AccessibleStateType::MULTI_SELECTABLE
                           | AccessibleStateType::SELECTABLE
@@ -303,6 +304,9 @@ sal_Int64 AccFrameSelectorChild::getAccessibleStateSet(  )
         nStateSet |= AccessibleStateType::SENSITIVE;
     }
 
+    if (mpFrameSel->GetFrameBorderState(meBorder) == FrameBorderState::Show)
+        nStateSet |= AccessibleStateType::CHECKED;
+
     if (mpFrameSel->HasFocus() && mpFrameSel->IsBorderSelected(meBorder))
     {
         nStateSet |= AccessibleStateType::ACTIVE;

Reply via email to