Commit Graph
382 Commits
Author SHA1 Message Date
Gabor Kelemen 76eb42c5aa tdf#146619 Use more forward declarations in include/svl
This shaves off some 40M of input

Change-Id: I89411ee8d94963ec6bc16fe155c885d2c78ee3a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198233
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-31 16:36:16 +01:00
Gabor Kelemen f9af3767bd tdf#146619 Run IWYU on editeng/
Change-Id: I2c124548ab312ec21558f22207952d2315f5a805
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190908
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2025-09-19 08:21:25 +02:00
Michael Weghorn be739cff91 tdf#168278 editeng a11y: Normalize selection start/end index
In AccessibleEditableTextPara::GetSelection, call
ESelection::Adjust so that the earlier position in
the text is considered the start position and the
position later in the text is considered the end
position, independent of whether the selection was
done forwards or backwards.

Always using the smaller index for the start index
and the greater index for the end index matches what
is done for Writer and what is also seen for other
applications as well.

Example results for typing "abcd", moving the mouse to
after the "c" and selecting two characters backwards
(i.e. "bc" is selected, with the caret being in
front of the "b":

Writer, with either the gtk3 or qt6 VCL plugin
and the paragraph selected in Accerciser's tree view
of the LO a11y hierarchy gives this in the IPython
console:

    In [2]: acc.queryText().getSelection(0)
    Out[2]: (1, 3)

For a Calc cell in edit mode, the result would
previously be:

    In [4]: acc.queryText().getSelection(0)
    Out[4]: (3, 1)

, but now it matches the behavior seen with
Writer.

In a quick test with Gedit on Linux and the
URL bar on Firefox on Windows and querying
the selection using the IAccessibleText
selection, the lower index was always reported
for the start index as well and the greater one
for the end index as well.

For gtk3, this additionally ensures that a selection
count of 1 is reported for a non-zero selection
that was done backwards as well, as
text_wrapper_get_n_selections returns 0 if the
end index isn't larger than the start index.

Change-Id: I549d85968f62cbfc2ee4d39c5a4aeba8767df14d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190716
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-09-09 18:50:47 +02:00
Michael Weghorn 2bb5079d39 editeng a11y: Drop AccessibleParaManager::IsReferencable
... variant that only calls rtl::Reference<AccessibleEditableTextPara>::is().

Instead, spell out the type instead of using `auto`
to make this a bit more readable/obvious in the callers.

Change-Id: I53e2e2b8d22cd65d9d3d1f5b17e0c3ac17a711e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189677
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-08-15 17:41:26 +02:00
Michael Weghorn 03c1d20c42 a11y: Return OAccessible in AccessibleParaManager::CreateChild
Change-Id: Ic6cc6d6751637f32f3d192448184fe5c4aa0fb95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189622
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-08-15 06:47:02 +02:00
Michael Weghorn 76fafc4ecc editeng a11y: Switch AccessibleParaManager::CreateChild param to OAccessible
Change-Id: Idab02c758a769a822291acd1692ce290b81c6d74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189621
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-08-15 06:46:56 +02:00
Michael Weghorn e7e3a51c32 a11y: Rename OAccessible source and header file
Rename files accordingly after the class
was renamed in previous commit

    Change-Id: I33210b47cda5f71820a3c0fa657e4c3548d45732
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jun 25 10:15:23 2025 +0200

        a11y: Rename OAccessibleComponentHelper to OAccessible

Change-Id: I1d38d124af685960c0170601e930da516ce2ead3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186953
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-26 13:09:50 +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 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 8481f7d925 [API CHANGE]: a11y: Drop com.sun.star.accessibility.Accessible
Drop the unpublished service
"com.sun.star.accessibility.Accessible"
because it's unused internally.

As the doc in the IDL file says:

> <p>Service <code>Accessible</code> is just a wrapper for the interface
> <code>XAccessible</code>.  See the interface's documentation for more
> information.</p>

That wrapper isn't needed.

This is one step towards dropping the XServiceInfo
implementation from a11y classes, which will also help
avoid linker issues seen on Windows related to multiple
classes subclassing
cppu::ImplInheritanceHelper<class comphelper::OAccessibleComponentHelper,class com::sun::star::lang::XServiceInfo>
seen with upcoming commit

    Change-Id: Ib56a9ddb1c36356943c2dfd7a5705351ee43e9d9
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon May 26 12:24:52 2025 +0200

        vcl a11y: Let OAccessibleComponentHelper implement XAccessible

(Gerrit change [1], Windows CI log: [2]).

A search in Google and on Ask [3] gave one result that looks
relevant/where this service is used: [4]
It was originally added in commit [5]

    commit 3f227e8755954e30abf9eb2cde6e4613514e4958
    Author: Zev Spitz <shivisi@hotmail.com>
    Date:   Sun Sep 10 09:20:55 2017 +0200

        Type definitions for LibreOffice, via Automation

, which doesn't explain whether/why the particular use of
the Accessible service was chosen there, i.e. whether this
is actually of relevance.
I've created an issue/discussion to make developers of
that project aware: [6]

Stopping to implement XServiceInfo in SwAccessibleContext
and subclasses will be done in a separate upcoming commit,
now that the only service implemented by them has been
dropped.

[1] https://gerrit.libreoffice.org/c/core/+/185849/6
[2] https://ci.libreoffice.org/job/gerrit_windows/200107/console
[3] https://ask.libreoffice.org/
[4] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/activex-libreoffice/activex-libreoffice-tests.ts
[5] https://github.com/DefinitelyTyped/DefinitelyTyped/commit/3f227e8755954e30abf9eb2cde6e4613514e4958
[6] https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/73096

Change-Id: I7432d4a524ceaf404b1a2673d8bb6cdb142baf25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186881
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-25 07:40:00 +02:00
Michael Weghorn 55f2e804a1 [API CHANGE]: a11y: Drop com.sun.star.text.AccessibleParagraphView
Drop the unpublished service
"com.sun.star.text.AccessibleParagraphView"
because it's unused. (The IDL file only documents some
internal implementation details of the a11y classes
implementing the service. It also isn't fully up to
date, e.g. the description of the accessible name.)

