238 Commits
Author SHA1 Message Date
Michael Weghorn 76de59770c chart2 a11y: Simplify AccessibleBase::ImplGetAccessibleChildById
No need for an `else branch` as the `if` branch throws
an exception.

Also stop intermediate assignment to local variable
and return the result directly instead.

Change-Id: Ib442f72510302acffb0336e56df3efd6d93c4d83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210609
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-10 18:31:10 +02:00
Michael Weghorn dbb865574c chart2 a11y: Return without assigning to local var first
Change-Id: I48551b0add3db3335fb0ab09731cadf01f9a0d82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210608
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-09-10 18:31:03 +02:00
Michael Weghorn a4f18a3ae9 chart2 a11y: Drop XAccessible::getAccessibleContext call
OAccessible returns itself in its XAccessible::getAccessibleContext
implementation and implements the XAccessibleComponent interface itself,
so there is no need to call the method and query for that interface.

Change-Id: I232d86a3c972a8313a6dc62a1b6c799c6b1a9d81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210603
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-10 18:28:52 +02:00
Michael Weghorn bb11afbcd7 chart2 a11y: Switch AccessibleChartView::m_xParent to OAccessible
Switch AccessibleChartView::m_xParent from a weak
reference of the abstract XAccessible interface to
a weak reference of the more concrete OAccessible class.

Change-Id: Iba9f410979c079735b6c41723206b2ac76c1dc1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210602
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-10 18:28:43 +02:00
Michael Weghorn 2a21a3acf7 chart2 a11y: Use OAccessible in AccessibleChartShape ctor
Use the more concrete OAccessible instead of the
abstract XAccessible UNO interface.

Change-Id: I18fd3378abe7c6f81a0244f7901eb0bedc9f0d32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210381
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-09-02 14:34:00 +02:00
Andrea Gelmini 8ff895d2b4 Fix typos
Change-Id: I042b75e729ce5ae92ae5a4fb294ead845428dce9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209476
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-08-22 10:17:24 +02:00
Gabor Kelemen 47fe1cce1b tdf#146619 Use more forward declarations in include/vcl/[h-p]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[n-p]*

Change-Id: If6436f3ef8300693c3869c2521e2fa2aa8a4edc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196397
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-14 10:19:31 +01:00
Chiggy Wiggy f87ed54e46 tdf#43157 canvas & chart2 : Replace OSL_ASSERT with SAL_WARN_IF
Replace obsolete OSL_ASSERT usages with SAL_WARN_IF inside the
canvas module. This ensures debug warnings are logged without
aborting execution.

Change-Id: Idad9b3a7c250e45903b40cc2a82c43f8fead2bc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195142
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2025-12-23 10:44:20 +01:00
Gabor Kelemen 85f88d7196 tdf#146619 Run IWYU on chart2/
Change-Id: I2f0920df37ba14918e1325983309f9b77c8792cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188751
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-08-18 20:19:39 +02:00
Michael Weghorn 671b8cad97 a11y: Rename OAccessibleComponentHelper to OAccessible
The helper class used to implement less functionality
in the past and was used less than it is now.
But by now it is the central helper/base class used
by most a11y classes.

Since

    commit 22049f633b
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon May 26 12:24:52 2025 +0200

        vcl a11y: Let OAccessibleComponentHelper implement XAccessible

it also implements the XAccessible interface.

That will allow to switch parameters and class members
from the abstract XAccessible interface to using this
more concrete C++ base class in various places.

Rename the class to OAccessible to account for the
new responsibilities, and adjust its doc accordingly.

Renaming source and header file will be done in a
separate commit to simplify (git) keeping track.

Change-Id: I33210b47cda5f71820a3c0fa657e4c3548d45732
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186952
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-26 13:09:41 +02:00
Michael Weghorn 58dc1ed32a chart2 a11y: Switch param to OAccessibleComponentHelper
Change-Id: I8cc0b4bb6fc7464c4f8496af53fdaf72b9a00088
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185856
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-25 07:41:13 +02:00
Michael Weghorn 604cea2b98 chart2 a11y: Drop impl::AccessibleChartView_Base typedef
Change-Id: I38ef840bafa7d8302d8508bb0225df72f05a0f78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185854
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-25 07:41:00 +02:00
Michael Weghorn 22049f633b vcl a11y: Let OAccessibleComponentHelper implement XAccessible
By now, in particular after

    Change-Id: I62da0040e6c98636681c4f05dbd0b796dae5b928
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon May 26 09:35:07 2025 +0200

        vcl a11y: Let VCLXAccessibleComponent implement XAccessible

