summaryrefslogtreecommitdiff
path: root/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
AgeCommit message (Collapse)AuthorFilesLines
5 daysDrop unneeded 'using' instancesGabor Kelemen1-1/+0
found with bin/find-unused-using.sh Change-Id: I647f493ee313e79e7a9967960ea089b729de59a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167637 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2023-12-16no need to allocate this on the heapNoel Grandin1-8/+8
Change-Id: I9a63c534a12ec2cf11d8820a5bbba8bca9a7c0e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160841 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-02use more concrete type in chart::AccessibleTextHelperNoel Grandin1-12/+3
Change-Id: I3ad20c37bb2009964cf20a1ee184b2674de82817 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156470 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-02[API CHANGE] tdf#150683 a11y: Switch a11y child index to 64 bitMichael Weghorn1-3/+3
With 16k column support in Calc enabled by default in commit 4c5f8ccf0a2320432b8fe91add1dcadf54d9fd58 Date: Tue Mar 8 12:44:49 2022 +0100 change default Calc number of columns to 16384 (tdf#50916) , the number of Calc cells in a spreadsheet is larger than SAL_MAX_INT32, meaning that a 32-bit a11y child index is no more enough and using it resulted in integer overflows in methods handling corresponding Calc cells in the a11y layer. This e.g. had the effect of the Orca and NVDA screen readers not announcing focused or selected cells properly when their a11y child index was out of the 32-bit integer range. Switch the internal a11y child indices to 64 bit to be able to handle this properly internally. Since the platform APIs (at least AT-SPI on Linux and IAccessible2 on Windows; from what I can see LO's macOS a11y bridge doesn't directly expose the child index) are still restricted to 32 bit, larger child indices still cannot be exposed via the platform APIs. As a consequence, use of the the IAccessible2 and AT-SPI methods that use the child index remains problematic in those cases where the child index is larger. However, as an alternative to using the AT-SPI Table interface and the IAccessibleTable/ IAccessibleTable2 interfaces with the child index to retrieve information about a specific cell, both AT-SPI and IAccessible2 also provide interfaces to retrieve that information directly from the cell object (TableCell interface for AT-SPI, IAccessibleTableCell for IAccessible2). Those interfaces are already implemented/exposed for winaccessibility (s. `CAccTable`) and the qt5/qt6/kf5 VCL plugins (s. the `QAccessibleTableCellInterface` methods implemented in `QtAccessibleInterface`). With the switch to 64-bit internal a11y child indices, these now behave correctly for cells with a child index that doesn't fit into 32 bit as well. NVDA on Windows already uses the IAccessibleTableCell interface and thus announcing focused cells works fine with this change in place. Orca on Linux currently doesn't make use of the AT-SPI TableCell interface yet, but with a suggested change to do so [1], announcement of selected cells works with the qt6 VCL plugin with a current qtbase dev branch as well - when combined with the suggested changes to implement support for the AT-SPI TableCell interface in Qt [2] [3] and the LO change based on that [4] and a fix for a nullptr dereference [5]. The gtk3 VCL plugin doesn't expose the AT-SPI TableCell interface yet, but once it does so (via `AtkTableCell`), it also works with the suggested Orca change [1] in place. (Adding that is planned for an upcoming change, works with a local WIP patch.) For handling return values that are larger than what platform APIs support, the following approach has been chosen for now: 1) When the return value is for the count of (selected) children, the maximum value N supported by the platform API is returned. (This is what `ScAccessibleTableBase::getAccessibleChildCount` did previously.) The first N elements can be accessed by their actual (selection) indices. 2) When the return value is the child/cell index, -2 is returned for objects whose index is greater than the maximum value supported by the platform API. Using a non-negative value would mean that the index would refer to *another* actually existing child. A child index of -1 on the other hand tends to be interpreted as "child is invalid" or "object isn't actually a child of its (previous) parent any more)". For the Orca case, this would result in objects with a child index of -1 not being announced, as they are considered "zombies" [6]. What's still somewhat problematic is the case where more than 2^31 children are *selected*, since access to those children still happens by the index into the selection in the platform APIs, and not all selected items are accessible this way. (Screen readers usually just retrieve the first and last element from the selection and announce those.) Orca already seems to apply different handling for the case for fully selected rows and columns, so "All cells selected" or "Columns ... to ... selected" is announced just fine even if more than 2^31 cells are selected. (Side note: While Microsoft User Interface Automation - UIA - also uses 32-bit indices, it also has specific methods in the ISelectionProvider2 interface that allow to explicitly retrieve the first and last selected item, `ISelectionProvider2::get_FirstSelectedItem` and `ISelectionProvider2::get_LastSelectedItem`, but we currently don't support UIA on Windows.) Bound checks at the beginning of the methods from the `XAccessibleContext`, `XAccessibleSelection` and `XAccessibleTable` interfaces that take a child index (or in helper methods called by those) should generally already prevent too large indices from being passed to the methods in the lower layer code that take smaller integer types. Such bound checking has been been added in various places where it wasn't present yet. If there any remaining issues of this kind that show after this commit, they can probably be solved in a similar way (s.e.g. the change to `AccessibleBrowseBox::getAccessibleChild` in this commit). A few asserts were also added at places where my understanding is that values shouldn't be larger than what is supported by a called method anyway. A test case will be added in a following change. [1] https://gitlab.gnome.org/GNOME/orca/-/merge_requests/131 [2] https://codereview.qt-project.org/c/qt/qtbase/+/428566 [3] https://codereview.qt-project.org/c/qt/qtbase/+/428567 [4] https://gerrit.libreoffice.org/c/core/+/138750 [5] https://codereview.qt-project.org/c/qt/qtbase/+/430157 [6] https://gitlab.gnome.org/GNOME/orca/-/blob/82c8542002e36e0d3d918088d583162d25136143/src/orca/script_utilities.py#L5155 Change-Id: I3af590c988b0e6754fc72545918412f39e8fea07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139258 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-07-08[API CHANGE] Drop css::accessibility::XAccessibleStateSetNoel Grandin1-2/+2
which is internal API, unused (as far as I can tell) by external users. This state is purely a bitset (as implemented by utl::AccessibleStateSetHelper) so we can just return it as a 64-bit value. This shaves significant time off the performance profiles of code that loads very complex shapes, because this state is frequently used, and we no longer need to allocate a return value on the heap for every call. Change-Id: Icf1b3bd367c256646ae9015f9127025f59459c2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136786 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-30use comphelper::WeakComponentImplHelper in AccessibleTextHelperNoel Grandin1-1/+2
Change-Id: I886d510fc1ebccb058446703a64854c7854891bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127688 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-17split OutputDevice from WindowNoel Grandin1-1/+1
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-18o3tl::make_unique -> std::make_unique in chart2...cuiGabor Kelemen1-2/+1
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I2ba0b9b44971166bd79527b52745f3c40dc14387 Reviewed-on: https://gerrit.libreoffice.org/66490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-14tdf#42949 Fix IWYU warnings in chart2/source/controller/*/cxx (1)Gabor Kelemen1-1/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Cleaned directories are: accessibility, drawinglayer, itemsetwrapper, main, sidebar Change-Id: I612eae9dec636d57a3a3a00102d74b964da5b54c Reviewed-on: https://gerrit.libreoffice.org/64307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-29tdf#42949 Fix IWYU warnings in include/vcl/[i-m]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91 Reviewed-on: https://gerrit.libreoffice.org/64141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-09-06loplugin:simplifyconstruct in canvas..cuiNoel Grandin1-1/+0
Change-Id: I02eba1df117a9d0df42bcac13c3251cb4fa6da14 Reviewed-on: https://gerrit.libreoffice.org/60074 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: chart2Stephan Bergmann1-2/+2
Change-Id: I5b455c684e7cd689d5160135246f3400363c7d40
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke1-1/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-01-26Remove dynamic exception specificationsStephan Bergmann1-14/+0
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-16new loplugin: useuniqueptr: chart2Noel Grandin1-3/+2
Change-Id: Ic029ed28fd6de8cf4ee204585c1c6e0c8a4b67ff Reviewed-on: https://gerrit.libreoffice.org/32960 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-11update vclwidget loplugin to find ref-dropping assigmentNoel Grandin1-1/+1
Look for places where we are accidentally assigning a returned-by-value VclPtr<T> to a T*, which generally ends up in a use-after-free. Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9 Reviewed-on: https://gerrit.libreoffice.org/30749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-01-05tdf#94205: Use o3tl::make_unique insted of new+std::move.Sheikha AL-Hinai1-3/+2
Change-Id: I9ff14760479d2ac882546e2e5b74ab750ba2fa4b Reviewed-on: https://gerrit.libreoffice.org/20984 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-2/+2
Change-Id: I71de514405bb9bcc746c1ab9633e7fe659888943
2015-06-15remove unnecessary check for null when calling deleteNoel Grandin1-2/+1
Idea originally from caolan. Found using the following command: find . -name *.cxx | xargs /opt/local/bin/grep -zlP '(?m)if\s*\(\s*\w+\s*\)\s*delete\s+\w+\;' Change-Id: I3338f4e22193a6dfd6219c8c75835224a3392763
2015-03-11V668 no sense in testing the result of new against nullCaolán McNamara1-6/+3
Change-Id: I7783d96e40de7a8df794f143d2c7830bf3314218
2014-09-24Replace some std::auto_ptr function parameters with std::unique_ptrStephan Bergmann1-2/+7
Change-Id: Ic66d325fd9559c6dde9556c26e5b2a7e60376c49
2014-09-23fdo#82577: Handle WindowNoel Grandin1-1/+1
Put the VCL Window class in the vcl namespace. Avoids clash with the X11 Window typedef. Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann1-11/+11
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2013-07-29fdo#62475 removed pointless commentsJelle van der Waa1-3/+0
Change-Id: I3f5e86dba2df950aeb12c895f52d99274c0959aa Reviewed-on: https://gerrit.libreoffice.org/5148 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák1-1/+0
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk have kept them, in order not to break external API (the automatic using declaration is LO-internal). Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2012-07-18re-base on ALv2 code. Includes:Michael Meeks1-23/+14
118568: switch to using ucpp Patch contributed by Juergen Schmidt http://svn.apache.org/viewvc?view=revision&revision=1209396
2011-12-13Fix for fdo43460 Part V getLength to isEmptyOlivier Hallot1-2/+2
Part V Module chart2
2011-11-27remove include of pch header in chart2Norbert Thiebaud1-2/+0
2011-03-13Move OSL_ENSURE(false,...) to OSL_FAIL(...)Thomas Arnhold1-8/+8
2011-01-17Removed bogus comments from calc-chart2Alfonso Eusebio1-6/+0
Removed bogus comments from calc/chart2/accesibility and .../chartapiwrapper
2010-10-25merge vosremoval-mutex.diffNorbert Thiebaud1-1/+1
In practice the changeset is 'inspired' by vosremoval-mutex.diff but was essentially redone manually
2010-10-25use SolarMutexGuard to guard the SolarMutexNorbert Thiebaud1-3/+3
2010-10-13Add vim/emacs modelines to all source filesSebastian Spaeth1-0/+3
Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-02-12changefileheader2: #i109125#: change source file copyright notice from Sun ↵Jens-Heiner Rechtien1-4/+1
Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision)
2008-04-10INTEGRATION: CWS changefileheader (1.3.12); FILE MERGEDRüdiger Timm1-23/+18
2008/03/28 16:43:13 rt 1.3.12.1: #i87441# Change license header to LPGL v3.
2008-03-12INTEGRATION: CWS impresstables2 (1.2.30); FILE MERGEDRüdiger Timm1-3/+3
2007/07/26 22:11:25 cl 1.2.30.1: worked on tables in draw
2007-05-22INTEGRATION: CWS chart2mst3 (1.1.2); FILE ADDEDVladimir Glazounov1-0/+211
2007/02/08 21:25:27 iha 1.1.2.3: resync m195 -> m202 2006/11/26 10:55:32 bm 1.1.2.2: includes for solar mutex missing 2006/03/23 09:51:50 bm 1.1.2.1: text support for titles. This class is instantiated directly by the controller as it needs a DrawView to work