summaryrefslogtreecommitdiff
path: root/accessibility/inc
AgeCommit message (Collapse)Author
2024-08-27cid#1608497 Double lockCaolán McNamara
Change-Id: Idacac84614411efe7516de9aa7740d7d47863ad7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172438 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-23loplugin:unusedmethodsNoel Grandin
Change-Id: I1863f86f064f02c7e37425ff6c74e7b370460295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170896 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-12icon choice ctrl entry a11y: Use OAccessibleComponentHelper as baseMichael Weghorn
Let `AccessibleIconChoiceCtrlEntry` derive from `comphelper::OAccessibleComponentHelper` which allows simplifying the class. It just requires implementing the virtual `implGetBounds()` method and provides implementations for the the other location/size-related methods using that, so drop the custom implementations doing the same. This also makes it unnecessary to implement the `XAccessibleEventBroadcaster` methods ourselves, so drop the custom handling and `AccessibleIconChoiceCtrlEntry::m_nClientId` altogether as well. Change-Id: Iaa14293a911ea7b199a21baf8c5c3cfb5075efcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170380 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-07-11Unify/Port to use VCLUnoHelper for AWT <-> VCL conversionsMichael Weghorn
Following Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Jul 10 14:49:03 2024 +0200 VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl , port all uses of the helper functions defined in `include/toolkit/helper/convert.hxx` to use the `VCLUnoHelper` equivalents instead, to unify usage and avoid duplication. Drop `include/toolkit/helper/convert.hxx` now that it's unused. Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-05-24a11y: Rename m_aAccessibleChildren1 -> m_aAccessibleChildrenMichael Weghorn
Was previously changed the other way around in commit 28c89e58d90ea73513e273db274eb46ff9081c35 Date: Wed Aug 30 15:16:01 2023 +0200 use concrete type for OAccessibleMenuBaseComponent::m_aAccessibleChildren for no apparent reason. Change-Id: I0d0c6627134bcef8ac9732cc8a5213ab266afbf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168005 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-05-24a11y: Drop AccessibleChildren typedefMichael Weghorn
... which is only used in the next line anyway. Change-Id: I3bb038cfba3b3b31df45ca316242d54442db7220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168004 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-05-10tdf#160971 a11y: Send full text on changed combobox textMichael Weghorn
When the text of an editable combobox is changed (e.g. using the up/down keys), the Orca screen reader on Linux announces the newly inserted text. This has been the case for other GTK or Qt applications for a while, and with recent Orca commit [1] commit 3a9e6b8d7b16bf2fc7919868cfd1a16e44422710 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Fri May 10 10:16:58 2024 +0200 soffice: Use default logic for editable combobox value change , the same logic is used for LibreOffice as well. For the gtk3 VCL plugin which has a custom combobox implementation using native GTK widgets, this generally works since commit 9f078ed7b625e86182d64d5ccfbb410cdd38081c Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue May 7 10:04:16 2024 +0200 tdf#160971 gtk3 a11y: Set role for custom editable combobox However, the qt6 VCL plugin uses the VCL combobox implementation, and only the actual difference between the text of the previous and current entry was sent in the TEXT_CHANGED event, resulting in Orca only announcing those letters that were added/changed, e.g. just "ans Narrow" when changing the font in the Writer formatting toolbar from "Liberation Serif" to "Liberation Sans Narrow". This doesn't really make clear what entry is selected. Align the a11y event with what GTK and Qt do and set the full old and new entry texts in the event. To do that, add a new virtual `VCLXAccessibleTextComponent:PreferFullTextInTextChangedEvent` that defaults to false to keep the previous behavior as default, and override it for `VCLXAccessibleEdit` to return true in the case that the edit is the subedit of a combobox (the parent has a combobox role). Use this in `VCLXAccessibleTextComponent::SetText` to determine whether to notify just of the changed characters or to send the whole old/new text. With this in place, Orca also announces the whole new entry text (e.g. "Liberation Sans Narrow" for the above example) when using the qt6 VCL plugin. (It currently additionally announces an extra "Selection deleted" when switching entries, as the text selection also changes, but that aspect is to be handled separate from this change here.) [1] https://gitlab.gnome.org/GNOME/orca/-/commit/3a9e6b8d7b16bf2fc7919868cfd1a16e44422710 Change-Id: I240aa0ad5ac9585e007d67a8c69e305cf1f38185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167479 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-05-07a11y: Drop AccessibleChildren typedefMichael Weghorn
Change-Id: I13946bb4a991dceeb26a0a9364f6067397b94001 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167197 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-03-28convert VCLXAccessibleListItem to comphelper::WeakComponentImplHelperNoel Grandin
Change-Id: I82b7dd9b0cdf379c710870a295c8f33ed9fff681 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-28tdf#159910 a11y: Dispose VCLXAccessibleList childrenMichael Weghorn
In `VCLXAccessibleList::HandleChangedItemList`, don't just clear the vector of list items, but dispose them first. To avoid code duplication, extract a helper method from `VCLXAccessibleList::disposing` which already disposes the children since commit 51de048ae97cbd371457dbc07120e30db9ee4187 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Sep 4 17:19:03 2023 +0200 tdf#157088 a11y: Dispose list items with list This fixes a similar crash/assert on exit, seen after using the Navigator in Writer (in particular the combo/listboxes in there) with the qt6 VCL plugin and the Orca screen reader running. stderr showed this: soffice.bin: .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:142: bool (anonymous namespace)::implLookupClient(const AccessibleEventNotifier::TClientId, ClientMap::iterator &): Assertion `rClients.end() != rPos && "AccessibleEventNotifier::implLookupClient: invalid client id " "(did you register your client?)!"' failed. Aborted Backtrace: 1 __pthread_kill_implementation pthread_kill.c 44 0x7f0e1a4a816c 2 __pthread_kill_internal pthread_kill.c 78 0x7f0e1a4a81cf 3 __GI_raise raise.c 26 0x7f0e1a45a472 4 __GI_abort abort.c 79 0x7f0e1a4444b2 5 __assert_fail_base assert.c 92 0x7f0e1a4443d5 6 __assert_fail assert.c 101 0x7f0e1a4533a2 7 (anonymous namespace)::implLookupClient accessibleeventnotifier.cxx 140 0x7f0e18ce59ac 8 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing accessibleeventnotifier.cxx 185 0x7f0e18ce5e68 9 VCLXAccessibleListItem::disposing vclxaccessiblelistitem.cxx 164 0x7f0ddf7d237f 10 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 0x7f0e1873f544 11 cppu::PartialWeakComponentImplHelper<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>::dispose compbase.hxx 90 0x7f0ddf7cb7c5 12 cppu::WeakComponentImplHelperBase::release implbase.cxx 79 0x7f0e1873f1fe 13 cppu::PartialWeakComponentImplHelper<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 compbase.hxx 86 0x7f0ddf7cd0c5 14 com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>::~Reference Reference.hxx 114 0x7f0e06bbccbe 15 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 0x7f0e06bd618d 16 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 0x7f0e06bd6219 17 QAccessibleCache::deleteInterface qaccessiblecache.cpp 173 0x7f0e05545319 18 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 31 0x7f0e0554492a 19 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 32 0x7f0e055449b0 20 cleanupAccessibleCache qaccessiblecache.cpp 24 0x7f0e05544896 21 qt_call_post_routines qcoreapplication.cpp 332 0x7f0e05faf826 22 QApplication::~QApplication qapplication.cpp 665 0x7f0e0419e24a 23 QApplication::~QApplication qapplication.cpp 722 0x7f0e0419e55c 24 std::default_delete<QApplication>::operator() unique_ptr.h 99 0x7f0e06c5d63c 25 std::__uniq_ptr_impl<QApplication, std::default_delete<QApplication>>::reset unique_ptr.h 211 0x7f0e06c5df7c 26 std::unique_ptr<QApplication, std::default_delete<QApplication>>::reset unique_ptr.h 509 0x7f0e06c58bfd 27 QtInstance::~QtInstance QtInstance.cxx 305 0x7f0e06c51184 28 QtInstance::~QtInstance QtInstance.cxx 302 0x7f0e06c51279 29 DestroySalInstance salplug.cxx 368 0x7f0e114c0a18 30 DeInitVCL svmain.cxx 625 0x7f0e115c5e7d 31 ImplSVMain svmain.cxx 254 0x7f0e115c4031 32 SVMain svmain.cxx 261 0x7f0e115c5f79 33 soffice_main sofficemain.cxx 94 0x7f0e1a7a4ba3 34 sal_main main.c 51 0x559ce9c67a5d 35 main main.c 49 0x559ce9c67a37 Change-Id: Ic5121645a6920a8ac35154dda1dcfa1974ab9d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164062 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-02-26a11y: Drop some AccessibleTextHelper_BASE typedefsMichael Weghorn
Just use `comphelper::OAccessibleTextHelper` directly where `AccessibleTextHelper_BASE` is a typedef for that. There are other `AccessibleTextHelper_BASE` typedefs with a different meaning elsewhere in the codebase, which are left unchanged. Change-Id: I323a2b103eccfcfc4f726caffa73e586decf6d65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163960 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-02-26tdf#159910 a11y: Distinguish a11y name and text of toolbar itemMichael Weghorn
So far, the accessible name and the text of the item were considered to be the same, and fallbacks to still get something else for the accessible name in case of no item text (to use the quick help text or the item window's accessible name instead) were implemented directly in `VCLXAccessibleToolBoxItem::implGetText`. However, `VCLXAccessibleToolBoxItem::implGetText` is also used by the implementations for the methods from the `XAccessibleText` interface and that one is clearly about text displayed on screen, so using e.g. the quick help/tooltip text doesn't make sense then. Let `VCLXAccessibleToolBoxItem::implGetText` only handle the actual item text and move the fallbacks to a new helper method `VCLXAccessibleToolBoxItem::implGetAccessibleName` instead that is only used when the actual accessible name is wanted. Change-Id: Icc394022d036ca619622cee1390e28ab15014be1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163959 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-02-26tdf#159910 a11y: Merge VCLXAccessibleToolBoxItem::{,impl}GetTextMichael Weghorn
`VCLXAccessibleToolBoxItem::implGetText` was just calling `VCLXAccessibleToolBoxItem::GetText`, and both of them were used from different places. Just move the implementation to `VCLXAccessibleToolBoxItem::implGetText` right away, drop `VCLXAccessibleToolBoxItem::implGetText` and adjust callers to unify this. Change-Id: I0f4a4652f9e1259826a566d42b4b6998fc8ac7db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163958 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-01-15loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I14ee125874b6f0f1ff5406a3eafea0b19df1a7f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-19tdf#123864 a11y: Handle new checkable state for VCLXAccessibleMenuItemMichael Weghorn
Add reporting for the new CHECKABLE a11y state introduced in commit d6c6472bbe1c90b733a4d69c4c8528f4de3750d3 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Nov 13 15:53:44 2023 +0100 tdf#123864 a11y: Add new AccessibleStateType::CHECKABLE for `VCLXAccessibleMenuItem`. `MenuItemData::HasCheck` looks like it already provides what's needed to say whether an item is checkable, therefore add a `Menu::IsItemCheckable` that makes use of this and and a `VCLXAccessibleMenuItem::IsCheckable` that makes use of that in turn. Extend `VCLXAccessibleMenuItem::FillAccessibleStateSet` to use the latter to report the CHECKABLE state accordingly. Change-Id: Id23196ef2527a71a338102a5143a8bd6fd41db84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160902 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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-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-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: 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-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: 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-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-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-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: 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-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-23vcl: Drop now unneeded DevicePoint typedefKhaled Hosny
It has been always typedef'd to basegfx::B2DPoint since: commit 5e218b5c51f7d9cd10bd9db832879efca41b9c75 Date: Wed Jan 12 21:19:32 2022 +0000 always use B2DPoint for DevicePoint Change-Id: I9f5202d5a71c77dd79f1759923917c26bf68a9af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154632 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-21tdf#99609 a11y: Set proper parent for cells in tab list boxMichael Weghorn
The a11y tree was broken: While the table has the cells as children, the cells did not have the table set as parent, but the table's header. Since the IAccessibleTableCell implementation in winaccessibility relies on the table being set as the parent, this wouldn't work when moving around within the tree view in the Expert Configuration dialog. Fix this by setting the table as parent. The issue could also be observed with the qt6 VCL plugin on Linux and Accerciser. With the table selected in Accerciser's tree view of the a11y hierarchy, the incorrect hierarchy could be seen using this in Accerciser's IPython console. In [8]: acc.childCount Out[8]: 48 In [9]: acc.get_child_at_index(4).name Out[9]: 'Migration' In [10]: acc.get_child_at_index(4).parent == acc Out[10]: False In [11]: acc.get_child_at_index(4).parent.childCount Out[11]: 4 With the fix in place, the table's child's parent is now the table again as expected: In [13]: acc.childCount Out[13]: 48 In [14]: acc.get_child_at_index(4).name Out[14]: 'Migration' In [15]: acc.get_child_at_index(4).parent == acc Out[15]: True In [16]: acc.get_child_at_index(4).parent.childCount Out[16]: 48 NVDA on Windows now announces *something* when moving between rows in the Expert Configuration dialog, but it's not the correct row yet. (That looks like another issue in winaccessibility code that needs to be fixed separately.) Change-Id: I400fa9811bb297ea7fd1accb0970811cdf11a119 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154670 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>