Commit Graph
2646 Commits
Author SHA1 Message Date
Noel Grandin 00659bcdbb improve readability of VirtualDevice constructor
(a) It is not obvious what DeviceFormat::DEFAULT means
(b) There are two parameters (each with two states), but only really 2
possible overall states

So
(1) use more useful names
(2) combine the two parameters into one enum

Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-07 10:19:32 +00:00
Stephan Bergmann bbe70a7e3d Use ImplInheritanceHelper in OAccessibleControlContext
Change-Id: I11d8f487df0c9e707be6a2aa98a32135643552f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146110
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-25 18:55:06 +00:00
Stephan Bergmann 5c312c986e Use ImplInheritanceHelper in VCLXAccessibleComponent
Change-Id: I300f033054bddc2c0ee1973dbafc108c477bf09a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146103
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-25 06:44:18 +00:00
Stephan Bergmann 579d144290 Fix some toolkit UnoControlBase derivates' queryAggregation
The base UnoControl uses WeakAggImplHelper9, so (for better or worse) derives
from XAggregation, but UnoGridControl, UnoRoadmapControl, and UnoTreeControl all
failed to properly implement the XAggregation protocol.

Change-Id: Ia1676782e616216f645dc86ba978c2f5887dc508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145767
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-19 09:53:24 +00:00
Noel Grandin d21260708b XUnoTunnel->dynamic_cast in VCLXGraphics
Change-Id: Ia401542ec8249809ad16dadd79c51aa025044b42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145534
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 08:41:00 +00:00
Noel Grandin 8081533f7c XUnoTunnel->dynamic_cast in VCLXBitmap
Change-Id: I2cf42ac720184bc2b8b89ced5564dbb95e7dc1ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145535
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 08:40:47 +00:00
Noel Grandin 0160109aae XUnoTunnel->dynamic_cast in GridColumn
And use the concrete type in DefaultGridColumnModel, which already makes
such an assumption

Change-Id: I4c91d46f1889ebe22b6c031a8aabe4e8957addec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145531
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 06:42:12 +00:00
Noel Grandin 96cd662366 XUnoTunnel->dynamic_cast in VCLXPointer
Change-Id: I322115c214de5d476f84650eb53dae8452d5d1a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145533
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 06:41:53 +00:00
Noel Grandin e5092fdf24 XUnoTunnel->dynamic_cast in VCLXRegion
Change-Id: I75956a2c713d52c01dcfd47fc0b8506ba526523e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145532
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-16 06:41:46 +00:00
Noel Grandin 8d97a90564 XUnoTunnel->dynamic_cast in VCLXMenu
Change-Id: Iee992e2e09647a7678fd05321e601a4c5bf0c430
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-14 10:51:22 +00:00
Noel Grandin 678747f950 XUnoTunnel->dynamic_cast in UnoControlModel
Change-Id: I0d8a65aa16583fcb6c8201589b2d356da0be5cac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145482
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-14 06:36:58 +00:00
Noel Grandin a6d44c4684 XUnoTunnel->dynamic_cast in VCLXFont
Change-Id: I4afa34805e64f3ff37b76fe8ca4676c1f4eb3e14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145468
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-13 13:43:56 +00:00
Noel Grandin 172aedbc51 XUnoTunnel->dynamic_cast in VCLXDevice
Change-Id: I9fa06600d3b9a2172a1818f89a3b9c06d65c8c54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145467
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-13 12:53:27 +00:00
Stephan Bergmann f1d00da1bb OAccessibleImplementationAccess was apparently effectively unused by now
...as there were no calls to its OAccessibleImplementationAccess::getUnoTunnelId
so no code apparently made use of that XUnoTunnel

Change-Id: I35d392999f1c28e81f7ff4bf395f63642eb17bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145250
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-10 10:21:16 +00:00
Stephan Bergmann a58abb4296 Clean up VCLXAccessibleComponent::getAccessibleParent
...after 21e0d8162a "loplugin:unusedfields" had
dropped the base class
OAccessibleImplementationAccess::implGetForeignControlledParent