For AccessibleEditableTextPara, also no longer implement
the XServiceInfo interface, as the now dropped service was the
only one that was supported.

This is one step towards dropping the XServiceInfo
implementation from a11y classes, which will also help
avoid linker issues seen on Windows related to multiple
classes subclassing
cppu::ImplInheritanceHelper<class comphelper::OAccessibleComponentHelper,class com::sun::star::lang::XServiceInfo>
seen with upcoming commit

    Change-Id: Ib56a9ddb1c36356943c2dfd7a5705351ee43e9d9
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon May 26 12:24:52 2025 +0200

        vcl a11y: Let OAccessibleComponentHelper implement XAccessible

(Gerrit change [1], Windows CI log: [2]).

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

[1] https://gerrit.libreoffice.org/c/core/+/185849/6
[2] https://ci.libreoffice.org/job/gerrit_windows/200107/console
[3] https://ask.libreoffice.org/

Change-Id: Iee961e76ff7af1dab46d26cd844763970adc98c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186876
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-25 07:39:32 +02:00
Michael Weghorn 50bdfc1c99 editeng a11y: Drop AccessibleContextBase::getImplementationId
It does the same as the ImplInheritanceHelper base class
implementation.

Change-Id: Ic9bf15d7c3798640fcf47a7060cf3d28c6edc694
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186749
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-06-20 17:35:58 +02:00
Michael Weghorn a6d08b80bc a11y: Use OAccessibleComponentHelper::isAlive
Use it to implement (inverted) logic in
AccessibleContextBase::IsDisposed and replace uses
of the latter in subclasses by using the (protected)
OAccessibleComponentHelper::isAlive directly.

Change-Id: Ib033097dfac9e7a986cb0334caf7ac568ad4300a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184793
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-29 23:12:08 +02:00
Michael Weghorn 332fb61097 editeng a11y: Drop AccessibleContextBase::getAccessibleIndexInParent
The base class implementation in
OAccessibleComponentHelper::getAccessibleIndexInParent
already implements the same logic.

