forked from amazingfate/loongoffice
When the accessible child count exceeds max long, no longer return max long in the IAccessible::get_accChildCount [1] implementation in the Windows a11y bridge, but instead return error code `S_FALSE` [2]: > The method succeeded in part. This happens when the method succeeds, but > the requested information is not available. For example, Microsoft > Active Accessibility returns S_FALSE if you call IAccessible::accHitTest > to retrieve a child object at a given point, and the specified point is > not within the object or the object's child. This prevents the problem that Windows Speech Recognition on Windows 10 (see tdf#153131) and apparently some tools on Windows 11 that query information from LO via the accessibility API (see tdf#165131 and tickets referenced from there) apparently try to iterate over all children from child index 0 to (excluding) the returned index unconditionally, which causes a freeze if the returned number is too large. In practice, this is known to be a problem with Calc sheets, for which all cells are currently considered direct children. A quick test with NVDA and this change in place didn't reveal any issues. (Independent of this change, using JAWS 2025.2412.50 instantly results in a crash somewhere in the AT code that gets run in-process, preventing to test what implications this change would have there otherwise.) [1] https://learn.microsoft.com/en-us/windows/win32/api/oleacc/nf-oleacc-iaccessible-get_accchildcount [2] https://learn.microsoft.com/en-us/windows/win32/winauto/return-values Change-Id: If12dbcbb387a765bec4194d2bfe61bd29aa0f8a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181370 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 9ee01d58771b8ea585698094019b1a4dd38e54eb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181379 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>