summaryrefslogtreecommitdiff
path: root/svx/source/accessibility
AgeCommit message (Collapse)Author
2024-12-12a11y: Move OCommonAccessibleComponent::m_aCreator to subclassMichael Weghorn
Move this member holding a weak reference to the XAccessible that created the context to the OAccessibleControlContext subclass, which is the only one making use of it now after previous commit Change-Id: I29fb7cd42512a02fc1cc56835bb83f847e9ec0fd Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Dec 12 11:08:54 2024 +0100 tdf#164294 a11y: Don't rely on "creator" to determine child index This also removes the need to call OCommonAccessibleComponent::lateInit in those subclasses that did so previously. Change-Id: I3edd14810feb6c884b4e67db1f76b40ae003dffa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178355 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-12-04Move helpers for css::awt/VCL point/rect/size to vcl::unohelperMichael Weghorn
Move helpers to convert between the Rectangle, Point and Size classes in vcl and in css::awt from VCLUnoHelper (in the toolkit module) to vcl::unohelper (in the vcl module), for reuse in vcl in upcoming commits. Change-Id: I7b11c8a6b8c843a01ce25b1e4c0fb1869ad1e6ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177816 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-02cid#1606759 Data race conditionCaolán McNamara
Change-Id: I1357972c5ca8c6441533f15423134707efd36e33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177684 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-11-24Let ESelection use EPaM for simplificationMike Kaganski
And drop EPosition, which duplicates EPaM, except for its default ctor (used in a single place). Change-Id: I48bb6dafcba84465d61579df0ec71b815945532a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177075 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-11-22tdf#163598 editeng: avoid using fake outline depthJustin Luth
Most implementations do not actually do anything meaningful with Get/SetDepth, so don't exception or accept their values. To fix the bug, I could have just checked for dynamic_cast<SvxEditEngineForwarder*> (since it supports EE_PARA_OUTLLEVEL directly) but this way seemed more encompassing. The potential downside is that EE_PARA_OUTLLEVEL will be requested as a real property after GetPropertyValueHelper with some of these dummy providers, and who knows what UNO might do about that... IF this patch causes problems, then I need to implement Get/SetDepth in SvxEditEngineForwarder (or consider the dummy providers as SupportsOutlineDepth). Change-Id: I74bf5e39a13bb1d588c39634347eb0982bda66b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176981 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-11-12loplugin:reftotemp in svxNoel Grandin
Change-Id: Ie5f9a7f0e6903476bd02391a71c1f3d75afaf09f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-07[API CHANGE] a11y: Switch AccessibleRelationType to enumMichael Weghorn
Switch css::accessibility::AccessibleRelationType from integer constants to an enum. This provides more type safety and improves the debugging experience, e.g. GDB now prints com::sun::star::accessibility::AccessibleRelationType::AccessibleRelationType_CONTENT_FLOWS_TO instead of just "2" when printing the value of a corresponding variable, so it's no longer necessary to manually look up what constant has that integer value to know what relation this refers to. offapi/com/sun/star/accessibility/AccessibleRelationType.idl had this comment: > <p>We are using constants instead of a more typesafe enum. The reason > for this is that IDL enums may not be extended. Therefore, in order to > include future extensions to the set of roles we have to use constants > here.</p> However, the a11y UNO API is internal (not published), so that shouldn't be a concern. Change-Id: I44a7d56cb085dc24effb24fcd34bb222b78ef4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176153 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-06loplugin:passstuffbyref in svxNoel Grandin
Change-Id: Ic5fd72cb64208c278ffc129591cd3d1131efdc08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176137 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-14cid#1554844 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1554878 COPY_INSTEAD_OF_MOVE cid#1554907 COPY_INSTEAD_OF_MOVE cid#1555082 COPY_INSTEAD_OF_MOVE cid#1555224 COPY_INSTEAD_OF_MOVE cid#1555301 COPY_INSTEAD_OF_MOVE cid#1555378 COPY_INSTEAD_OF_MOVE cid#1555395 COPY_INSTEAD_OF_MOVE cid#1555452 COPY_INSTEAD_OF_MOVE cid#1555466 COPY_INSTEAD_OF_MOVE cid#1555514 COPY_INSTEAD_OF_MOVE cid#1555566 COPY_INSTEAD_OF_MOVE cid#1555753 COPY_INSTEAD_OF_MOVE cid#1555782 COPY_INSTEAD_OF_MOVE cid#1555825 COPY_INSTEAD_OF_MOVE cid#1555842 COPY_INSTEAD_OF_MOVE cid#1555891 COPY_INSTEAD_OF_MOVE cid#1555917 COPY_INSTEAD_OF_MOVE cid#1555961 COPY_INSTEAD_OF_MOVE cid#1556021 COPY_INSTEAD_OF_MOVE cid#1556055 COPY_INSTEAD_OF_MOVE cid#1556307 COPY_INSTEAD_OF_MOVE cid#1556349 COPY_INSTEAD_OF_MOVE cid#1556436 COPY_INSTEAD_OF_MOVE cid#1556665 COPY_INSTEAD_OF_MOVE cid#1556696 COPY_INSTEAD_OF_MOVE cid#1556718 COPY_INSTEAD_OF_MOVE cid#1556775 COPY_INSTEAD_OF_MOVE cid#1556835 COPY_INSTEAD_OF_MOVE cid#1556877 COPY_INSTEAD_OF_MOVE cid#1556994 COPY_INSTEAD_OF_MOVE cid#1557010 COPY_INSTEAD_OF_MOVE cid#1557074 COPY_INSTEAD_OF_MOVE cid#1557111 COPY_INSTEAD_OF_MOVE cid#1557142 COPY_INSTEAD_OF_MOVE cid#1557163 COPY_INSTEAD_OF_MOVE cid#1557164 COPY_INSTEAD_OF_MOVE cid#1557214 COPY_INSTEAD_OF_MOVE cid#1557254 COPY_INSTEAD_OF_MOVE cid#1557322 COPY_INSTEAD_OF_MOVE cid#1557327 COPY_INSTEAD_OF_MOVE cid#1557492 COPY_INSTEAD_OF_MOVE cid#1557565 COPY_INSTEAD_OF_MOVE cid#1557663 COPY_INSTEAD_OF_MOVE cid#1557798 COPY_INSTEAD_OF_MOVE Change-Id: I2ae9c184dcc18d44a65437e18c49e16b27f4d81d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174893 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-06-24editeng: add convenience creators to ESelection All, NotFoundTomaž Vajngerl
ESelection::All() select all text ESelection::NotFound() sets seletion to not found state ESelection::NoSelection() sets selection to no / invalid selection Introduce max paragraph and position constants in ESelection, use for EE_PARA_APPEND, EE_PARA_ALL, EE_PARA_MAX_COUNT, EE_TEXTPOS_ALL, EE_TEXTPOS_MAX_COUNT. Also simplify some ESelection constructs. Change-Id: Ib110c5a730a1deabe4f988baa5a600249b3a31e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169356 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2024-06-22fix O(n^2) behaviour when fetching field info from EditEngineNoel Grandin
Change-Id: I324a1814fc1b3321eed5b29922790600e7092c17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169344 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-11loplugin:ostr in svxNoel Grandin
Change-Id: Ia765a03e033acb82e367873380d289587ea87d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167449 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-02WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: I8edb1fefe1b2b8a3db3ee8f3a0eed59c7f08a36e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166863 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-04-24[API CHANGE] a11y: Use XAccessible for relation targetsMichael Weghorn
Use a Sequence of XAccessible rather than its base interface XInterface for AccessibleRelation's TargetSet. As the targets are accessible objects as well, anything other than XAccessible doesn't make much sense. Using XAccessible right away makes that clearer and avoids the need to query the XAccessible interface. (The winaccessibility bridge was already using `static_cast`, relying on the fact that the objects are XAccessibles.) The a11y UNO API is not published, so an API change should be unproblematic. Change-Id: I7f08e98d1ec303d5343d9a7954187cdd71495ebc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166586 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-02-16svx a11y: Drop AccessibleTextHelper_Impl::GotPropertyEventMichael Weghorn
Use `AccessibleTextHelper_Impl::FireEvent` directly instead, which is in my opinion more readable, in particular since 2 of the 3 uses were sending an `AccessibleEventId::CHILD` event, which is not really about any property. Change-Id: I446d2d7a841397b215bf099528920bcc6ee9f227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163428 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-24svx a11y: Notify listeners when disposing shapeMichael Weghorn
In `AccessibleShape::disposing`, call the same method of the base class, i.e. `AccessibleContextBase::disposing`, not `AccessibleContextBase::dispose`. The code was moved from `AccessibleShape::dispose` to `AccessibleShape::disposing` in commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63 Date: Tue Apr 30 13:30:10 2002 +0000 #95585# Moved code from dispose to disposing(). and it seems likely that adjusting the base class method to call was just forgotten/missed. This resulted in the accessible getting disposed without listeners getting notified (since `AccessibleContextBase::disposing` takes care of that). This resulted in a crash for the following scenario with the qt6 VCL plugin when the Orca screen reader is running: 1) start LO Writer 2) click on the "Basic shapes" toolbar button 3) click + drag to insert a shape into the document 4) click somewhere else Backtrace is below. `AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks whether the accessible is valid and returns early otherwise. But since listeners were not notified when the object got disposed, `QtAccessibleEventListener::disposing` wasn't called, which would have taken care of invalidating the `QtAccessibleWidget`, in which case this early return would have happened instead of the crash. This behaves as expected now with this commit in place. stderr output of the crash: terminate called after throwing an instance of 'com::sun::star::lang::DisposedException' Backtrace: Thread 1 received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44 44 ./nptl/pthread_kill.c: No such file or directory. (gdb) bt #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44 #1 0x00007f5bc1ca815f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78 #2 0x00007f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79 #4 0x00007f5bc18a09eb in () at /lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007f5bc18affca in () at /lib/x86_64-linux-gnu/libstdc++.so.6 #6 0x00007f5bc18b0035 in () at /lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007f5bc18b0288 in () at /lib/x86_64-linux-gnu/libstdc++.so.6 #8 0x00007f5bc02b4550 in accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494 #9 0x00007f5bbcf7d54e in accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at .../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280 #10 0x00007f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) const (this=0x55a6fad4fe20, text=QAccessible::Name) at .../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362 #11 0x00007f5bac5552d2 in AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, interface=0x55a6fad4fe20, function=..., message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545 #12 0x00007f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432 #13 0x00007f5baaa88943 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448 #14 0x00007f5baaa89628 in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604 #15 0x00007f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447 #16 0x00007f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298 #17 0x00007f5bab1a6797 in QApplication::notify(QObject*, QEvent*) (this=0x55a6f63bb840, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249 #18 0x00007f5bacfb0212 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55a6f769bce0, event=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138 #19 0x00007f5bacfb0dbb in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55a6f769bce0, event=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581 #20 0x00007f5bacfb2474 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55a6f6337df0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1936 #21 0x00007f5bacfb160e in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1770 #22 0x00007f5bad43441c in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55a6f642f710) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244 #23 0x00007f5bb47111f4 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #24 0x00007f5bb4714317 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #25 0x00007f5bb4714930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #26 0x00007f5bad434cb1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55a6f6435dc0, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394 #27 0x00007f5baa929e18 in QXcbGlibEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55a6f6435dc0, flags=...) at .../qt5/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:96 #28 0x00007f5badad8bea in QtInstance::ImplYield(bool, bool) (this=0x55a6f6442080, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:424 #29 0x00007f5badad8d13 in QtInstance::DoYield(bool, bool) (this=0x55a6f6442080, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:435 #30 0x00007f5bb8734af6 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:386 #31 0x00007f5bb8735894 in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:470 #32 0x00007f5bb87347e9 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:364 #33 0x00007f5bc1e36e66 in desktop::Desktop::Main() (this=0x7ffc62160570) at .../libreoffice/desktop/source/app/app.cxx:1614 #34 0x00007f5bb8753ca0 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229 #35 0x00007f5bb8753fb5 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261 #36 0x00007f5bc1ea4101 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94 #37 0x000055a6f46e19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51 #38 0x000055a6f46e19ba in main (argc=2, argv=0x7ffc62160798) at .../libreoffice/desktop/source/app/main.c:49 Change-Id: Iae8a9ff61df99094b4cd73da895d1f6ac850c0c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162493 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-12-30tdf#146619 Recheck svx/ with IWYUGabor Kelemen
Change-Id: I99650b50587294c20b1e92270e541140d9ec9cae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161240 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-08cid#1546501 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546486 COPY_INSTEAD_OF_MOVE cid#1546485 COPY_INSTEAD_OF_MOVE cid#1546484 COPY_INSTEAD_OF_MOVE cid#1546482 COPY_INSTEAD_OF_MOVE Change-Id: I53cc622f16afc0f57ffd72e3e0a6f18e390fbb83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160443 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-10tdf#158169 take no actions in disposed incarnationArmin Le Grand (allotropia)
Using the described steps in the bug report it is possible to have an already disposed incarnation of ChildrenManagerImpl that gets called with notifyEvent. If exposed it is necessary not to execute actions, but to inform the caller by triggering a lang::DisposedException(). The SfxBaseModel::notifyEvent that executes this will then remove the instance from it's list. Change-Id: Ie39e37d6e55ea66f441e732b612774b18d7c3ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159306 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-07tdf#135236 a11y: Notify a11y layer of WeldEditView sel changeMichael Weghorn
Extend `WeldEditView::EditViewSelectionChange` to not only invalidate the view, but also notify the `AccessibleTextHelper` of the selection update, so the corresponding events are sent on the a11y layer. This e.g. causes the `CARET_CHANGED` events to be sent as needed when moving the cursor/caret using the arrow keys in the "Not in dictionary" text edit in Writer's spelling dialog ("Tools" -> "Spelling"), so the Orca screen reader on Linux with the gtk3 or qt6 VCL plugin announces the new caret position, which was no longer the case since the spelling dialog was welded in commit 243b5b392906042ab03800e0b5765e6f3513372c Date: Fri Jun 14 21:56:44 2019 +0100 weld SpellDialog The newly added `AccessibleTextHelper::UpdateSelection` is a simplified version of `AccessibleTextHelper::UpdateChildren`. Change-Id: I5f0898c3ccb9fd527a6ff672be49157cb6e518b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158992 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-10-27lok: a11y: impress: help screen reader to report shape selectionMarco Cecchetti
Refactored LOKDocumentFocusListener::notifyEvent. Implemented 2 new callbacks: - LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if editing in a shape or cell is active or it isn't. - LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been selected/unselected, the name of the shape and text content are sent too for being reported by a screen reader. (cherry picked from commit 76899152ec3d1924cc72d2b869e197a1e34a0a1a) Conflicts: sfx2/source/view/viewsh.cxx Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158562 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-10-22lok: a11y: impress: screen reader support for text shape editingMarco Cecchetti
Now accessibility support can be enabled in Impress. Fixed an issue that prevented to receive accessibility event when a shape text content was edited. Some rectangles overlapping check is performed for excluding not visible shapes from the a11y tree Anyway client and core visible area can differ some shape was wrongly pruned from the a11y tree. The problem has been fixed by not performing the overlapping test in the LOK case: we already do the same for shape area invalidation. In order to avoid the screen reader to report no more focused paragraph we send an empty paragraph to clear the editable area when shape selection state changes. When shape ediding becomes active the text content of the shape is sent to the client. Change-Id: Ia9ee08d060162891725d26efd2aa36e47b38ed50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157525 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158329 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: svxStephan Bergmann
Change-Id: Ib5028b826a3f62303b9e0502af70ad62c578fbb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158240 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-31use concrete type for SvxShowCharSetAcc::m_aChildrenNoel Grandin
avoid some unnecessary casting Change-Id: I73338c00b90357fe939e38a53f87a4ef9f13e86c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156322 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-31use concrete type for SvxPixelCtlAccessible::m_xCurChildNoel Grandin
avoid some unnecessary casting Change-Id: I83ee8605052c8635b643f9c163b2b6b69b154884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-27svx : replace local function with OUStringLiteralArnaud VERSINI
Change-Id: Ica39cd5b6da3c97dd03aa9844e2dd8d99c279697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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-07-21tdf#152992: for Impress/Draw add horizontal hit tolerance for quick text editSarper Akdemir
Implements horizontal hit tolerance for quick text edit in Impress & Draw making it more forgiving. Previously it was required to click exactly on the glyph to get a direct text cursor. Refactors hittestprocessor2d so that it now supports pseudo per axis hit tolerance. i.e. underlying isInEpsilonRange hit check is still the same utilizing the larger tolerance of the two per axis tolerance, but the preliminary check that uses aPolygonRange.grow() and later aPolygonRange.isInside() now filters hit misses out with respect to the per axis hit tolerance. Utilizes hittestprocessor2d's new per axis tolerance to introduce hit tolerance for quick text edit, making it similar to TextEdit mode hit tolerance which only has horizontal tolerance. Fixes wrong use of BoundRect hit to determine text frame border hits. Which previously only made sense for TextFrame borders, and was mostly useless for shapes with text inside. Change-Id: I749e63752da05b01270bfcab2632c41879a848ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154640 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-29Use getXWeak in svxMike Kaganski
Change-Id: I7e5c029a79b8437ae5f803df5ad20217c240d1d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150874 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-16tdf#103064 sw,editeng: enable UNO API and ODF import/exportMaxim Monastirsky
Change-Id: Icf30e1f30fe6bf6a7d96d14b975954613cd68b70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153157 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-05-29tdf#155515 tdf#155528 crash on exitNoel Grandin
regression from commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu May 4 10:06:14 2023 +0200 tdf#105404 [API CHANGE] add index to accessiblity change event Fix a handful of things related to accessibility objects being destructed later than they should and consequently trying at access other stuff that has already been destructed. (1) AccessibleControlShape::disposing check the window still exists (2) DocumentFocusListener::notifyEvent, handle INVALIDATE_ALL_CHILDREN (3) hold DocumentFocusListener by weak reference in GtkSalData, so that it dies when the related UI widgets die Change-Id: I38bf68a748b37e6abc4a8cfcc961436728e081bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-11tdf#155235 Draw crashes on close: SIGSEGV in SalInstance:GetYieldMutex()Noel Grandin
This is a regression from commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu May 4 10:06:14 2023 +0200 tdf#105404 [API CHANGE] add index to accessiblity change event The list of children in DocumentFocusListener is getting out of sync because something is not sending add/remove events for accessible objects, a problem which was hidden before the commit above. I can't find the add/remove problem, so do the next best thing - fix the dispose methods of various accessible objects so that they clear references to other objects, which results in the relevant objects being destructed in an order which does not lead to crashes. Change-Id: Iac7f48d6e3f2bdf30edb5c7fd3c5de861aec4b7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-04speed up dealing with large shape selectionsNoel Grandin
cuts the time spent waiting when changing large selections by 90% Change-Id: I558b5b28449d0cc6b1d3b5e9e4cf455a4b37016a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-04tdf#105404 [API CHANGE] add index to accessiblity change eventNoel Grandin
Which shaves 80% off the time off breaking up a vector image on Linux. Change-Id: Id8e7daad001b6120d1fb98e382357da5b55e92ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151352 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-23Run clang-tidy with misc-unused-using-decls on modules [s-t]*Gabor Kelemen
To remove unneeded using declarations. Via the simple script: for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do clang-tidy-12 --checks="-*,misc-unused-using-decls" "$i"; done Change-Id: I596299084471b2904548d23875866f1583b00b2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150610 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-04-04tdf#153880 sc: Make Calc text hyperlinks stand out moreBalazs Varga
Add underlining for links in Calc. TODO: unit test Change-Id: Idd5a7de7464d8ce443cdec756ac803491e73b0ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149913 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-03-10improve loplugin:unnecessarylockingNoel Grandin
to find more locking we can remove Change-Id: Ief7bc5ec2a1ff31f22a0ad366910b7fcc4725818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-24a11y: Fix focused state for special char dialog itemMichael Weghorn
As mentioned/worked around in Colomban's pending Gerrit change to implement an a11y test for the "Special Characters" dialog [1], the selected item in the character table was incorrectly still reporting the "focused" state even if keyboard focus already moved on from the parent widget to another one. Fix this by checking the item is not only selected, but its parent also has child focus. Tested by running this pyatspi script after a sleep and using the time before the script actually runs to interact with the dialog to test the different scenarios for the focused state, using the "!" character in the dialog): #!/usr/bin/python3 import pyatspi def get_soffice_app(): registry = pyatspi.registry.Registry() apps = list(registry.getDesktop(0)) for app in apps: if app.name == 'soffice' or app.name == 'soffice.bin': return app print("soffice app not found") exit(1) def get_exclamation_mark_button(acc): i = 0 while i < acc.get_child_count(): child = acc.get_child_at_index(i) try: if child.name == '!': return child except NotImplementedError: pass recursive_child = get_exclamation_mark_button(child) if recursive_child: return recursive_child i = i + 1 return None app = get_soffice_app() obj = get_exclamation_mark_button(app) assert obj states = obj.get_state_set().get_states() print("states:") print(states) [1] https://gerrit.libreoffice.org/c/core/+/142260/22/sw/qa/extras/accessibility/dialogs.cxx Change-Id: I277890105e3ff84ed35100b7cd7dc2ff40510921 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147660 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-01-28Use ImplInheritanceHelper in SvxRectCtlChildAccessibleContextStephan Bergmann
Change-Id: I1e8fd8a9457925af7278e8006e7ad331f612b3ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146285 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in SvxRectCtlAccessibleContextStephan Bergmann
Change-Id: I864a1c2571ce8642626d77b726f2fa6dfbdadf2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146284 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in SvxPixelCtlAccessibleChildStephan Bergmann
Change-Id: I09d7004d6cf268831725435c5e634dedfa385a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146283 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in SvxPixelCtlAccessibleStephan Bergmann
Change-Id: I9509bfcbcc015876cba1c17e84e4de5e28de3cf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146282 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in SvxShowCharSetItemAccStephan Bergmann
Change-Id: I0baaac510afcbae5a8a9fa5886daa8b4f83145e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146280 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in SvxShowCharSetAccStephan Bergmann
Change-Id: I9009b6168c66a1b340a34aaf804e097bfe614d21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146279 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in AccFrameSelectorChildStephan Bergmann
Change-Id: Idab295d97650b158c34f0a11be79c932540e7526 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146278 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-28Use ImplInheritanceHelper in AccFrameSelectorStephan Bergmann
Change-Id: Iff6dc76c4fdc105127cde23ae478011da6ff6483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146277 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-06Merge comphelper::OAccessibleContextHelper into ↵Stephan Bergmann
comphelper::OCommonAccessibleComponent Change-Id: I586ae8fe2842fd879ae2ae506c659d06dda16843 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145160 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>