Change-Id: I4bd338632c4e440a54470f1294a9e67a0ccb866d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184000
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-11 10:40:23 +02:00
Michael Weghorn fcd88d5ceb editeng a11y: Drop AccessibleContextBase::ThrowIfDisposed
Use the equivalent base class method
OAccessibleComponentHelper::ensureAlive instead.

Change-Id: I17a87b743d2a7b324cd4ae04cb1b924c676f0195
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183979
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-10 19:45:00 +02:00
Michael Weghorn b5d4af2a72 editeng a11y: Inline AccessibleContextBase::FireEvent to only caller
Change-Id: Ia7ca4b39dc0917b05326e747820688eeb6c45343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183978
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-10 19:44:51 +02:00
Michael Weghorn a2baa12f90 editeng a11y: Pass bullet's child index in ctor
... instead of having a separate getter,
AccessibleImageBullet::SetIndexInParent.

Change-Id: Ie0e59f87e12d04efd72aa5663c4a3eb0df9baf21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183829
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-08 17:13:02 +02:00
Michael Weghorn bafaf554a0 editeng a11y: Drop AccessibleImageBullet::FireEvent
Use base class method OAccessibleComponentHelper::NotifyAccessibleEvent
directly instead. That one has the reverse order for the old/new value
params, and no default for the old value, so adjust callers accordingly.

Change-Id: Ib591495c5698832a99cd60854d4ee8aa4a206442
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183828
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-08 17:12:55 +02:00
Michael Weghorn 7bf384d048 editeng a11y: Use OAccessibleComponentHelper for bullet
Let editeng's AccessibleImageBullet derive from
OAccessibleComponentHelper to make use of the
logic already implemented there instead of having to
implement all the XAccessibleComponent
and XAccessibleEventBroadcaster methods manually.

The existing AccessibleImageBullet::implGetBounds
implementations provide the necessary logic to implement
OAccessibleComponentHelper::implGetBounds, so mark it
as overriding the base class method.

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

No change in behavior intended or observed in a quick
test with Impress and Accerciser and the gtk3 VCL plugin
on Linux.

Sample steps to add a bullet item that shows
up in the a11y tree:

1) start Impress
2) Create a new slide (Ctrl+M)
3) type text "Hello world" for the first list item
4) right-click on paragraph to open context menu, select "Bullets and
   Numbering"
5) For "Type", select "Graphics"
6) select "Select image..." -> "Gallery" -> "bluearrow"
7) close dialog with "OK" button

Then, start Accerciser, and locate the "Image bullet"
object within LibreOffice's a11y tree.

Change-Id: Iba9d44288be96838e39d7cee2333f7a074deae8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183783
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-08 17:12:49 +02:00
Michael Weghorn 785fc3e497 editeng a11y: Drop unnecessary exception handling code
Modifying a sal_Int64 value won't throw an exception.

Change-Id: Ia5739ecebb839dfcd51c27f35309ad717b505c56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183782
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-08 17:12:42 +02:00
Michael Weghorn 50190bec99 editeng a11y: Simplify AccessibleImageBullet::FireEvent
* Drop const qualifier, which removes the need to const_cast.
* Don't call AccessibleImageBullet::getAccessibleContext,
  but just use `this` directly.

Change-Id: I4949ec624e44b6330a0ca5f71f898f1d17b4bd8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183781
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-08 17:12:34 +02:00
Michael Weghorn c040f9a390 editeng a11y: Let paragraph dispose its bullet child
Instead of letting AccessibleImageBullet dispose
itself in AccessibleImageBullet::SetEditSource when
called with a null edit source, let the AccessibleEditableTextPara
that created the bullet and can therefore be considered the
owner (see AccessibleEditableTextPara::getAccessibleChild) dispose it
again in AccessibleEditableTextPara::dispose.

Also clear `maImageBullet`.

This is similar to

    commit 138bc16c9a
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Apr 3 11:59:51 2025 +0200

        editeng a11y: Let para manager dispose its child

