summaryrefslogtreecommitdiff
path: root/accessibility
AgeCommit message (Collapse)Author
2023-10-24tdf#135921 a11y Send event when toggling listbox checkboxMichael Weghorn
When toggling the state of the checkbox in a listbox/ treelist entry using the mouse or the keyboard, emit a `VclEventId::CheckboxToggle` event and process that in the a11y class that's used for the case where there's just a single checkbox (like in the spelling options dialog), `AccessibleListBoxEntry` by sending a corresponding STATE_CHANGED event on the a11y layer. This makes Orca with the qt6 VCL plugin and NVDA on Windows announce the new value when toggling a checkbox in the Spelling options dialog using either the mouse or the keyboard. As mentioned in the previous commit, Change-Id Ic78f9052d166be0da17a76261a09da02b8a11cd7 tdf#135921 a11y: Toggle listbox item checkbox on space , the case where a listbox entry has multiple checkboxes (like the autocorrect options dialog in Writer) uses different a11y classes and toggling a checkbox there still doesn't result in the new value being announced. Change-Id: I36a2b0a3fa3154279fb06af023fdb96f699fac2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158375 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-10-23a11y: Don't throw exception on valid list box entry action indexMichael Weghorn
`checkActionIndex_Impl` was previously throwing an IndexOutOfBoundsException for any index other than 0. The // only three actions comment in there was only adding to the confusion... Convert that helper function to a method of the class and take the actual count of actions into account. Also drop the misleading `ACCESSIBLE_ACTION_COUNT` define altogether, and just return 1 at the only remaining place using it. This fixes a crash seen with the qt6 VCL plugin and Orca running when opening the spelling options dialog ("Tools" -> "Spelling", then press the "Options..." button). 1 __pthread_kill_implementation pthread_kill.c 44 0x7f29908a80fc 2 __pthread_kill_internal pthread_kill.c 78 0x7f29908a815f 3 __GI_raise raise.c 26 0x7f299085a472 4 __GI_abort abort.c 79 0x7f29908444b2 5 ?? 0x7f29904a09db 6 ?? 0x7f29904affaa 7 std::terminate() 0x7f29904b0015 8 __cxa_throw 0x7f29904b0268 9 (anonymous namespace)::checkActionIndex_Impl accessiblelistboxentry.cxx 49 0x7f29562aeb82 10 accessibility::AccessibleListBoxEntry::getAccessibleActionDescription accessiblelistboxentry.cxx 770 0x7f29562b2b9b 11 QtAccessibleWidget::actionNames QtAccessibleWidget.cxx 805 0x7f297c84a8d7 12 QAccessibleBridgeUtils::effectiveActionNames qaccessiblebridgeutils.cpp 25 0x7f297b6c90a5 13 AtSpiAdaptor::actionInterface atspiadaptor.cpp 1862 0x7f297b6e2cc0 14 AtSpiAdaptor::handleMessage atspiadaptor.cpp 1438 0x7f297b6de432 15 QDBusConnectionPrivate::activateObject qdbusintegrator.cpp 1438 0x7f2979ec0ecb 16 QDBusActivateObjectEvent::placeMetaCall qdbusintegrator.cpp 1594 0x7f2979ec1bb0 17 QObject::event qobject.cpp 1446 0x7f297c02116e 18 QApplicationPrivate::notify_helper qapplication.cpp 3295 0x7f297a59d714 19 QApplication::notify qapplication.cpp 3246 0x7f297a59d524 20 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1131 0x7f297bfa23ba 21 QCoreApplication::sendEvent qcoreapplication.cpp 1572 0x7f297bfa2ead 22 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1937 0x7f297bfa3ea6 23 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1794 0x7f297bfa37ae 24 postEventSourceDispatch qeventdispatcher_glib.cpp 244 0x7f297c3b9108 25 ?? 0x7f29835111b4 26 ?? 0x7f29835142d7 27 g_main_context_iteration 0x7f29835148f0 28 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 394 0x7f297c3b999d 29 QXcbGlibEventDispatcher::processEvents qxcbeventdispatcher.cpp 96 0x7f2979c67036 30 QtInstance::ImplYield QtInstance.cxx 421 0x7f297c8c27c6 31 QtInstance::DoYield QtInstance.cxx 432 0x7f297c8c28ef 32 ImplYield svapp.cxx 377 0x7f298732dcc8 33 Application::Yield svapp.cxx 461 0x7f298732ea66 34 Application::Execute svapp.cxx 355 0x7f298732d9bb 35 desktop::Desktop::Main app.cxx 1601 0x7f2990a35716 36 ImplSVMain svmain.cxx 204 0x7f298734d600 37 SVMain svmain.cxx 236 0x7f298734d735 38 soffice_main sofficemain.cxx 94 0x7f2990aa058f 39 sal_main main.c 51 0x5629220af9d4 40 main main.c 49 0x5629220af9ba Change-Id: Ib3ed8616fb539942d9ba0cd60d5607859deb5a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158344 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15a11y: Add include to fix clang-cl buildMichael Weghorn
Without this, my clang-cl build on windows would fail like this: In file included from C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/source/extended/accessibletabbarbase.cxx:20: In file included from C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/inc\extended/accessibletabbarbase.hxx:24: In file included from C:/tools/cygwin/home/user/development/git/libreoffice/include\vcl/vclptr.hxx:25: C:/tools/cygwin/home/user/development/git/libreoffice/include\rtl/ref.hxx(129,20): error: member access into incomplete type 'accessibility::AccessibleTabBarPage' 129 | m_pBody->release(); | ^ C:/PROGRA~1/MICROS~2/2022/COMMUN~1/VC/Tools/MSVC/1437~1.328/Include\xmemory(321,21): note: in instantiation of member function 'rtl::Reference<accessibility::AccessibleTabBarPage>::~Reference' requested here 321 | _Location->~_Ty(); | ^ C:/tools/cygwin/home/user/development/git/libreoffice/accessibility/inc\extended/accessibletabbarpagelist.hxx(32,11): note: forward declaration of 'accessibility::AccessibleTabBarPage' 32 | class AccessibleTabBarPage; | ^ 1 error generated. make[1]: *** [C:/tools/cygwin/home/user/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:340: C:/tools/cygwin/home/user/development/git/libreoffice/workdir/CxxObject/accessibility/source/extended/accessibletabbarbase.o] Error 1 make: *** [Makefile:121: accessibility] Error 2 Change-Id: I3961fb95602b96667f33ea0b087e1df5375faf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157982 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-03accessibility: avoid OUString creation by using unicode OUString literalsArnaud Versini
Change-Id: I0f1f8c4e7601c68af607d6c540527e2979520586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157136 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-09-22tdf#146619 Recheck include/c* with IWYUGabor Kelemen
Change-Id: I0cf6f675483bddf82e7347b484a874c71963bfd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156984 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-13loplugin:unusedmethodsNoel Grandin
Change-Id: I00f228451574ca9f9e352d233c7f326c88e90a95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-12loplugin:unodispose in accessibilityNoel Grandin
Change-Id: I7e4f464c9130318c8b10d8e00e01ce4b6c05e06a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11AccessibleListBoxEntry does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: I92ec69dfab2aa5eb2acbb9804359853ffc27e565 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11accessibility::Paragraph does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: Ic0e9e3d58792fb21950a66253176eba413861600 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156800 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11VCLXAccessibleList does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: I561af7931b5863857311df3cd6c3a85ad494f578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11AccessibleIconChoiceCtrlEntry does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: I80459b404d610847395d2eae4d529a808c53f3d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-07tdf#157137 a11y: Don't report active descendant when not focusedMichael Weghorn
Since an active descendant is the UI element with keyboard focus, only send an `ACTIVE_DESCENDANT_CHANGED` event in `VCLXAccessibleList` if the listbox/combobox actually has focus, not when the selection changed otherwise, e.g. because the value was changed programmatically because it depends on another UI control (like the paper size in the print dialog depends on the selected printer. Change-Id: I008e742ccf3b81c70832707b2f3a6551827a0706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156666 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-06simplify VclEventId::TabpageRemoved handlingNoel Grandin
Change-Id: I9fe97a8d71fb898c0603ec76f7b86afb19c60654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-06a11y: Drop unnecessary casting/code for toolbox itemsMichael Weghorn
All (top-level) toolbox items have always been `VCLXAccessibleToolBoxItem` ever since commit f7da8972336b8ce3e0fb71b0c50464508837a5f3 Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Wed Jun 27 14:41:59 2007 +0000 INTEGRATION: CWS a11ysep (1.1.2); FILE ADDED 2007/02/28 07:29:13 fs 1.1.2.4: #i10000# 2006/10/05 08:20:15 fs 1.1.2.3: MANUAL RESYNC m130->m185: file had been modified in MWS, but moved herein in CWS 2005/09/28 11:35:38 fs 1.1.2.2: manual resync (files have been moved herein from another location): licence change 2005/03/07 08:29:10 fs 1.1.2.1: #i44293# moved implementations herein from toolkit module , so the dynamic_cast to check whether an item is a `OToolBoxWindowItem` is unnecessary and misleading when reading the code. This is even easier to see now after commit af08e6c2f46a6d99b2e18fe176c15ec2b6edb2fd Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Aug 30 14:02:11 2023 +0200 use concrete type for ToolBoxItemsMap `OToolBoxWindowItem`s are only set as children for the `VCLXAccessibleToolBoxItem`s, s. `VCLXAccessibleToolBox::getAccessibleChild`. Also drop now unused `OToolBoxWindowItem::getIndexInParent` and `OToolBoxWindowItem::setIndexInParent`. Change-Id: I7dcef304942ed25b77918f01cf9b679b6be6e23c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156566 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-05use more concrete type in VCLXAccessibleBoxNoel Grandin
and avoid some casting Change-Id: I755caf9ba5a333862d1a89a054359781544930f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156570 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-05use more concrete type in ParagraphInfoNoel Grandin
and avoid some casting Change-Id: I22ff61a028c102b0b8b03b53ac9657af0fbe5acd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-05use more concrete types in AccessibleListBoxEntryNoel Grandin
which means we only need one field, not two Change-Id: I0229348a797d0f01f3d35c46563efed161676efb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-04a11y: Hold list items by rtl::ReferenceMichael Weghorn
Use a vector of `rtl::Reference<VCLXAccessibleListItem>` for the children instead of a vector of `css::uno::Reference<css::accessibility::XAccessible>` and casting in various places. Change-Id: I1d0e72a7c844a685d762069002d747cf5e7d02dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156525 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-04a11y: Drop ListItems typdefMichael Weghorn
Change-Id: Ie8d62b769c44ab74a21fadd9ab395fe0f908ee76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156524 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-04tdf#157088 a11y: Dispose list items with listMichael Weghorn
Don't only clear, but also dispose the list items when the `VCLXAccessibleList` gets disposed. Interestingly, there was already a comment saying // Dispose all items in the list. , but that wasn't done so far... Fixes a crash on exit with the below backtrace after using the font color toolbox item with the qt6 VCL plugin and Orca running: 1 __pthread_kill_implementation pthread_kill.c 44 0x7fe2a2ea80fc 2 __pthread_kill_internal pthread_kill.c 78 0x7fe2a2ea815f 3 __GI_raise raise.c 26 0x7fe2a2e5a472 4 __GI_abort abort.c 79 0x7fe2a2e444b2 5 __assert_fail_base assert.c 92 0x7fe2a2e443d5 6 __assert_fail assert.c 101 0x7fe2a2e533a2 7 (anonymous namespace)::implLookupClient accessibleeventnotifier.cxx 140 0x7fe2a21138a4 8 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing accessibleeventnotifier.cxx 185 0x7fe2a2113bb8 9 VCLXAccessibleListItem::disposing vclxaccessiblelistitem.cxx 164 0x7fe26870cb58 10 cppu::WeakAggComponentImplHelperBase::dispose implbase.cxx 230 0x7fe2a1c755e3 11 cppu::WeakAggComponentImplHelperBase::release implbase.cxx 204 0x7fe2a1c75312 12 cppu::WeakAggComponentImplHelper6<com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleContext, com::sun::star::accessibility::XAccessibleComponent, com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::accessibility::XAccessibleText, com::sun::star::lang::XServiceInfo>::release compbase6.hxx 142 0x7fe26870fc0c 13 com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>::~Reference Reference.hxx 114 0x7fe28f2428a7 14 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 0x7fe28f262cf9 15 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 0x7fe28f262dd0 16 QAccessibleCache::deleteInterface qaccessiblecache.cpp 173 0x7fe28e0c8e4b 17 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 31 0x7fe28e0c845c 18 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 32 0x7fe28e0c84e2 19 cleanupAccessibleCache qaccessiblecache.cpp 24 0x7fe28e0c83c8 20 qt_call_post_routines qcoreapplication.cpp 327 0x7fe28e9a4593 21 QApplication::~QApplication qapplication.cpp 663 0x7fe28cf9dff6 22 QApplication::~QApplication qapplication.cpp 717 0x7fe28cf9e2f4 23 std::default_delete<QApplication>::operator() unique_ptr.h 99 0x7fe28f2cf3ae 24 std::__uniq_ptr_impl<QApplication, std::default_delete<QApplication>>::reset unique_ptr.h 211 0x7fe28f2cf7f6 25 std::unique_ptr<QApplication, std::default_delete<QApplication>>::reset unique_ptr.h 509 0x7fe28f2cd72d 26 QtInstance::~QtInstance QtInstance.cxx 273 0x7fe28f2c614f 27 QtInstance::~QtInstance QtInstance.cxx 274 0x7fe28f2c6226 28 DestroySalInstance salplug.cxx 389 0x7fe299a62611 29 DeInitVCL svmain.cxx 600 0x7fe299b41226 30 ImplSVMain svmain.cxx 229 0x7fe299b3f9f7 31 SVMain svmain.cxx 236 0x7fe299b3fa53 32 soffice_main sofficemain.cxx 94 0x7fe2a30a1b5d 33 sal_main main.c 51 0x55c86565c9d4 34 main main.c 49 0x55c86565c9ba Change-Id: I42ddcf5501ddfb363aeae10a86f1c38251e6793b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156522 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-04tdf#157088 a11y: No need to use WeakReference for list childrenMichael Weghorn
`VCLXAccessibleList` is the owner of the `VCLXAccessibleListItem`s held in that vector, so I see no reason to hold them by weak reference, which according to the doc in `udkapi/com/sun/star/uno/XWeak.idl` is to avoid affecting the lifetime of the objects: > <p>The sense of weak references is to hold a reference to an object > without affecting the lifetime of the object. That means that a weak > reference may become invalid, at any time, if the referenced object dies. > </p> Quite the contrary, it is actually responsible for the lifecycle of the list item a11y objects and should dispose them when itself gets disposed, which will be added in a subsequent commit. Change-Id: I57fe3367f1199cd0c24f006f6e25a1e9c930c154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156521 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-01accessibility: fix crash in getAccessibleActionDescriptionXisco Fauli
See https://crashreport.libreoffice.org/stats/signature/SvTreeListEntry::HasChildren() Change-Id: I21879ad531a5c61b3a6808c373454522557e2ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156403 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-01tdf#104833 a11y Send name changed event for text controlsMichael Weghorn
The text is at least often used for the accessible name of text controls (e.g. the MultiLineEdit case in tdf#104833). Therefore, also check whether the a11y name has changed from the previously remembered one in `VCLXAccessibleTextComponent::SetText` and send a NAME_CHANGED event if it has. This e.g. makes sure that the a11y name for the multi line edit in the update dialog is updated on Windows and NVDA properly announces it when it receives focus. (It now correctly announces "LibreOfficeDev 24.2 is up to date." instead of the obsolete cached name "Checking..."). Also see how `VCLXAccessibleTextComponent::ProcessWindowEvent` calls `VCLXAccessibleTextComponent::SetText` when processing `VclEventId::WindowFrameTitleChanged` and this comment in `Window::SetText` mentions that `VclEventId::WindowFrameTitleChanged` is used to notify about a11y name changes: // #107247# needed for accessibility // The VclEventId::WindowFrameTitleChanged is (mis)used to notify accessible name changes. // Therefore a window, which is labeled by this window, must also notify an accessible // name change. Change-Id: I2f15fe78324b14c3bbeae943cb87384007e21618 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156411 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-01tdf#104833 a11y: Use VCLXAccessibleEdit for VCLXMultiLineEditMichael Weghorn
Instead of the generic `VCLXAccessibleComponent`, use `VCLXAccessibleEdit` as a11y class for `VCLXMultiLineEdit` (the component interface class for MultiLineEdit) as well, not just for `VCLXEdit`. With the preparatory changes from Change-Id I8218db61feb07605f6ea5309f26eebd38312458a tdf#104833 a11y: Don't use VCLXEdit in VCLXAccessibleEdit in place, it behaves as expected when interacting with the multi line edit from the sample dialog in attachment 189287 in tdf#104833 using Accerciser and the qt6 or gtk3 VCL plugin (and the text can also be edited when removing the readonly flag from the control) or the update dialog (which uses UNO controls, `UnoControlEditModel` for the panes that were not announced, s. extensions/source/update/check/updatehdl.cxx ). In particular, the a11y text interface is supported by the multi line edit on the a11y layer, which makes Orca with the gtk3 VCL plugin announce the text content when the control gets focused. NVDA on Windows still announces "Checking..." instead of using the actual text that would be retrievable via the IAccessibleText interface now. This is probably because "Checking..." is the (outdated) accessible name, as can be seen by interacting with the object in NVDA's Python console: >>> focus.name 'Checking...' >>> txt = focus.IAccessibleTextObject >>> txt.text(0, txt.nCharacters) 'LibreOfficeDev 24.2 is up to date.' For both, gtk3 and qt6, the a11y object does have the new text as a11y name as well, as can be verified in Accerciser: In [10]: acc.name Out[10]: 'LibreOfficeDev 24.2 is up to date.' In [11]: txt = acc.queryText() In [12]: txt.getTextAtOffset(0,3) Out[12]: ('LibreOfficeDev 24.2 is up to date.', 0, 34) Change-Id: Id80e191cdd5342b3215fdb9d2ad3847470366337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156402 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-09-01tdf#104833 a11y: Don't use VCLXEdit in VCLXAccessibleEditMichael Weghorn
Don't rely on the `VCLXWindow` of the control being a `VCLXEdit`, but use the `Edit` control directly, as is already done in other methods of this class. This is in preparation of using `VCLXAccessibleEdit` as the a11y class for `MultiLineEdit` as well, which derives from `Edit`, but its component interface class, `VCLXMultiLineEdit` does not derive from `VCLXEdit`. Already add reporting of the `AccessibleStateType::MULTI_LINE` state instead of `AccessibleStateType::SINGLE_LINE` to `VCLXAccessibleTextComponent::FillAccessibleStateSet` if the window type is `WindowType::MULTILINEEDIT`. Add a small helper function, `VCLXAccessibleEdit::isEditable` to use instead of `VCLXEdit::isEditable`, which does the same. Interacting with the single line edit from the sample dialog in attachment 189287 in tdf#104833 in Accerciser still behaves as expected (and the text can still be edited when removing the readonly flag from the control). Change-Id: I8218db61feb07605f6ea5309f26eebd38312458a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156400 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-31a11y: Re-add check for empty reference in VCLXAccessibleTabControlMichael Weghorn
It got lost with commit a3f77a61c03340b79930e89d5c4045d814b93edf Date: Wed Aug 30 14:43:18 2023 +0200 use concrete type for VCLXAccessibleTabControl::m_aAccessibleChildren and resulted in a crash when e.g. doing the following with the qt6 VCL plugin on Linux: 1) open attachment 189287 from tdf#104833 2) "Tools" -> "Macros" -> "Organize Dialogs" 3) select the dialog from the doc 4) select "Edit" Change-Id: I2c4aea951976738c575943a64d01eaac2766fdd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156343 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-31use concrete type for AccessibleTabBarPageList::m_aAccessibleChildrenNoel Grandin
avoid some unnecessary casting Change-Id: Ib8bddff9fe91afd192584fa1ad2728d0701f425a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156316 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-31use concrete type for OAccessibleMenuBaseComponent::m_aAccessibleChildrenNoel Grandin
avoid some unnecessary casting Change-Id: Iaa9ce18d7a0772d894ec8f93e16f4f59ffaae77d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156315 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-31use concrete type for VCLXAccessibleStatusBar::m_aAccessibleChildrenNoel Grandin
avoid some unnecessary casting Change-Id: Id9e52b0b6dd8dc2cedc8b9cf80c17f1cf4afe502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156314 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30use concrete type for VCLXAccessibleTabControl::m_aAccessibleChildrenNoel Grandin
avoid some unnecessary casting Change-Id: I2f6ed71fbffbcdfad18ed03dd45c12ea1f52fff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30use concrete type for ToolBoxItemsMapNoel Grandin
avoid some unnecessary casting Change-Id: I582144f0654837ac8864679b38c3d2676d1089b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156290 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30make IAccessibleBrowseBox extend cppu::WeakImplHelperNoel Grandin
i.e. push this up from the implementation class AccessibleBrowseBoxAccess to the interface class. Which means we don't need the getMyself helper method, and make the memory management simpler. Change-Id: Icecb83834bb3f5304908bbd3682b3d2ea06dbfe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156285 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30make IAccessibleTableControl extend cppu::WeakImplHelperNoel Grandin
i.e. push this up from the implementation class AccessibleGridControlAccess to the interface class. Which means we don't need the getMyself helper method, and make the memory management simpler. Change-Id: Iced5f259638531a74ce86876d1a295e105530474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156284 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30a11y: Hold focused list box entry by rtl::ReferenceMichael Weghorn
Use an `rtl::Reference<AccessibleListBoxEntry>` for the currently focused entry instead of using a `css::uno::Reference<css::accessibility::XAccessible>` and casting almost every time that it's used. Change-Id: Ia3aeca18e61d82b127bf19dd0902d781168b93d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156281 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-23tdf#99609 tdf#156473 a11y: Check whether row header existsMichael Weghorn
Don't allow using `BBINDEX_ROWHEADERBAR` as the child index unconditionally, but only if the browse box actually has a row header. An `AccessibleTabListBox` doesn't have a header and instead returns the table when requesting the child at index 1 (`BBINDEX_ROWHEADERBAR`). Now that row headers are propagated to the Windows platform accessibility layer with commit 2b30d37bd555188733a006e1a5796461ab11d326 Date: Thu Aug 3 15:48:48 2023 +0100 tdf#156473 wina11y: Fix invalid write due to row/col mismatch in place, NVDA confusingly started announcing all cells in the currently selected row as row headers for the currently selected cell in the Expert Configuration dialog, because of the table being returned without this change in place (while the cells in that table don't actually have any row headers). Related backtrace of how the table was returned for the row headers: 1 accessibility::AccessibleTabListBox::getAccessibleChild accessibletablistbox.cxx 90 0x7fffb8ab64bb 2 accessibility::AccessibleBrowseBoxTable::implGetHeaderBar AccessibleBrowseBoxTable.cxx 214 0x7fffb8a7e241 3 accessibility::AccessibleBrowseBoxTable::getAccessibleRowHeaders AccessibleBrowseBoxTable.cxx 116 0x7fffb8a7da02 4 QtAccessibleWidget::rowHeaderCells QtAccessibleWidget.cxx 1808 0x7fffe3e51e97 5 AtSpiAdaptor::tableCellInterface atspiadaptor.cpp 2801 0x7fffe2cee526 6 AtSpiAdaptor::handleMessage atspiadaptor.cpp 1450 0x7fffe2cde6ee 7 QDBusConnectionPrivate::activateObject qdbusintegrator.cpp 1416 0x7fffe14cc216 8 QDBusActivateObjectEvent::placeMetaCall qdbusintegrator.cpp 1572 0x7fffe14cceba 9 QObject::event qobject.cpp 1438 0x7fffe3621280 10 QApplicationPrivate::notify_helper qapplication.cpp 3287 0x7fffe1ba2414 11 QApplication::notify qapplication.cpp 3238 0x7fffe1ba2224 12 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1123 0x7fffe35a3c34 13 QCoreApplication::sendEvent qcoreapplication.cpp 1557 0x7fffe35a46f5 14 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1924 0x7fffe35a55b2 15 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1781 0x7fffe35a4eba 16 postEventSourceDispatch qeventdispatcher_glib.cpp 240 0x7fffe39b26d3 17 ?? 0x7fffe97135b4 18 ?? 0x7fffe9716607 19 g_main_context_iteration 0x7fffe9716bfc 20 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 390 0x7fffe39b2f67 ... <More> Also add an assert that `AccessibleBrowseBoxTable::implGetHeaderBar` only gets called with indices for row/col header, not arbitrary integers. Change-Id: Id7ebab9bfa8a7f05cb43da1bf5756e5980f4ed20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156012 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-23a11y: Simplify AccessibleBrowseBox::implGetHeaderBarMichael Weghorn
Use the `mxColumnHeaderBar` and `mxRowHeaderBar` members directly instead of a pointer to an `rtl::Reference` that can be either of them. Change-Id: I620c7ba92a14fad50d9371b1762b5d5ad05fd7ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156011 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-23a11y: Make AccessibleBrowseBoxBase's client ID privateMichael Weghorn
The getter and setter are only used by the class itself, not by any derived classes, and the client ID is an implementation detail, so make the methods private instead of protected. Change-Id: I380aa9848ae515b7b4ae1a727b3c5720b53250fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156010 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-19loplugin: new global analysis locking2Noel Grandin
look for methods where we don't need to guard access to the field, because the field is never modified Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18tdf#156561 a11y: Don't ignore child events in AccessibleListBoxMichael Weghorn
Don't ignore the `WindowShow` and `WindowHide` child events in `AccessibleListBox::ProcessWindowChildEvent`, but let the base class implemenation handle them just like all other child events. This causes them to be forwarded as `AccessibleEventId::CHILD` events to the a11y layer, which e.g. triggers registering a11y event listeners for newly created/shown child objects in winaccessibility. This makes the announcement of sub menu entries in Calc's auto filter work even after reverting commit dc0706cabfe39ddb6ea23d60ccfb756f2b9e6efb Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Mar 15 17:00:27 2023 +0100 tdf#140762 tdf#152671 Make dock win visible before showing popup , which will be done in a follow-up commit. `AccessibleListBox` is the a11y class used for tree views in the non-gtk case (i.e. `SalInstanceTreeView`). A tree view is passed as the parent of the sub menus in the autofilter popup (s. `ScCheckListMenuControl::addSubMenuItem`), but due to ignoring the events, the submenu would not be announced by NVDA before the above-mentioned commit. The events were ignored since commit 4c01898e02d7b80f70f19de12f2598644fc421e3 Author: Vladimir Glazounov <vg@openoffice.org> Date: Mon Jan 28 13:14:03 2008 +0000 INTEGRATION: CWS tbe32 (1.2.16); FILE MERGED 2007/11/05 15:14:07 tbe 1.2.16.1: #i70908# [A11y] OOo crashes in Customize dialog - Add when large icons and A11y ONcommit 4c01898e02d7b80f70f19de12f2598644fc421e3 to fix a crash in the customization dialog, but that problem described in [1] is no longer reproducible for me with the change here in place. Comment 8 in the ticket mentions: > The problem was the accessible child event, which was sent for the > help text window. This event triggered some callbacks which caused > the dead lock. As the help text window is not exposed as accessible > child of the tree list box, I removed the accessible child event. The fact that extra children from the `vcl::Window` hierarchy (besides the entries in the `SvTreeListBox` are currently not exposed via `AccessibleListBox::getAccessibleChildCount` and `AccessibleListBox::getAccessibleChild` is still true, but not a problem in this context. (If necessary, handling for those should be easy to add by forwarding to the corresponding `VCLXAccessibleComponent` methods, and adapting the child index used as needed.) [1] https://bz.apache.org/ooo/show_bug.cgi?id=70908 [2] https://bz.apache.org/ooo/show_bug.cgi?id=70908#c8 Change-Id: If374032387babf41b28067d5df54d5f6ce682c48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155801 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-03tdf#156473 a11y: Implement AccessibleGridControlHeader::getAccessibleCellAtMichael Weghorn
With this in place, selecting a grid control cell from the tdf#156473 example in Accerciser's treeview of the LO a11y hierarchy now shows a corresponding row and header cell. Change-Id: I89978051cdb285a02cbce7a560a788b6d24ca7ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155251 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-03tdf#156473 a11y: Use actual row/col index/count in grid control headerMichael Weghorn
The row header bar of a grid control is a table with just one column, containing a row header cell for each of the rows in the table holding the actual data. Likewise, a column header bar just has one row. This was previously incorrectly reported on the a11y layer, as could e.g. be seen in Accerciser with the sample macro from tdf#156473. Also make the `AccessibleGridControlCell` ctor pass the `_nColumnRowId` as what it actually is (a row index in case of a row header cell, a column index in case of a column header cell) instead of always as a row index, and then having special handling for that elsewhere again (s. `AccessibleGridControlCell::getAccessibleName`). Also move an assert from `AccessibleGridControlCell::getAccessibleName` to the ctor and check the indices there. With this in place, the row and column header bars for the example from tdf#156473 now report the correct amount of rows and columns, and the row/column header cells report the correct row and column indices. Change-Id: I29f71ac46b6d841e26d68ca01bd05ba9412aed13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155224 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-02a11y: Convert AccessibleTableControlObjType to enum classMichael Weghorn
Change-Id: I227ca242ae8fa22940b1bf302541f8d9b7b40eb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155199 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-02tdf#156473 a11y: Properly retrireve a11y context from XAccessibleMichael Weghorn
... by using `XAccessible::getAccessibleContext` rather than trying to just query for the `XAccessibleContext` interface on the `XAccessible` object. (While in many cases, the class implementing both interfaces is the same, that doesn't have to be the case.) Change-Id: I281082672447c7bfd2812d7f3cd54c74414df66e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155193 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-02tdf#156473 a11y: Don't use selection index as child indexMichael Weghorn
`XAccessibleSelection::getSelectedAccessibleChild` takes the index into the selection, not the child index, as its documentation (in `offapi/com/sun/star/accessibility/XAccessibleSelection.idl`) says: > @param nSelectedChildIndex > This index refers only to the selected children, not to all the > children of this object. Even if all children are selected, the > indices enumerating the selected children need not be the same > as those enumerating all children. If only single selection is > supported the only valid value is 0. The previous handling here in `AccessibleGridControlTable::getSelectedAccessibleChild` was treating it as the child index, though. Therefore trying to get the selected children would break once any row other than the first was selected. Fix this by calculating the actual row/column index of the cell from the given *selection* index. This could be observed e.g. with the qt6 VCL plugin by querying selection from Accerciser, with the last row selected in the table from the tdf#156473 macro in LO and the corresponding table object selected in Accerciser's tree view of the LO a11y hierarchy: Before: In [41]: sel = acc.querySelection() In [42]: sel.nSelectedChildren Out[42]: 5 In [43]: sel.getSelectedChild(0) In [44]: sel.getSelectedChild(0) == None Out[44]: True With the fix in place: In [48]: sel = acc.querySelection() In [49]: sel.nSelectedChildren Out[49]: 5 In [50]: sel.getSelectedChild(0) Out[50]: <Atspi.Accessible object at 0x7fcaeaddb900 (AtspiAccessible at 0x3ae4a80)> In [51]: sel.getSelectedChild(0).name Out[51]: 'C1 , R4 , ' In [52]: sel.getSelectedChild(1).name Out[52]: 'C2 , R4 , ' In [53]: sel.getSelectedChild(4).name Out[53]: 'Column 5 , R4 , ' Change-Id: Id7d42a89b913d2ed101a9edb45dee5f3d870dbbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155190 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-07-27tdf#155625 a11y: Notify about menu item role changeMichael Weghorn
Send a `AccessibleEventId::ROLE_CHANGED` event when the accessible role of a menu item changes (s. how `VCLXAccessibleMenuItem::getAccessibleRole` takes into account `MenuItemBits::RADIOCHECK` and `MenuItemBits::CHECKABLE` to determine the accessible role for the underlying menu entry). This fixes the issue of obsolete values for roles being used, which was uncovered by the upcoming Change-Id I1a047864ce8dc1f1bc3056ad00159f7fd5e5b7d3 ("vcl gtk3: Introduce AT-SPI2 tests for the GTK3 accessibility layer"). With this in place, the workaround for tdf#155625 in the upcoming gtk3/AT-SPI tests is no longer necessary and `make CppunitTest_vcl_gtk3_a11y` with https://gerrit.libreoffice.org/c/core/+/153069 patch set 11 still passes after dropping the workaround: diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx index bbcd263fee0c..762401181bf4 100644 --- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx +++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx @@ -264,9 +264,6 @@ void Atspi2TestTree::compareObjects(uno::Reference<accessibility::XAccessible> x * be represented with a round trip. */ const auto nLORole = mapToAtspiRole(xLOContext->getAccessibleRole()); auto nAtspiRole = pAtspiAccessible.getRole(); - // FIXME: workaround for https://bugs.documentfoundation.org/show_bug.cgi?id=155625 - if (nLORole == ATSPI_ROLE_CHECK_MENU_ITEM && nAtspiRole == ATSPI_ROLE_MENU_ITEM) - nAtspiRole = nLORole; CPPUNIT_ASSERT_EQUAL(nLORole, nAtspiRole); /* name (no need to worry about debugging suffixes as AccessibilityTools::nameEquals does, as * that will also be part of the name sent to ATSPI) */ Change-Id: I0d88a7eda592f5ee9abf368ce1d5feb6611b9971 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154947 Reviewed-by: Colomban Wendling <cwendling@hypra.fr> Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-07-27rename GetFieldRectPixelAbs to GetFieldRectPixelNoel Grandin
since it can return either absolute or relative values Change-Id: I23f2403879eded3ec4b3ca20a639ea18b28f5de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>