Change-Id: I753aad41baaa0ac1d1f7eb0a6084993df5a58d5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145197
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-09 15:15:41 +00:00
Arnaud VERSINI 555f433318 use std::this_thread::sleep_for instead of osl equivalent
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-09 08:37:35 +00:00
Stephan Bergmann ec98e77690 Merge comphelper::OAccessibleContextHelper into comphelper::OCommonAccessibleComponent
Change-Id: I586ae8fe2842fd879ae2ae506c659d06dda16843
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145160
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-06 19:02:05 +00:00
Stephan Bergmann 19691c3b68 Revert all the recent loplugin:unocast changes
...as obsoleted by ef53355355 "Rudimentary support
for dynamic_cast on UNO proxy objects".

This reverts all of:
4cfcc9ac37 "loplugin:unocast (framework::Desktop)"
03efbf72f4 "loplugin:unocast
 (vclcanvas::TextLayout)"
80099fdd51 "loplugin:unocast (SalGtkXWindow)"
cc147f576d "loplugin:unocast
 (sdext::presenter::CachablePresenterView)"
40db42be1d "loplugin:unocast
 (vclcanvas::CanvasFont)"
2d1e7995ea "loplugin:unocast (CairoColorSpace)"
4c0bbe4bd9 "loplugin:unocast
 (canvas::ParametricPolyPolygon)"
8980366662 "loplugin:unocast
 (vclcanas::CanvasBitmap)"
d5e0c2c8db "loplugin:unocast
 (sfx2::DigitalSignatures)"
c0c4519e0d "loplugin:unocast
 (VCLXAccessibleComponent)"
feb8b833a6 "loplugin:unocast (VCLXDialog)"
1fa58cc6cc "loplugin:unocast (VCLXMultiPage)"
f481f036de "loplugin:unocast
 (DocumentSettingsSerializer)"
73df933f5f "loplugin:unocast
 (css::embed::EmbeddedUpdate)"
420165ab0e "loplugin:unocast
 (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)"
9abe8ee067 "loplugin:unocast (MutableTreeNode)"
9f3022ceb0 "loplugin:unocast (VCLXTabPage)"
1be70dda02 "loplugin:unocast
 (vcl::unotools::VclCanvasBitmap)"
d6a70bb641 "loplugin:unocast
 (basegfx::unotools::UnoPolyPolygon)"
5a14f009e6 "loplugin:unocast
 (xmlsecurity::Certificate)"
99009c9535 "loplugin:unocast (sd::Annotation)"
0c7585c5fa "loplugin:unocast (sd::TextApiObject)"
24e14afd1b "loplugin:unocast
 (SignatureVerifierImpl)"
1a7ad0c10d "loplugin:unocast
 (pcr::PropertyEventTranslation)"
a97e2d2702 "loplugin:unocast (RangePageBreaks)"
19dfdf86ad "iloplugin:unocast
 (pcr::OFormattedNumericControl)"
f9785ea595 "loplugin:unocast
 (frm::OInterfaceContainer)"
5e5f40a4a9 "loplugin:unocast (ScVbaShapes)"
27b35b2c21 "loplugin:unocast (ScVbaShapeRange)"
cb3108f860 "cid#1517812 Dereference null return
 value"
feba0ddb15 "loplugin:unocast
 (weld::TransportAsXWindow)"
4d6c232165 "loplugin:unocast
 (oox::ForumlaImExportBase)"
4844c096a8 "loplugin:unocast
 (cairocanvas::SurfaceProvider)"
9a0b523e0a "loplugin:unocast
 (cairocanvas::CanvasBitmap)"
8a5648d8e5 "loplugin:unocast
 (cairocanvas::TextLayout)"
28c27a0623 "loplugin:unocast
 (cairocanvas::CanvasFont)"
53bc223cb3 "loplugin:unocast
 (cairocanvas::RepaintTarget)"