Change-Id: I8083b0c9bf304942e9ead446bdeaefeb62ae609f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183780
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-08 17:12:27 +02:00
Michael Weghorn 4e892def7b editeng a11y: Drop empty lines at beginning of methods
Change-Id: Ib25bc28adab2e220c4fe3056413a6fac10fcbdc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183779
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-08 17:12:21 +02:00
Michael Weghorn 2efc261bf9 editeng a11y: Drop extra indentation level
Change-Id: I1d2f37499b5b1634141f9023815b0cb5ac1f4f18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183778
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-08 17:12:15 +02:00
Michael Weghorn a28db0efd2 editeng a11y: Use usual 4 spaces to indent one level
... instead of 6

Change-Id: I27585734069f76d7d535c01760d0bd2085f51051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183707
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-04 14:46:49 +02:00
Michael Weghorn 72f62009c9 editeng a11y: Use OAccessibleComponentHelper for paragraph
Let editeng's AccessibleEditableTextPara derive from
OAccessibleComponentHelper to make use of the
logic already implemented there instead of having to
implement all the XAccessibleComponent
and XAccessibleEventBroadcaster methods manually.

The existing AccessibleEditableTextPara::getBounds
implementations provide the necessary logic to implement
OAccessibleComponentHelper::implGetBounds,
so rename those accordingly (and drop the extra mutex
guard, as the base class takes care of that).

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

No change in behavior intended or observed in a quick
test with text in Impress slides and Accerciser and Orca
when using the gtk3 and qt6 VCL plugins on Linux.

Change-Id: I5cb47eb9c6738f4bd7807cbeef260151437c0862
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183681
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-03 22:31:54 +02:00
Michael Weghorn 5348c79e01 editeng a11y: Simplify AccessibleEditableTextPara::FireEvent
* Make method non-const, which avoid the need to const_cast.
* Just use `this` directly instead of calling
  `getAccessibleContext`, which returns a reference to `this`
  again.

This also prepeare for turning AccessibleEditableTextPara
into an OAccessibleComponentHelper subclass in an
upcoming commit.

Change-Id: I74526e47070979ce34e89c165843ca3a5a9b1f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183680
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:31:46 +02:00
Michael Weghorn 138bc16c9a editeng a11y: Let para manager dispose its child
Instead of letting AccessibleParaManager dispose
itself in AccessibleEditableTextPara::SetEditSource when
called with a null edit source, let the AccessibleParaManager
that created the paragraph and can therefore be considered the
owner (see AccessibleParaManager::CreateChild) dispose it
again in AccessibleParaManager::Release.
This is consistent with how it also explicitly disposes
all children in AccessibleParaManager::Dispose.

This is the only place that calls AccessibleEditableTextPara::SetEditSource
with a null param, so this change shouldn't change behavior
in any way.

Change-Id: I9d6ec8db69a789c18fd424e680624744b4913798
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183679
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:31:38 +02:00
Michael Weghorn 2f2f3ab30c editeng a11y: Deduplicate bullet text length calculation
Add a helper method AccessibleEditableTextPara::GetBulletTextLength
instead of duplicating the same logic 6 times in different places.

Change-Id: I8f9fa307fe52c84ca0200126061c5a957c7e02ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183677
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-03 22:31:30 +02:00
Michael Weghorn eeb2023398 editeng a11y: Simplify AccessibleStaticTextBase::GetParagraphBoundingBox
Change-Id: I0bcc4d5ee3c6d9f976688cb25e7b6a3234d78da2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183676
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:31:23 +02:00
Michael Weghorn e8d45fe35e editeng a11y: Drop custom WeakCppRef, use unotools::WeakReference
Use the existing unotools::WeakReference instead of the
custom WeakCppRef template class to hold weak references
to the AccessibleEditableTextPara objects in
AccessibleParaManager.

An AccessibleEditableTextPara forward-declaration is not
sufficient to use
unotools::WeakReference<AccessibleEditableTextPara>, so
re-arrange includes/forward-declarations a bit.

Drop the now unused WeakCppRef.

