sd/source/ui/accessibility/AccessibleSlideSorterView.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 697fadb8f4efdc09091088261ca1b43984c029b4
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Jun 30 13:50:55 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jun 30 19:34:44 2025 +0200

    tdf#167296 sd a11y: Use better accessible role for slides view
    
    Don't use the DOCUMENT role for the slides view in Impress,
    as this is not the actual document, but only contains
    previews of the slides.
    Use the PANEL role instead.
    
    This also stops confusing the NVDA screen reader on Windows
    which was running into an exception trying to generate a text
    representation for the newly selected/focused slide when switching
    them. It now instead announce the accessible name/slide title as
    expected.
    
    Error/Backtrace seen with NVDA git master as of commit
    9e668b18fa397726382d3095656212de8d1b1d7e without this
    commit in place:
    
        ERROR - eventHandler.executeEvent (13:46:32.234) - MainThread (10300):
        error executing event: gainFocus on 
<NVDAObjects.IAccessible.IAccessible object at 0x0AEBDFF0> with extra args of {}
        Traceback (most recent call last):
          File "eventHandler.py", line 348, in executeEvent
            if isGainFocus and not doPreGainFocus(obj, sleepMode=sleepMode):
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "eventHandler.py", line 382, in doPreGainFocus
            if not api.setFocusObject(obj):
                   ^^^^^^^^^^^^^^^^^^^^^^^
          File "api.py", line 189, in setFocusObject
            setNavigatorObject(obj, isFocus=True)
          File "api.py", line 348, in setNavigatorObject
            review.setCurrentMode("document", False)
          File "review.py", line 140, in setCurrentMode
            pos = func(obj)
                  ^^^^^^^^^
          File "review.py", line 59, in getDocumentPosition
            pos = obj.treeInterceptor.makeTextInfo(obj)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "documentBase.py", line 76, in makeTextInfo
            return self.TextInfo(self, position)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "compoundDocuments.py", line 287, in __init__
            self._start = self._end = self._startObj.makeTextInfo(position)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "documentBase.py", line 76, in makeTextInfo
            return self.TextInfo(self, position)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "textInfos\offsets.py", line 505, in __init__
            self._startOffset = self._endOffset = self._getCaretOffset()
                                                  ^^^^^^^^^^^^^^^^^^^^^^
          File "textInfos\offsets.py", line 267, in _getCaretOffset
            raise NotImplementedError
        NotImplementedError
    
    Change-Id: Iacf1ecd624088d7c8fe693f71b4d5ed264584bb4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187188
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 
b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index d5e70a00b6b9..19155e49d5e3 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -213,7 +213,7 @@ sal_Int64 SAL_CALL 
AccessibleSlideSorterView::getAccessibleIndexInParent()
 sal_Int16 SAL_CALL AccessibleSlideSorterView::getAccessibleRole()
 {
     ThrowIfDisposed();
-    return AccessibleRole::DOCUMENT;
+    return AccessibleRole::PANEL;
 }
 
 OUString SAL_CALL AccessibleSlideSorterView::getAccessibleDescription()

Reply via email to