5f70b0b9f6 "loplugin:unocast (SvXMLImport)"
068187a898 "loplugin:unocast (VCLXWindow)"
88b4f96620 "loplugin:unocast
 (sfx2::sidebar::SidebarController)"
f1b7a69b28 "loplugin:unocast
 (SvxLineStyleToolBoxControl)"
ba76f0ba7e "loplugin:unocast
 (i18npool::Calendar_gregorian)"
840154daf9 "loplugin:unocast
 (framework::AddonsToolBarWrapper)"
b0e9c4c5f0 "loplugin:unocast
 (GrammarCheckingIterator)"
8ee6cfc965 "loplugin:unocast
 (ucb::ucp::ext::Content)"
5b8cd77c11 "loplugin:unocast
 (basic::SfxScriptLibraryContainer)"
9e73ff9fce "loplugin:unocast
 (sdext::presenter::PresenterNotesView)"
a98acca8fb "loplugin:unocast
 (SelectionChangeHandler)"
c0b59ad6e3 "Consistently use
 comphelper::getSomethingImpl<I>(aIdentifier, this)"
276e3ccbdd "loplugin:unocast
 (vclcanvas::RepaintTarget)"

Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-05 11:45:51 +00:00
Stephan Bergmann c0c4519e0d loplugin:unocast (VCLXAccessibleComponent)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: I11496cc1d37e89ce8f11991f86c7b60bb1b93106
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144748
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-23 14:19:32 +00:00
Stephan Bergmann feb8b833a6 loplugin:unocast (VCLXDialog)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: Ia3bf3f52845884e68094b966ad3bd49ad82688a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144749
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22 15:05:22 +00:00
Stephan Bergmann 1fa58cc6cc loplugin:unocast (VCLXMultiPage)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: I7f755ce1483c5e2eca3066d12d90c5916d2f9087
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144751
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22 14:21:44 +00:00
Stephan Bergmann 9abe8ee067 loplugin:unocast (MutableTreeNode)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: I33fc079e2128c678ecc36567c2c5ed75481694c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144752
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22 13:07:49 +00:00
Stephan Bergmann 9f3022ceb0 loplugin:unocast (VCLXTabPage)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: I90754509513cafd04fa560d76a669a47d587f353
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144750
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22 12:51:25 +00:00
Noel Grandin ef50347225 loplugin:implinheritancehelper in toolkit
use more ImplInheritanceHelper to reduce boilerplate

Change-Id: I209e013f84a83339d0f4a6dfd90b462a47b6beeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144441
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-19 16:49:13 +00:00
Noel Grandin d640bfe776 remove dependency from drawinglayer to framework
to try and untangle the dependency mess a little.

This means

(*) tunneling a piece of information from VCLXWindow via
the XWindowPeer::getProperty method, so
we do not need to directly call VCLXWindow.

(*) moving some formpdf code from framework "down" to vcl,
where the drawinglayer code can use it

Change-Id: I2c1ff3e34941b3147e66cf0a2d0fdb13293e3aa2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144341
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-19 06:42:39 +00:00
Stephan Bergmann 068187a898 loplugin:unocast (VCLXWindow)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)

Change-Id: Ic151fd657cb780291009ee4c9db51a35dfa7f357
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144335
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-16 20:17:51 +00:00
Mike Kaganski b15eb164a8 tdf#152380: add checks for names and values sequences length equality
Change-Id: Ibeef551126874bcfffb4e7736588e2e1873f5768
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143681
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-12-06 05:32:37 +00:00
Caolán McNamara f9395a123e tdf#152094 retain more accuracy from RefDevMode::MSO1
do it like this to avoid adding another mapmode and to keep things
"the same" as much as possible

Change-Id: I1965aa545646f2d27b950d6335b2f608c3e4e04b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143475
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-02 15:20:07 +00:00
Stephan Bergmann 4e26dbf214 Use cppuhelper::ImplInheritanceHelper for toolkit VCLX window classes
Change-Id: I102b49608b62b351d6a458b3fd56167b136b24e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143525
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-01 15:40:25 +01:00
Noel Grandin f0030353b3 loplugin:unusedmethods
Change-Id: I5dcba14a9b0dfcc5267760410f6d135fcd3b1bd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142944
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-19 06:10:20 +01:00
Hossein 2d7db6981e tdf#152012 Fix assert fail on opening date picker
This patch fixes tdf#152012 which caused an assertion failure on opening
date picker field in a DOCX file