Change-Id: I54553059a7cb36515109573c5b22d73738b1c46f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183672
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:58 +02:00
Michael Weghorn d6a34a8c5b editeng a11y: Use unotools::WeakReference for bullet
Replace use of the custom WeakCppRef template class
for AccessibleEditableTextPara::maImageBullet by
unotools::WeakReference which provides the
same functionality (a weak reference and access
to the the concrete implementation class).

Change-Id: I333f467caeb4925d718313e679507f45c9c96e00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183671
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:49 +02:00
Michael Weghorn 6934cf9418 editeng a11y: Simplify AccessibleParaManager::CreateChild
Both callers are only interested in the XAccessible
in the returned std::pair, so let the method only
return that instead of the pair.

Drop the now unused AccessibleParaManager::Child typedef.

Change-Id: I2b271de7b3e668be982b01bd183e0c39d47f444d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183670
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:42 +02:00
Michael Weghorn 4397edc75d editeng a11y: Replace auto and adhere to naming scheme
This makes more obvious that the child is a
rtl::Reference<AccessibleEditableTextPara> here, which
is otherwise a bit harder to see with all the typedefs etc.
involved.

Change-Id: Id9d0c2457813b7e0fed34b0ce8fe52553ef6a39d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183669
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:34 +02:00
Michael Weghorn 1f91b8e0cb editeng a11y: Inline AccessibleParaManager::ShutdownPara in only caller
Change-Id: I27f86a476b6c4c7c90f4c26baff30cc1a525d9b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183663
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:27 +02:00
Michael Weghorn 037896a309 editeng a11y: Replace ReleaseChild class with lambda
Change-Id: I0b036aebb481e3fe45fcad890a7f2227bc734142
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183662
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-03 22:30:20 +02:00
Michael Weghorn a39bc80a3a editeng a11y: Drop AccessibleStaticTextBase::mpThis etc.
AccessibleStaticTextBase::mpThis is only used to
pass it to Exception ctors, so it seems a bit
overkill to have to manage it for that purpose.

Drop it and the corresponding setter
AccessibleStaticTextBase::SetEventSource.
Its doc says that the interface is also used
as the event source for a11y events, but that's
not actually the case.

Also drop ScAccessibleCell::Init which now no
longer needs to override the base class implementation,
ScAccessibleCellBase::Init.

Change-Id: Ide64cf2e59bfb9ae7df41171cc36e1df0c86eb9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183628
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:30:13 +02:00
Michael Weghorn 385b1fa3d3 editeng a11y: Merge AccessibleStaticTextBase{,_Impl}
Merge AccessibleStaticTextBase_Impl into
AccessibleStaticTextBase.

Further simplification will be possible in
upcoming commits.

Change-Id: I4f0067c2cf1cb5b2f464b8075bc4a64f44d7babc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183627
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-04-03 22:30:05 +02:00
Michael Weghorn 9b892757d2 editeng a11y: Drop extra indentation level
Change-Id: I5f2d99730cfda9490c3fa9fa43242e0d5219ca82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183626
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:29:57 +02:00
Michael Weghorn 053365d29e editeng a11y: Drop paragraph's a11y description
So far, "paragraph <number>" and the (start of) the
paragraph text were reported as the accessible description
of the paragraph.

This resulted e.g. in Orca saying something like
"Paragraph 0: Hello world Hello world" when moving cursor
to a paragraph containing the text "Hello world" in Impress,
because both, a11y description and the text reported via the
AtspiText interface were reported.

Drop the a11y description, which is also consistent with Writer
where no description is reported. The

    // (writer takes first sentence here, but that's not supported
    // from EditEngine)

comment dropped along with this commit looks outdated.

The fact that this is a paragraph is already reported via the
a11y role and the text is reported via the XAccessibleText
interface. (The information which paragraph this is could
be retrieved by checking the children of the paragraph's
parent, so if an AT wanted to report that, it could
implement corresponding logic on the client side.)

Adjust the Impress a11y test originally added in

    commit 6185a27db4
    Author: Colomban Wendling <cwendling@hypra.fr>
    Date:   Sun Jul 31 17:20:03 2022 +0200

        tdf#150064 Add tests for a11y tree order

        Check the tree order is stable across loads and page switches.