, all OAccessibleComponentHelper subclasses are
implementing the XAccessible interface and returning
`this` in their XAccessible::getAccessibleContext implementation.

Unify and deduplicate that by moving the implementation to the
OAccessibleComponentHelper base class.

Locking specifics (whether a mutex was locked and which one)
and whether a check whether the accessible hadn't been
disposed yet was done varied across the different implementations.
The new OAccessibleComponentHelper::getAccessibleContext
unifies this to use OExternalLockGuard, i.e. it both locks
the mutex and throws an exception if the instance is no
longer alive.

Should this commit result in any issues, it's likely because
there is a preexisting locking issue/inconsistency or an object
has already been disposed and that needs to be addressed.
(The easiest approach in case of a disposed object would be
to simply catch + ignore the exception in the caller, but
a more thorough investigation would likely be helpful.)

Change-Id: Ib56a9ddb1c36356943c2dfd7a5705351ee43e9d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185849
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-06-25 07:40:30 +02:00
Michael Weghorn 6c4abe2cb1 [API CHANGE]: Drop AccessibleChartElement service
Stop implementing the XServiceInfo interface in chart2
a11y implementations as the info provided by that interface
isn't needed anywhere, see also

    Change-Id: Id306320710a1718ff10536127427f3a5daf68559
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Jun 20 11:14:19 2025 +0200

        svtools ruler a11y: No longer implement XServiceInfo

for more background.