The assertion was:

include/o3tl/span.hxx:83: constexpr o3tl::span<T>::value_type& o3tl::
span<T>::operator[](o3tl::span<T>::size_type) const [with T = const
int; o3tl::span<T>::reference = const int&; o3tl::span<T>::size_type
= long unsigned int]: Assertion `pos < size()' failed.

And the backtrace was:

1  __pthread_kill_implementation           pthread_kill.c:44
2  __pthread_kill_internal                 pthread_kill.c:78
3  __GI___pthread_kill                     pthread_kill.c:89
4  __GI_raise                              raise.c:26
5  __GI_abort                              abort.c:79
6  __assert_fail_base                      assert.c:92
7  __GI___assert_fail                      assert.c:101
8  o3tl::span<int const>::operator[]       span.hxx:83
9  OutputDevice::ImplLayout                text.cxx:1396
10 OutputDevice::DrawTextArray             text.cxx:948
11 Calendar::ImplDraw                      calendar.cxx:71
12 Calendar::Paint                         calendar.cxx:1133

The problem was caused by an out of bound access to a vector of integers
which was created for rendering calendar header consisting of the first
letters of 7 days of week, when you clicked on the down arrow on the
date field.

The function OutputDevice::DrawTextArray() takes an 'rStr' string to
draw, and 'pDXAry' array for the exact position of the the individual
characters. It also takes 'nIndex' as the first index, and 'nLen' as the
length of the array. 'nLen' has the default value of -1. In this case,
the length is calculated from the size of the string passed to the
function. This works well if the one who uses the function makes sure
that the size of the array and the length of string are equal.

Previously, for the 7 days of the week, a 7 letter string "smtwtfs"
(depending on the week start day this can be different, but length is
always 7) was sent to this method without providing the length, thus
the string length: 7 was used. In this case, positions of the letters
were calculated and used from other array named mnDayOfWeekAry[7].
mnDayOfWeekAry[k+1] was used as the position of letter k (k=0..5).
In this case, there was 7 letters for 7 days, and only 6 positions
provided by the array. This caused assertion failure in span.hxx:83
when trying to accesss mnDayOfWeekAry[7] via o3tl::span<T>::operator[].

Value of mnDayOfWeekAry[0] was used in other calculations, therefore to
fix this problem, mnDayOfWeekAry was extended from 7 to 8, and the last
position was set to the end of drawing rectangle.

The other thing that is done in this patch to avoid this problem in the
future is removing the default value from the function prototype, so
that the use should always be done by providing the length of array and
starting index. After removing these defaults, it became necessary to
provide empty arrays for 'pKashidaAry' which provides the kashida
positions, if needed.

With this fix in place, the assertion failure no longer happens.

A UI test is added to make sure the crash will not happen again. The
test can be run by invoking:

 cd sw && make -srj1 UITest_writer_tests5 \
  UITEST_TEST_NAME="DateFormFieldPropertiesDialog.dateFormFieldDialog.test_date_picker_drop_down" \
  SAL_USE_VCLPLUGIN=gen

Change-Id: I347afb358fbc4956524f7f0a0abc3a221bf42992
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142642
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-11-14 12:08:08 +01:00
Noel Grandin 767092fe2c loplugin:referencecasting look for a new pattern
Change-Id: Ib7ded8db2c513909159f0876389f63b60082a529
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141618
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-21 15:50:35 +02:00
Caolán McNamara ea36e0502c tdf#150786 use a 'standard' theme for form controls
i.e. ignore system theme so we get the same results on export to pdf
regardless of the theme (esp dark) and don't follow the system theme
when hosted with a writer/calc/impress document (do continue to use
system theme for StarBasic dialogs as seen in BasicIDE)

Didn't reuse 'NativeWidgetLook' for this because is currently defaults
off, while we currently do use the colors derived from the system theme
even when this is off, its really the NWF flag to render using the
platform theming engine

Change-Id: I816d7ebaf793e5eac7bd937d44c1db0371145199
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140942
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-04 21:17:46 +02:00
Andrea Gelmini 55219f771c Fix typo
Change-Id: I0a2bab10b739a5e2462f53826cc77dd25abd9959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140625
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-09-26 20:16:04 +02:00
Michael Weghorn c26d6cc3c4 tdf#117173 a11y: Send SHOWING state change event on Window{Show,Hide}
When a `vcl::Window` becomes visible, `Window::ImplSetReallyVisible`
calls the registered event listeners with a
`VclEventId::WindowShow` event. Likewise, a
`VclEventId::WindowHide` events is sent in
`Window::ImplResetReallyVisible` when the window
is no longer visible.

Handle that event in `VCLXAccessibleComponent` by
sending a state change event for the SHOWING state,
so assistive technology gets notified about this.
(Similar handling can already be found e.g. in
`AccessibleTabBar::ProcessWindowEvent` or
`AccessibleTabBarPageList::ProcessWindowEvent`.)

While doing so in `VCLXAccessibleComponent::ProcessWindowEvent`
for the object itself would generally seem like a more straightforward
and conceptually nicer approach, this would have the problem
that the event wouldn't get propagated to the platform-specific
a11y integration layer (like winaccessibility) for the
`VclEventId::WindowShow` case, since the a11y event
listeners are registered and unregistered as a response to the CHILD
event (at least for winaccessibility and gtk3, qt6 doesn't do that
(yet?)), and if the accessible event listener is not (yet) registered,
the event is simply ignored.
Since the CHILD event is sent in
`VCLXAccessibleComponent::ProcessChildWindowEvent` and that gets
called on the parent *after* `VCLXAccessibleComponent::ProcessWindowEvent`
gets called for the object that became shown/hidden
(s. `Window::CallEventListeners`), also send the state change
event for the SHOWING state of the child from there, so the
proper order can be made sure.

The reverse order (first the state change event for the SHOWING
state, then the CHILD event which results in removal of the a11y
event listeners) is used for the case where the window gets
hidden.

In combination with
Change-Id Ifcf9304883e2e824ea1b7998d7767e474b87c8b6
("tdf#119788 tdf#117173 add atk notification role") and
commit 155e8b1683
("tdf#117173: qt a11y: Forward changes to SHOWING state"),
this makes Orca announce the label with notification role
in the Search and Replace dialog for the qt6
VCL plugin as well.

The gtk3 case already works with just
Change-Id Ifcf9304883e2e824ea1b7998d7767e474b87c8b6
("tdf#119788 tdf#117173 add atk notification role") in place,
because that one uses native gtk widgets in the Search and Replace
dialog, and the Gtk library then takes care of sending the
object:state-changed:showing event when the label
with notification role gets shown.

Side note: There are also comments that suggest to rework
the a11y event handling for the show/hide changes
more fundamentally, e.g. this comment in
`Window::ImplSetReallyVisible`:

    // the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
    // For this, the data member of the event must not be NULL.
    // Previously, we did this in Window::Show, but there some events got lost in certain situations. Now
    // we're doing it when the visibility really changes
    if( bBecameReallyVisible && ImplIsAccessibleCandidate() )
        CallEventListeners( VclEventId::WindowShow, this );
        // TODO. It's kind of a hack that we're re-using the VclEventId::WindowShow. Normally, we should
        // introduce another event which explicitly triggers the Accessibility implementations.

Similar ones can be found in `Window::ImplResetReallyVisible`
and `Window::Show`.

Change-Id: Id62b3942dc17c3a1ed6a08d23438406e5a19c39d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139813
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-09-26 16:14:51 +02:00
Ilhan Yesil ba164651bb tdf#149797 Change highlight background color in some controls
The highlight and highlighttext colors can be set for some
controls. So as example a selected item in a listbox can now
be paint with anothers colors then the standard blue. Controls
are: listbox, combobox, edit field and some special edit
fields like date, currency and others.

Change-Id: Iace2dd9a1a61abb7819b6c81eb0b8030912db32b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136691
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2022-09-19 13:30:15 +02:00
Samuel Mehrbrodt 467085bfb0 Rename MouseNotifyEvent to NotifyEventType
Also contains keyboard and focus events, not only mouse events

Change-Id: Iec1d6c341b01a489ba80fe9634ea3579afb02ea9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139970
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-09-19 11:42:59 +02:00
Noel Grandin a3bbdfab80 tdf#150974 Writer crashes when starting with WollMux installed
regression from
    commit b2aa646ef0
    Author: Caolán McNamara <caolanm@redhat.com>
    Date:   Wed Dec 15 11:43:32 2021 +0000
    use more OInterfaceContainerHelper3 in toolkit

Change-Id: I26532ea79b7c5f750b4bf693881cbf41aeb82266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140077
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-16 22:14:07 +02:00
Juan C. Sanz 5d40ced9e8 Revert "tdf#150569 Modify hardcoded dates to extend the range of accepted dates"
This reverts commit b20594f2fc.

Reason for revert: Further testing has shown some errors in other ways of displaying the data

Change-Id: Ic4909f8571c8730ab3ba622c7fad99f2646616ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-08 10:24:01 +02:00
jucasaca b20594f2fc tdf#150569 Modify hardcoded dates to extend the range of accepted dates
Replaces date range limits to allow entry of dates between 1/1/0001 and
31/12/9999, which is the normal date range in most database manager

May need some discussion

Change-Id: Ide8dfc64663d2ef2a66d8b7e1af3ef8ed3bb0af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138845
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-07 12:48:16 +02: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
Chris Sherlock 59210b075b tools: rename Rectangle::Justify() to Rectangle::Normalize()
Jusify() normalizes the rectangle so both the Width and Height are
positive, without changing the location of the rectangle. It ensures
that the x and y coordinates will be moved to the top left of the
rectangle.

The name is strange, so renaming Justify() to Normalize().

Change-Id: Idbf163e65e52a798e38f785b8961b8042cf0cf2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137379
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-24 10:55:15 +02:00
Stephan Bergmann 91ba9654ba Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxx
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit.  (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx.  The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now.  Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)

Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18 17:10:19 +02:00
Caolán McNamara 5d54cfab9e crashtesting: assert on export forum-fr-40415.ods to ods
0 is an invalid year

Change-Id: I2c638e2e2c1db628b4014a04a1c26231c236075b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138152
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-12 10:15:24 +02:00
Caolán McNamara 6f377e7bae move scrbar.hxx to vcl/toolkit
Change-Id: I77038cbf500976703ad41365da9a675a698863a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137979
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-09 10:01:15 +02:00
Andrea Gelmini b8b9ad9ade Removed duplicated includes
Change-Id: Ic981e0916c68181cab7081091303d18c54912377
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137912
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-07 07:27:12 +02:00
Caolán McNamara b2cdf8a1ea the "CreateWindow" function in svtools is newly removed
Change-Id: I6fb569cf293a896c92bec4c6aae647a0bd02d012
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137871
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-06 16:04:51 +02:00
Caolán McNamara 4d96e375c2 move SVTXGridControl to toolkit
Change-Id: I513a2885027d0295f70e7c64269d1653a6c2642b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137870
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-06 13:09:49 +02:00
Noel Grandin 566d6accfc clang-tidy modernize-pass-by-value in toolkit
Change-Id: I51823060a967b5c9f304af587ed4f9c262734be9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137690
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02 21:33:36 +02:00
Chris Sherlock 845393b9aa move wintypes.hxx from tools to vcl
Change-Id: Ief9949fd4252de9e33df172af07aa7ed097b5520
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136560
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-20 12:20:59 +02:00