accordingly, which included the description in
the expected output, but that's not the purpose
of the test.

Also adjust the sw a11y test
(test::AccessibleTestBase::BasicTestFontworkDialog) accordingly.

Change-Id: Ifbc1a15a976d7488396630c6bc3c9e42ba26ccc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183625
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:29:50 +02:00
Michael Weghorn 64ab001207 editeng a11y: Rely on XAccessibleContext implementing XAccessiblecomponent
Only query the XAccessibleContext of the parent
accessible for the XAccessibleComponent interface,
not the XAccessible first and the XAccessibleContext
only as fallback.

As far as I understand it, the XAccessible is only there
to allow retrieving the XAccessibleContext using
XAccessible::getAccessibleContext and all other logic
should be implemented in the class implementing
the XAccessibleContext interface.
That's also what the platform bridges rely on, see
e.g. `getComponent` in vcl/unx/gtk3/a11y/atkcomponent.cxx.

If there's any case where this is handled differently,
that one should likely be adjusted to match the pattern
used everywhere else, too, instead of having special
handling here in AccessibleEditableTextPara.

(In most cases, it's the same class that implements both,
the XAccessible and the XAccessibleContext interface
anyway.)

Change-Id: Ic03c11f8406213f5f44074e39fe867b4e8b93dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183624
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-03 22:29:44 +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 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 46f7fad86d editeng a11y: Use OAccessibleExtendedComponentHelper
Let editeng's AccessibleContextBase 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.

Adjust the various subclasses accordingly as well.

Make OCommonAccessibleComponent::addAccessibleEventListener
and OCommonAccessibleComponent::removeAccessibleEventListener
no longer final so that AccessibleShape can override them
(to add/remove the listener for the AccessibleTextHelper
 object in addition to calling the base class implementation).

The existing XAccessibleComponent::getBounds implementations
provide the necessary logic to implement
OAccessibleExtendedComponentHelper::implGetBounds,
so rename those accordingly (and drop the extra guards,
as the base class takes care of that).

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

No change in behavior intended or observed in a quick
test with Impress and Accerciser and Orca when using
the gtk3 and qt6 VCL plugins on Linux.

Change-Id: I7c42a9cac1099991bc5763b87c55ace2b0fed8a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183549
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:19:58 +02:00
Michael Weghorn 369ddbbafc editeng a11y: Drop dummy XAccessibleComponent implementations
Leave these 2 methods purely virtual in AccessibleContextBase,
as this depends on subclasses overriding them to function properly.

Change-Id: I52121e18f8bb0c76d8b588a7e09b3cca9f09232d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183544
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:19:45 +02:00
Michael Weghorn 18b7dc796f editeng a11y: Merge Accessible{Context,Component}Base
AccessibleContextBase and AccessibleComponentBase
are both subclassed by the exact same classes.

Merge AccessibleComponentBase into AccessibleContextBase
to simplify the class hierarchy.

Drop now unnecessary overrides.

This also aligns AccessibleContext further
with the comphelper::OAccessibleExtendedComponentHelper
class that also implements both, XAccessibleContext
and XAccessibleExtendedComponent, and thus also prepares
for potential refactoring to deduplicate code in those
two classes in the future.

Change-Id: Ia3331f2bd4563bf9cdfee35c9ea6cca91bd093cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183543
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-04-01 11:19:38 +02:00
Noel Grandin 22f46bd89f use more concrete UNO classes
Change-Id: Id10786bbf7985adbb251224b45f9dabcc84d0a3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-10 14:18:35 +01:00
Marc Mondesir b3d5a3d7a7 tdf#75280: Convert sal_uIntPtr use to operator >>= Color.
Replace casts to sal_uIntPtr, then to other types with operator >>= Color.

Change-Id: Ib30370da83f3f653f8c5816e4d88cc5381ae648b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177303
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-01-22 08:14:40 +01:00
Mike Kaganski cd9976d2b1 Avoid needless temporary Sequence creation
Change-Id: Ia0b6df8b329136292917c94ee5d5e69a0931a200
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178056
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-12-07 22:13:44 +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