Related to that, drop the unpublished AccessibleChartElement
service.
A search in Google and on Ask [1] didn't give
any results that would suggest this unpublished service
could be relevant for third party code. (Instances.
couldn't be created by external code anyway.)

[1] https://ask.libreoffice.org/

Change-Id: I97056996bc433940c262e9b1060eb37a24a0b00e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186758
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-20 21:22:56 +02:00
Mike Kaganski 374dd9fbd6 Unify on VclPtr::reset
We used to have two duplicating sets: smart pointer-like VclPtr::reset,
and Reference-style VclPtr::set / VclPtr::clear. There is no need in
this duplication. Further, in ScopedVclPtr, reset is hidden / removed
to avoid skipping disposeAndClear; but the twin functions are kept
accessible, possibly as an overlook.

This change drops Reference-style VclPtr::set / VclPtr::clear, and
unifies on VclPtr::reset, which looks more consistent with the class
nature (it is closer to shared_ptr, than to uno::Reference). Doing
that uncovered one place, where a ScopedVclPtr was used incorrectly:
clear() was used for NotebookbarPopup::m_pParent in NotebookbarPopup
dtor. I assume then, that the correct class needed here is VclPtr.

Change-Id: I0746075c58d793fabdce1bc357afea8ee455cd8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185553
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-05-25 11:23:18 +02:00
Michael Weghorn bcbee8ad61 chart a11y: Drop extra assignment to local var
Change-Id: I8a5fccd35a707e84c6638bf1ee3d3a488cd413cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184787
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-29 23:09:36 +02:00
Michael Weghorn 83ab114452 chart2 a11y: Switch OSL_ENSURE -> assert
... and drop the additional check.

The only caller AccessibleChartElement::InitTextEdit
passes (always non-null) `this`.

Change-Id: I218dc224eb6bad827fce66db02706bb555831a8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184786
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-29 23:09:13 +02:00
Michael Weghorn 99ece4e801 a11y: Drop unused includes
Change-Id: Ib0e4fe99d35c7b5735dc6cbe61705588ee8c84b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183982
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-10 19:45:08 +02:00
Caolán McNamara 5bf25073c5 cid#1645567 COPY_INSTEAD_OF_MOVE
Change-Id: I933b54db23a084a8a3d9883b5ec0aa602dad8ef5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183610
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2025-04-02 10:55:10 +02:00
Michael Weghorn 2384755ca8 a11y: Drop unnecessary XAccessibleExtendedComponent overrides
Drop overrides of the XAccessibleExtendedComponent
which just return an empty string.

That is now already implemented in the base class
implementations in OAccessibleComponentHelper, see

    Change-Id: I05547b12806a6a90b166edbe196b4bc5a27344be
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Mar 31 13:49:20 2025 +0200

        a11y: Merge OAccessible{,Extended}ComponentHelper, add default impl

Change-Id: Ibc3fe295eaa2dc5443ba4f8fa25a81451b7b3765
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183553
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-01 11:20:32 +02:00
Michael Weghorn 0cb6632ece a11y: Merge OAccessibleComponentHelper and OCommonAccessibleComponent
Merge the two classes, now that OAccessibleComponentHelper
is the only OCommonAccessibleComponent subclass after

    Change-Id: I05547b12806a6a90b166edbe196b4bc5a27344be
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Mar 31 13:49:20 2025 +0200

        a11y: Merge OAccessible{,Extended}ComponentHelper, add default impl

Change-Id: Ic7a36c40066f307f8df29dc4dd45ed3ee966bcb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183552
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-01 11:20:23 +02:00
Michael Weghorn e856e8e71f a11y: Merge OAccessible{,Extended}ComponentHelper, add default impl
Merge OAccessibleExtendedComponentHelper and
OAccessibleComponentHelper by letting
OAccessibleComponentHelper already implement the
XAccessibleExtendedComponent interface.

Add default implementations for the two
XAccessibleExtendedComponent methods
(XAccessibleExtendedComponent::getToolTipText
and XAccessibleExtendedComponent::getTitledBorderText)
that simply return an empty string.

Replace all uses of XAccessibleExtendedComponent
by OAccessibleComponentHelper.

This simplifies the class hierarchy and prepares
for further simplification in upcoming commits.

Change-Id: I05547b12806a6a90b166edbe196b4bc5a27344be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183551
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:20:12 +02:00
Michael Weghorn 24f207d4fe chart a11y: Reuse base class logic to check disposed state
Change-Id: I79c95519ee5ba76f68bff6984e3659abdea9ce60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183537
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:19:14 +02:00
Michael Weghorn 9a71ceb794 chart a11y: Drop AccessibleBase::BroadcastAccEvent
Use the base class's OCommonAccessibleComponent::NotifyAccessibleEvent
directly instead.

The old/new params are in reverse order
for that one, so adjust callers accordingly.

Change-Id: I8d4ef730a139366c5762836819e20d35cb2ff5a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183536
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-01 11:19:06 +02:00
Michael Weghorn 0191439627 chart a11y: Use OAccessibleExtendedComponentHelper
Let chart's AccessibleBase derive from
OAccessibleExtendedComponentHelper to make use of the
logic already implemented there instead of having to
implement all the XAccessible(Extended)Component
and XAccessibleEventBroadcaster methods manually.

AccessibleBase::getBounds implements what is needed
to implement OAccessibleExtendedComponentHelper::implGetBounds,
so rename the method.

Drop all of the other overrides that are no longer
needed as the implementation is now provided by
the base class.

Adjust subclasses as well to deduplicate logic there, too.

No change in behavior intended or observed initially
when testing this with Accerciser and Orca and the gtk3 and qt6
VCL plugins for a chart inserted in Writer ("Insert" -> "Chart").

Change-Id: I5d29c099dc31d70711f4017e52a0859f22c5aa23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183524
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:19:00 +02:00
Michael Weghorn fcc01f789a chart a11y: Simplify XAccessible{,Extended}Component implementations
Let the base class AccessibleBase implement
XAccessibleExtendedComponent with default implementations
for the methods that simply return empty strings.

This simplifies the implementation in subclasses, that
now only need to override XAccessibleComponent
and XAccessibleExtendedComponent methods when they
actually want to have a different behavior, not
to avoid ambiguity due to XAccessibleComponent
being a base class of both of their base classes
(XAccessibleExtendedComponent, AccessibleBase).

Change-Id: I2a6a39a721de19178954db898d52a2d7bc01fcb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183523
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:18:53 +02:00
Michael Weghorn a97b5966d3 chart a11y: use vcl::Window instead of XWindow
Switch AccessibleChartView::m_xWindow,
AccessibleElementInfo::m_xWindow and related code
from using the UNO interface
css::uno::WeakReference<css::awt::XWindow> to using
the concrete implementation class vcl::Window/ChartWindow
directly instead of assuming it's a vcl::Window and then
using VCLUnoHelper::GetWindow to get the vcl::Window
from the XWindow in multiple places.
Rename the members accordingly.

Use a VclPtr and clear it in
AccessibleBase::disposing and AccessibleChartView::disposing.

No change in behavior intended or seen in a quick test using
Accerciser with the qt6 VCL plugin with a chart inserted in Writer
using "Insert" -> "Chart".

Change-Id: If98ef041fdd1a8bf68620e0c8b1e81973e7b01f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183522
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:18:40 +02:00
Michael Weghorn 5501042392 chart a11y: Use nullptr directly
This makes more obvious that this is null. In particular
calling VCLUnoHelper::GetWindow with a Reference that is
known to be empty/null doesn't make much sense.

This has become more obvious with previous commit

    Change-Id: I91d4e9cc40473aa204ec7bcada954cf0f765e6ea
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Mar 31 06:14:27 2025 +0200

        chart a11y: Make clearing weak refs more obvious

Change-Id: Ia544001d609ede8f44003ffd4befc3cddccf045f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183519
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-01 11:18:34 +02:00
Michael Weghorn a179c0a6c1 chart a11y: Make clearing weak refs more obvious
Drop the local vars that are first assigned
the current value of the members, but then
cleared, and then assigned to the members.

Instead, clear the members directly to make more obvious
what's happening.

Change-Id: I91d4e9cc40473aa204ec7bcada954cf0f765e6ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183518
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-01 11:18:28 +02:00
Michael Weghorn 679e9b4ca1 chart a11y: Drop XEventListener inheritance
Don't let AccessibleBase subclass XEventListener as
there's no need to, and AccessibleBase::disposing
wasn't doing anything anyways.

Change-Id: I6fa5e7cb65853e775792c35ce6571104c8c7edcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183515
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:18:08 +02:00
Noel Grandin 309ac64cf4 use more concrete UNO in chart2
Change-Id: I0f91e4ed7a2ddc656d0edb3c8a54960a3b1b70b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182666
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-03-08 17:42:42 +01:00
Michael Weghorn bdc21628d2 chart a11y: Avoid const_cast
AccessibleBase::BroadcastAccEvent is only called from non-const
methods, so there is no need for it to be const itself.

Drop the const qualifier and the now no longer needed const_cast
of `this` inside the method.

Change-Id: I9e8bb74d761135b1f22525fa79912f4694ca7654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182121
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-02-25 08:21:38 +01:00
Michael Weghorn cceed7e86a chart a11y: Use rtl::Reference<AccessibleBase>
Use an rtl::Reference of the specific AccessibleBase
instead of a generic uno::Reference<XAccessible> and
then still making assumptions that it's actually an
Accessible object in various places.

Change-Id: Iaccccc3e928d4f47b16b4681404b6c6169ac67c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182120
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-02-25 08:21:32 +01:00
Gabor Kelemen 0489e8e21a Drop unneeded forward declarations from chart2 module
test drive the new bin/find-unneeded-includes --fwdecl mode

Change-Id: I9fd1148e8cff3ebda4595820af5fc824f530245c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178967
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2025-01-02 08:24:07 +01:00
Michael Weghorn a2c1a337f0 [API CHANGE] a11y: Drop XAccessibleExtendedComponent::getFont
This method from the unpublished XAccessibleExtendedComponent
interface is not used by any of the a11y platform bridges, and
I don't know of any platform a11y API that would need it.

In order to report character/font attributes, there is the
XAccessibleText interface and its
XAccessiText::getCharacterAttributes method instead, which
actually gets used by the platform a11y bridges.

Therefore, drop this method to simplify code, and also decouple
the accessibility module a bit further from the toolkit
module without having to reorganize code further.
(VCLXFont from the toolkit module currently gets used in
various implementations.)

Change-Id: I06ea3cc5998a13927b3f869877b28f03ac07c89b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177809
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-04 20:46:21 +01:00
Bogdan Buzea e36a3972c8 tdf#163486: PVS: V614 Uninitialized variable used
V614 Uninitialized variable 'aLStyle' used.
V614 Uninitialized variable 'aFStyle' used.

Change-Id: I2e545d7909818d8850728bea7cbb533d5ddd87e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175860
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-15 14:58:37 +01:00
Caolán McNamara a4dfd23e44 cid#1557694 COPY_INSTEAD_OF_MOVE
and

cid#1557162 COPY_INSTEAD_OF_MOVE
cid#1556896 COPY_INSTEAD_OF_MOVE
cid#1556893 COPY_INSTEAD_OF_MOVE
cid#1556873 COPY_INSTEAD_OF_MOVE
cid#1556872 COPY_INSTEAD_OF_MOVE
cid#1556789 COPY_INSTEAD_OF_MOVE
cid#1556570 COPY_INSTEAD_OF_MOVE
cid#1556519 COPY_INSTEAD_OF_MOVE
cid#1556516 COPY_INSTEAD_OF_MOVE
cid#1556451 COPY_INSTEAD_OF_MOVE
cid#1556396 COPY_INSTEAD_OF_MOVE
cid#1556237 COPY_INSTEAD_OF_MOVE
cid#1556113 COPY_INSTEAD_OF_MOVE
cid#1556094 COPY_INSTEAD_OF_MOVE
cid#1555991 COPY_INSTEAD_OF_MOVE
cid#1555982 COPY_INSTEAD_OF_MOVE
cid#1555885 COPY_INSTEAD_OF_MOVE
cid#1555702 COPY_INSTEAD_OF_MOVE
cid#1555610 COPY_INSTEAD_OF_MOVE
cid#1555450 COPY_INSTEAD_OF_MOVE
cid#1555327 COPY_INSTEAD_OF_MOVE
cid#1555145 COPY_INSTEAD_OF_MOVE

Change-Id: I38cc1a38e8cb2c33f33e0fc3afd34a0fb39e5ec1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172028
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-19 15:15:54 +02:00
Gabor Kelemen e3ca92bcfd Drop unneeded 'using' instances
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
2024-05-16 08:35:11 +02:00
Michael Weghorn 34bfb9f506 chart2 a11y: Drop ChildListVectorType typedef
Change-Id: Ie7ad5157bdcd261c8e5e6507b93b2820424c9125
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167432
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-05-10 16:23:27 +02:00
Noel Grandin 1de066d04f loplugin:ostr in chart2
Change-Id: I2985b6793a776639214a25bf9732c000b9026bfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167236
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-07 08:46:21 +02:00
Rafał Dobrakowski 102622a07d tdf#146619 Remove unused #includes from C/C++ files
'chart2' module was cleaned.

Change-Id: Ib4cdb3c8a21d0ed47f4970894d416327df5e68a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164864
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-27 09:20:54 +01:00
Noel Grandin bc640ec911 no need to allocate this on the heap
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-12-16 10:44:35 +01:00
Noel Grandin 3ce2232c05 tdf#157115 crash on inserting chart (gtk3)
regression from
    commit bdf2d66478
    Author: Noel Grandin <noelgrandin@gmail.com>
    Date:   Sat Sep 2 10:44:51 2023 +0200
    use more concrete type in AccessibleChartView

Change-Id: I5f76f10404d6a202b1653f5e7cabc665b5962557
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-06 13:20:09 +02:00
Noel Grandin 21af3e5b5d use more concrete type in chart::AccessibleTextHelper
Change-Id: I3ad20c37bb2009964cf20a1ee184b2674de82817
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156470
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-02 21:14:18 +02:00
Noel Grandin bdf2d66478 use more concrete type in AccessibleChartView
Change-Id: I1ec6c7bdd0f7ab487ba1ade89cd545f5bc97f540
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156466
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-02 15:01:44 +02:00
Noel Grandin 972aea543e simplify
Change-Id: I276ba7809b08a359b377ea56259140675c5e00a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-12 15:25:33 +02:00
Noel Grandin 3b7db80273 tdf#105404 [API CHANGE] add index to accessiblity change event
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-05-04 13:56:46 +02:00
Noel Grandin 90d658d6d1 XUnoTunnel->dynamic_cast in ExplicitValueProvider
Change-Id: I72b85a18d0a754f81a136fd79e56789aa926f425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-18 09:08:49 +00:00
Noel Grandin fd6df89dbc use more concrete types in chart
Change-Id: I23888f636e36f6163405603a542a2f2f12eefa1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145488
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-14 07:28:02 +00:00
Michael Weghorn 206543c7be [API CHANGE] tdf#150683 a11y: Switch a11y child index to 64 bit
With 16k column support in Calc enabled by default in

    commit 4c5f8ccf0a
    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-09-02 15:47:37 +02:00