By now, almost all a11y implementations implement both,
the XAccessible and XAccessibleContext interfaces themselves,
and they do so via the OAccessible base class.
One remaining case that only implements the XAccessible interface
directly is UnoControl. XAccessible::getAccessibleContext
is used from within AccessibleControlShape::Init to get the
accessible context. That accessible context however
is an OAccessible and implements both, the XAccessible
and XAccessibleContext interfaces again.
Stop requiring that UnoControl implements XAccessible
by instead adding a dedicated new method UnoControl::getAccessible
to directly get the OAccessible without relying on
the XAccessible interface being implemented by UnoControl.
In AccessibleControlShape::Init, cast to UnoControl
instead of querying for the XAccessible interface
and call the new method directly.
Stop implementing the XAccessible interface in
UnoControl as it is no longer needed now.
This aligns the UnoControl a11y logic more with how
a11y is implemented elsewhere across the code base.
Sample steps to trigger the modified code
when using the gtk3 vcl plugin on Linux:
* start the Orca screen reader
* start Writer
* insert a few push button controls using
"Form" -> "Push Button" and then clicking into
the document and dragging to insert
* disable design mode using "Form" -> "Design Mode"
* focus one of the controls by clicking on it
* press the Tab key to move focus between the controls
No differences in behavior were observed when
doing this with or without this change in place.
Side note: Announcement of the controls when they
receive focus didn't work (reliably) when opening an
existing document containing form controls instead of
inserting them into a new one, but that is preexisting
and unrelated to this commit.
Also adjust test AccessibleFixedTextTest::testFixedText
of the CppunitTest_toolkit_a11y test suite
accordingly that was assuming that it can
query the XAccessible interface directly
from the UNO control.
Change-Id: I8cc3902a8de725eda3d810920f1da2d390c06f73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210464
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Pass the more concrete OAccessible instead of a reference
to the abstract XComponent UNO interface.
Change-Id: Idcbf5c1eb09cc1380a85410b76d8b1e2df022b6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210460
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Switch from using a weak reference (css::uno::WeakReferenceHelper)
to the abstract XAccessibleContext UNO interface to a weak
reference (unotools::WeakReference) of the more concrete
OAccessible class in UnoControl.
This makes clear that the accessible is always an OAccessible
subclass and allows dropping some UNO-querying for the
wanted UNO interfaces.
Change-Id: Ib1ea66c83da9bbf76891c492d84aa57c396f2f44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210459
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
While accessibility logic for vcl::Window and subclasses
was previously split between vcl::Window and
VCLXWindow, vcl::Window now takes care of everything
to create an XAccessible without involving VCLXWindow
now after
Change-Id: I25de1ab0f8b47b12346abd01bad05cb54fb75f52
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Mon May 26 09:45:11 2025 +0200
vcl a11y: Let vcl::Window create accessible directly, drop a11y factory
(and previous changes for vcl::Window subclasses).
Therefore, drop the remaining a11y logic from
VCLXWindow.
No longer let it implement the XAccessible and
XEventListener interfaces.
The latter was only implemented to clear the
reference to the accessible context in
VCLXWindow::disposing, but VCLXWindow now no longer
holds such a reference with this commit in place.
Drop calls to (the now nonexistent) VCLXWindow::disposing
in subclasses (and drop overrides now only calling
base class methods from another subclass).
vcl::Window::dispose already takes care of disposing the
window's XAccessible, so disposing the XAccessibleContext
in VCLXWindow::dispose is no more needed.
(VCLXAccessibleComponent implements both, the XAccessible
and XAccessibleContext interfaces.)
Change-Id: Ided896abdc84cfbbf883621020169699a37cf6df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185844
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This fixes the following lolugin build error caused by
an a11y change series of mine colliding with
commit 8c33382691
Date: Tue Jun 17 12:26:32 2025 +0200
loplugin:unnecessaryvirtual
and not caught by CI because my series was based on an
older master not containing that commit yet.
In file included from /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:35:
/home/michi/development/git/libreoffice/include/toolkit/awt/vclxwindow.hxx:80:21: error: this member function can be declared static [loplugin:staticmethods]
79 | css::uno::Reference< css::accessibility::XAccessibleContext >
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80 | CreateAccessibleContext();
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:861:65: note: defined here: [loplugin:staticmethods]
861 | uno::Reference< accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
862 | {
| ~
863 | assert(false && "This code path shouldn't be reached any more.");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
864 | return {};
| ~~~~~~~~~~
865 | }
| ~
1 error generated.
Change-Id: Ia645d2c81331dc5d8e871b105804722bfe9168eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186723
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
This is the equivalent of
commit f82aac71ed
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
for Edit subclasses, see that commit's message for more background.
Since all of DateField, TimeField, MultiLineEdit and VclMultiLineEdit
are (not necessarily direct) subclasses of Edit and none of their
subclasses further up the class hierarchy than Edit override
Edit::CreateAccessible, there is no need for them to do so either,
but they can use the Edit implementation. Therefore, just drop the
corresponding methods of their VCLXWindow subclasses that were
calling `AccessibleFactory::createAccessibleContext(Edit* pEdit)`
explicitly.
(Before
Change-Id: Ifb7452de3e011a73aa798d1ea0302bbbc74ed7d2
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 20:13:09 2025 +0200
vcl a11y: Set DateField/TimeField window type in ctor
, two of them had some additional extra logic that might
have required them to override the base class implementation.)
Since VCLXAccessibleEdit implements the XAccessible interface
now, its SVTXAccessibleNumericField subclass no longer needs
to implement that directly.
Change-Id: I5fe96a9061afb9f51e494cdd41a27636d0aa4d74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185838
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This is the FormattedField equivalent of
commit f82aac71ed
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I81e196680cc976b73ab029e595713e616ea90bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185692
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Since
Change-Id: I26249401d9bcde81908553cc01521ac0ead338dd
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 19:37:35 2025 +0200
vcl a11y: Let HeaderBar create its accessible directly
, the class doesn't add any functionality to its VCLXWindow
base class, so drop it altogether and just use plain
VCLXWindow instead.
Change-Id: I288103d2681a81c3828e311c9b12b7aee1ec1f85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185691
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is basically the HeaderBar equivalent of
commit f82aac71ed
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
In this case of HeaderBar, there is already an existing
HeaderBar::CreateAccessible method that was handling
the case where a custom function to create the XAccessible
was set and the default vcl::Window logic going via the
VCLXWindow/AccessibleFactory was only triggered otherwise.
Handle that case also directly in there instead.
Change-Id: I26249401d9bcde81908553cc01521ac0ead338dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185690
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Since
Change-Id: Ib6a6746f7fcbcacddc4cc05a00cf63fe04407f80
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 19:21:33 2025 +0200
vcl a11y: Let ToolBox create its accessible directly
, the class doesn't add any functionality to its VCLXWindow
base class, so drop it altogether and just use plain
VCLXWindow instead.
Change-Id: I2ef8efa06dc04e5e9b18dc743575666d41ce5648
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185689
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This is the ToolBox equivalent of
commit f82aac71ed
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: Ib6a6746f7fcbcacddc4cc05a00cf63fe04407f80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185688
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the ComboBox equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I8ae7a8a53fa04088ab9130d0905498eb45ad46ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185687
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the ScrollBar equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I0d8759b699fea20ccf8bea9ec897879f6e3e07b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185686
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the FixedText equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: Id3cbc91d6217bbca2d0e770f4fa4813377c10fe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185675
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the FixedHyperlink equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I2b4f1bd25b4f925bdc7d51948057fbc66c718404
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185674
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the ListBox equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: Ife6382fe72b245b5df2742a17000cf8bb29112b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185673
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This is the RadioButton equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I0bfe50d36250074e21df42ff046a97095b198b71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185672
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This is the CheckBox equivalent of
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu May 22 12:30:12 2025 +0200
vcl a11y: Let PushButton create its accessible directly
, see that commit's message for more background.
Change-Id: I6b6ead743cde3489935a902fed9b63d78fd642f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185671
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
So far, the VCLXButton was the XAccessible implementation
for PushButton (and subclasses), which got returned in
Window::CreateAccessible.
VCLXButton's implementation of XAccessible::getAccessibleContext
was then responsible for creating the XAccessibleContext,
a VCLXAccessibleButton.
Drop that separation between XAccessible and XAccessibleContext,
let VCLXAccessibleButton also implement the XAccessible interface
itself, and override Window::CreateAccessible in
PushButton to create the VCLXAccessibleButton directly without
requiring the VCLXButton and AccessibleFactory for this.
This is one step towards unifying the approach for all vcl::Window
subclasses (some were already creating their accessibles
directly), makes responsibilities clearer (currently
shared between vcl::Window and VCLXWindow) and prepares
for more upcoming a11y changes (towards making
VCLXAccessibleComponent/OAccessibleComponentHelper implement both,
XAccessible and XAccessibleContext).
Similar changes for other vcl::Window subclasses will follow.
Internal code previously depending on the fact that a vcl::Window's
VCLXWindow/XWindow was its XAccessible was adjusted previously in
commits like
commit b1f3e41f10
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed May 21 11:03:56 2025 +0200
sw a11y test: Don't rely on XWindow being XAccessible
If this commit causes any issues, there might be
another place requiring a similar change.
According to the discussion in [1], there might be third-party
code (unrelated to a11y except for using UNO a11y API) also
relying on the assumption that the vcl::Window's XAccessible
is its VCLXWindow, but the UNO a11y API is an internal
implementation detail explicitly unpublished in
commit 70626249cd
Date: Thu Nov 29 00:27:03 2012 +0100
API CHANGE a11y unpublishing and add/removeListener rename.
and has no stability guarantuee whatsoever and is therefore
not meant to be used by external users. If any third-party
code was relying on this implementation detail, it should be
ported away from relying on UNO a11y API.
If there were a desperate need to still be able to
retrieve the XAccessibleContext via the VCLXWindow/XWindow
(at least temporarily) somehow, a (temporary) workaround
once this commit and corresponding upcoming commits are in place
could be to let VCLXWindow still implement the XAccessible
interface and return the XAccessibleContext from the window's
actual XAccessible in VLCXWindow::getAccessibleContext.
But in my opinion, code relying on that assumption should really
be adjusted instead, also to avoid breaking again when unpublished
UNO a11y API changes again in the future.
[1] https://gerrit.libreoffice.org/c/core/+/185597/comments/48aae563_7c620891
Change-Id: If6fa82008f3347c4f95538ab181eaa50c7d9636b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185670
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
XWindow2 subclasses XWindow, so there's no need for
a VCLUnoHelper::GetWindow variant taking an XWindow2
reference that does the same as the variant taking
an XWindow reference.
Change-Id: I6f931252d2ae2e046dc31c076094e71b8aa71346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185273
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Drop the com.sun.star.accessibility.GetStandardAccessibleFactoryService
UNO service that was used to create instances of
the a11y classes for (mainly vcl) widgets.
The service was needed to break a dependency cycle.
However, with
Change-Id: Ib46c87446dc9121d3b8e735e0e5a40594da73cc5
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Tue Dec 17 12:04:04 2024 +0100
a11y: Merge accessibility module into vcl
and all the preparatory commits in place, there
is no more dependency cycle, as the a11y classes
for vcl widgets no longer depend on any modules
"above" vcl.
Therefore, drop the UNO service and the abstract
vcl::IAccessibleFactory class and other related
classes.
Make all methods in the AccessibleFactory class
(that was previously subclassing the abstract
IAccessibleFactory) static helper methods,
and call them directly.
The UNO service dropped in this commit was
introduced in
commit 1af510e951
Date: Wed Feb 21 11:30:47 2024 +0200
Create an UNO service to do the symbol lookup in toolkit::AccessibilityClient
and its documentation was already clearly stating
that it's only meant for LibreOffice internal use:
> /**
> The toolkit module uses this to get a pointer to the AccessibleFactory from the acc module.
> Because we have a dependency in our modules that goes the "wrong" way.
>
> @since LibreOffice 24.8
>
> @internal
>
> ATTENTION: This is marked <em>internal</em> and does not
> have the <em>published</em> flag, which means it is subject to
> change without notice and should not be used outside the LibreOffice core.
> */
Change-Id: Ib97396a4bad486d9530361dd851ad3ee0f9681b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178689
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
toolkit::IAccessibleFactory and
vcl::IAccessibleFactory are abstract classes
providing methods to retrieve the XAccessible or
XAccessibleContext for different vcl widgets.
Both are implemented by the same class in the
accessibility module: AccessibleFactory
Merge toolkit::IAccessibleFactory into
vcl::IAccessibleFactory to have things in
one place, and have everything in vcl, i.e.
no longer part of it in toolkit that itself
depends on vcl.
Change-Id: I5da571899c9987267cbec2950630d0c44ff4d2f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178643
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
After
commit 168512dce7
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Dec 12 18:06:13 2024 +0100
a11y: Stop using VCLXWindow in vcl a11y classes
and further related commits, VCLXAccessibleComponent
no longer depends on anything in the toolkit module,
so move it from there to vcl.
This way, subclassing VCLXAccessibleComponent (as the
a11y classes for vcl widgets do, currently located in
accessibility/ ) no longer introduces a toolkit
dependency.
Change-Id: I4fd33fb1dc2265d75e8ca9ad87bcc70db61639d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178434
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Adjust VCLXAccessibleComponent and subclasses to take
a vcl::Window arg instead of a VCLXWindow in the ctor
and drop the VCLXAccessibleComponent::m_xVCLXWindow member
that used to hold a reference to the VCLXWindow.
(VCLXAccessibleComponent still holds a VclPtr
to the corresponding vcl::Window.)
Instead of passing the UNO/toolkit peer (VCLXWindow
and subclasses) to the AccessibleFactory to create
an XAccessibleContext context for the underlying VCL
widget, pass the underlying vcl widget, which can
now be passed as is to the corresponding ctors
of VCLXAccessibleComponent and specialized subclasses.
This follows earlier commits replacing the use of the
VCLXWindow classes by direct uses of the vcl::Window
subclasses inside VCLXAccessibleComponent and subclasses
and is the next step in reducing the UNO/toolkit
dependency in the accessibility implementation for
vcl widgets.
For now, the logic where those accessible objects
are created remains in VCLXWindow::CreateAccessibleContext
and overrides, but that can change in the future.
`IAccessibleFactory::createAccessibleContext(VCLXMultiLineEdit*)`
is just dropped and doesn't need its own replacement:
The previous VCLXMultiLineEdit variant was
creating a VCLXAccessibleEdit like the variant
taking a VCLXEdit, but VCLXMultiLineEdit doesn't
subclass VCLXEdit.
The vcl MultiLineEdit however subclasses Edit,
so VCLXMultiLineEdit::CreateAccessibleContext can make
use of `IAccessibleFactory::createAccessibleContext(Edit*)`
as well now.
This also implements what was mentioned in earlier
commit
Change-Id: I67bb7a6a237e57d0c522790c09a595c02ac06325
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Dec 12 17:16:29 2024 +0100
sw annotation win a11y: Skip VCLXWindow logic
:
> Drop the comment about the code being dodgy from
> SwAnnotationWin::CreateAccessible. This commit partially
> addresses it and switching VCLXAccessibleComponent
> to using the vcl::Window will take care of the rest,
> see upcoming commit
> Change-Id If0894e733273eecad268c6a932ecee7c2e34b4c2
> ("a11y: Stop using VCLXWindow in vcl a11y classes").
Now that the VCLXAccessibleComponent ctor takes a
vcl::Window, the sw::annotation::SwAnnotationWin
can be passed directly.
From a user perspective, no change in behavior is
intended by this commit.
Change-Id: If0894e733273eecad268c6a932ecee7c2e34b4c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178385
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Other than most of the a11y implementations for vcl
classes, VCLXAccessiblePopupMenu etc. do not
make use of any VCLXWindow (i.e. UNO/toolkit wrapper of a
vcl::Window) and thus do not depend on the toolkit
module, which the accessibility module depends on.
Therefore, there's also no need to use the accessible
factory to create them (which is needed when toolkit
classes are involved to avoid a dependency cycle).
Move those classes from the accessibility module to
vcl and add a new method Menu::CreateAccessible and
move the logic from AccessibleFactory::createAccessible
there. Drop the now unnecessary factory methods
previously used for those classes.
No change in behavior intended (yet), but this
also simplifies the code involved for the
tdf#164093 scenario.
Change-Id: Ie3f6f1a02bf6662206d31383473cdc868e1f9164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177812
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
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>
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>
Pass arguments right away in ctor rather than
having a ctor that takes no arguments and then
having to call VCLXFont::Init with the arguments
right after calling the ctor.
Change-Id: I651e27154499f61638409377438f9589bc7412a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177795
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
...by providing a non-inline key function for that class. This would have
prevented the issue that has been addressed by
2fe53b2e43 "Fix crash due to unexpected
dynamic_cast failures in optimized build", where a dynamic_cast to VCLXPopupMenu
failed on macOS (which uses pointer equivalence to determine RTTI equivalence),
because VCLXPopupMenu is final, so the compiler, at least in optimized builds,
just used a comparison between the object's recorded RTTI (from dylib A) against
the type's RTTI in dylib B, which erroneously failed.
Change-Id: I68ff864c266bf28d19032527f91de592ca1437f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176188
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
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>
There are currently (at least) 2 sets of helpers
for converting from AWT to VCL point, rectangle
and size classes - and the other way around:
* the ones in `include/toolkit/helper/convert.hxx`
* the ones provided by `VCLUnoHelper`
Align the `VCLUnoHelper` implementations with the
ones in `include/toolkit/helper/convert.hxx` and
make them inline as well.
Switch params from the specific subclasses to the
more generic base classes as well
(e.g. `css::awt::Point` -> `PointTemplateBase`).
Otherwise, `VCLUnoHelper::ConvertToVCLRect` is the only one
that didn't implement the functionality in the
exact same way as the counterpart, `VCLRectangle`,
as it was manually calculating the right and bottom
edges.
The `VCLRectangle` implementation
gives the same result for valid rects, so take over
that one. (It shouldn't make a difference for the
only 2 current callers, `ControlHolder::getPosSize`
and `VCLXGraphics::clear`.)
This commit is in preparation of consolidating all uses
to use the `VCLUnoHelper` variants and getting
rid of the other one in following commits.
Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170316
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
...where "Referer" is now passed in as an additional property, so that the
relevant objects can decide whether to obtain graphics while loading a document
Change-Id: Ie3dabc574861713212b906a0d7793f438a7d50a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168674
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
I had done these a while ago, when I looked into extending loplugin:ostr to do
more automatic rewriting, and these were places where I needed to do something
manually, for one reason or another, because the automatic rewriting would not
pick it up correctly.
However, I got distracted, and a wholesale automatic rewrite would still run
into cases where an _ostr/_ustr instance from a library's .rodata would still be
referenced after the library has already been dlcose'd. So I never came around
to finishing all that.
But there appears to be renewed interest in (automatic) rewritings here now, so
it probably makes sense if I share this part of my work anyway.
Change-Id: I3da9d38398e4bca373cb0000a9d34b49a36ad58a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166792
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
using the bin/find-can-be-private-symbols.py script
to find classes with large numbers of exported symbols
that can hidden.
before
exported = 58104
imported = 30810
unused_exports = 35433
after
exported = 55094
imported = 31073
unused_exports = 32423
Change-Id: Idd0a70ee3740afd5ca1a86771e0e2ff8090d102d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163456
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>