summaryrefslogtreecommitdiff
path: root/toolkit
AgeCommit message (Collapse)Author
2023-02-22toolkit: Port AccessibleStatusBarTest to test::AccessibleTestBaseColomban Wendling
Now we have test::AccessibleTestBase we can use it instead of performing some setup operations manually. The only actual change is that we don't pass OpenFlags=S when creating an Impress document, but it never seemed useful (it was only ported from Java out of zeal), and I can't even find what the S option is for. In all cases, this doesn't affect the tests themselves. Change-Id: Ic8d56dd9bc3ec957891868b23bb241ba3bf33049 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147003 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-02-22BaseMutex->std::mutex in ListenerMultiplexerBaseNoel Grandin
Change-Id: Icd565c83ca3b4afb1a846a637b7943b0498487e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147457 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-19osl::Mutex->std::mutex in DefaultGridDataModelNoel Grandin
Change-Id: Ib62f9e7040c8d7171a50ccfe937e35f060f94f95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-18osl::Mutex->std::mutex in DefaultGridColumnModelNoel Grandin
Change-Id: Ie3df092b013f10b36c85028fe3b9966d58b22005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-07improve readability of VirtualDevice constructorNoel Grandin
(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-01-25Use ImplInheritanceHelper in OAccessibleControlContextStephan Bergmann
Change-Id: I11d8f487df0c9e707be6a2aa98a32135643552f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146110 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-25Use ImplInheritanceHelper in VCLXAccessibleComponentStephan Bergmann
Change-Id: I300f033054bddc2c0ee1973dbafc108c477bf09a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146103 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-24Use ImplInheritanceHelper in OAccessibleExtendedComponentHelperStephan Bergmann
(Explicitly deleting the special member functions is needed to avoid MSVC > include\cppuhelper/implbase.hxx(152): error C2280: 'comphelper::OCommonAccessibleComponent::OCommonAccessibleComponent(const comphelper::OCommonAccessibleComponent &)': attempting to reference a deleted function > include\comphelper/accessiblecomponenthelper.hxx(176): note: compiler has generated 'comphelper::OCommonAccessibleComponent::OCommonAccessibleComponent' here > include\comphelper/accessiblecomponenthelper.hxx(176): note: 'comphelper::OCommonAccessibleComponent::OCommonAccessibleComponent(const comphelper::OCommonAccessibleComponent &)': function was implicitly deleted because a base class invokes a deleted or inaccessible function 'cppu::BaseMutex::BaseMutex(const cppu::BaseMutex &)' > include\cppuhelper/basemutex.hxx(43): note: 'cppu::BaseMutex::BaseMutex(const cppu::BaseMutex &)': function was implicitly deleted because a data member invokes a deleted or inaccessible function 'osl::Mutex::Mutex(const osl::Mutex &)' > include\osl/mutex.hxx(107): note: 'osl::Mutex::Mutex(const osl::Mutex &)': function was explicitly deleted > include\comphelper/accessiblecomponenthelper.hxx(228): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent>>(cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent> &&)' being compiled > include\comphelper/accessiblecomponenthelper.hxx(228): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent>>(cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent,com::sun::star::accessibility::XAccessibleExtendedComponent> &&)' being compiled ) Change-Id: Ia5a7b244dd018c1a63cc2940dba197c43827d563 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146062 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-19Fix some toolkit UnoControlBase derivates' queryAggregationStephan Bergmann
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-16XUnoTunnel->dynamic_cast in VCLXGraphicsNoel Grandin
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-16XUnoTunnel->dynamic_cast in VCLXBitmapNoel Grandin
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-16XUnoTunnel->dynamic_cast in GridColumnNoel Grandin
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-16XUnoTunnel->dynamic_cast in VCLXPointerNoel Grandin
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-16XUnoTunnel->dynamic_cast in VCLXRegionNoel Grandin
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-14XUnoTunnel->dynamic_cast in VCLXMenuNoel Grandin
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-14XUnoTunnel->dynamic_cast in UnoControlModelNoel Grandin
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-13XUnoTunnel->dynamic_cast in VCLXFontNoel Grandin
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-13XUnoTunnel->dynamic_cast in VCLXDeviceNoel Grandin
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-10OAccessibleImplementationAccess was apparently effectively unused by nowStephan Bergmann
...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-09Clean up VCLXAccessibleComponent::getAccessibleParentStephan Bergmann
...after 21e0d8162a0e683558c4d042ce688fc9a6833809 "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-09use std::this_thread::sleep_for instead of osl equivalentArnaud VERSINI
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-06Merge comphelper::OAccessibleContextHelper into ↵Stephan Bergmann
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-05Revert all the recent loplugin:unocast changesStephan Bergmann
...as obsoleted by ef533553559fe09b4afab651fc692885d1acf4ed "Rudimentary support for dynamic_cast on UNO proxy objects". This reverts all of: 4cfcc9ac37b90ce64c8402a41eb4638adb185b5c "loplugin:unocast (framework::Desktop)" 03efbf72f4ddf7a84aa8aabef348331bd4b75e8a "loplugin:unocast (vclcanvas::TextLayout)" 80099fdd51a69eaa6c36ca88ef772810e4a777fa "loplugin:unocast (SalGtkXWindow)" cc147f576d8687fb79c77d47d41dc4ba1678a469 "loplugin:unocast (sdext::presenter::CachablePresenterView)" 40db42be1d8fd0f9c6c8c5ba3767ddb9ee2034c2 "loplugin:unocast (vclcanvas::CanvasFont)" 2d1e7995eae29e2826449eb5179f5fae181794a5 "loplugin:unocast (CairoColorSpace)" 4c0bbe4bd97636207cf71a6aa120c67698891da9 "loplugin:unocast (canvas::ParametricPolyPolygon)" 89803666621c07d1b1ac9d3bd883f0ca192a91a0 "loplugin:unocast (vclcanas::CanvasBitmap)" d5e0c2c8db71878d21c2a7255af08cf5f9a6dd04 "loplugin:unocast (sfx2::DigitalSignatures)" c0c4519e0d5b555f59bbc04cc616454edfd1f4ce "loplugin:unocast (VCLXAccessibleComponent)" feb8b833a6245d42400f42a0bc789dc84594ee6f "loplugin:unocast (VCLXDialog)" 1fa58cc6cc9c3849753342a5d9a6ddfa461b5e66 "loplugin:unocast (VCLXMultiPage)" f481f036deb1b1b46f3038074c4659f3a91b9c6c "loplugin:unocast (DocumentSettingsSerializer)" 73df933f5fa5932f94e5a1b338a3eda00a9ce354 "loplugin:unocast (css::embed::EmbeddedUpdate)" 420165ab0ef03c0467f9d17f504de2d2fc78f0e6 "loplugin:unocast (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)" 9abe8ee067e6c00f19d8a13346d53c4641c27166 "loplugin:unocast (MutableTreeNode)" 9f3022ceb036f23b4b0994c3e2fbd1001bff225a "loplugin:unocast (VCLXTabPage)" 1be70dda02c12a60778b7607cff2520ae1aa611e "loplugin:unocast (vcl::unotools::VclCanvasBitmap)" d6a70bb641b96e8e5616448c2378131ed62658b4 "loplugin:unocast (basegfx::unotools::UnoPolyPolygon)" 5a14f009e6782c077463c8cbb8e9cea3d7950107 "loplugin:unocast (xmlsecurity::Certificate)" 99009c9535dfa3e0d838989ccc7d84bfa2320ff4 "loplugin:unocast (sd::Annotation)" 0c7585c5fa78887e5459885ed744e8044fd76137 "loplugin:unocast (sd::TextApiObject)" 24e14afd1bfcaed6c200ab081973fba7e47267ca "loplugin:unocast (SignatureVerifierImpl)" 1a7ad0c10d286ce9ae2700ceb2fd50eed1fb43a4 "loplugin:unocast (pcr::PropertyEventTranslation)" a97e2d2702d9a6f37775ccee2c08c4f3b2479c4b "loplugin:unocast (RangePageBreaks)" 19dfdf86ad1f5b08041d8b7a9f196caf881231ab "iloplugin:unocast (pcr::OFormattedNumericControl)" f9785ea595fd8e911f6370e836fa579225b9e571 "loplugin:unocast (frm::OInterfaceContainer)" 5e5f40a4a92a31b0932c690219d002fcf18598cf "loplugin:unocast (ScVbaShapes)" 27b35b2c215b4832d4378ec3a7ecbba926552d06 "loplugin:unocast (ScVbaShapeRange)" cb3108f860065928552a86cf8acc4b3a95718ecf "cid#1517812 Dereference null return value" feba0ddb1521d1142560fe54b7d7696ee910237f "loplugin:unocast (weld::TransportAsXWindow)" 4d6c23216559eb48f9943bb49d6e475a6d64ba15 "loplugin:unocast (oox::ForumlaImExportBase)" 4844c096a8ab6a9a620c410a0949d4499f12a504 "loplugin:unocast (cairocanvas::SurfaceProvider)" 9a0b523e0a84d403b9092176ccec4b3e3efe42d0 "loplugin:unocast (cairocanvas::CanvasBitmap)" 8a5648d8e59b4b007dbbf3824777c19a21efc61e "loplugin:unocast (cairocanvas::TextLayout)" 28c27a0623bc78a0590858f97d03b620985bc84c "loplugin:unocast (cairocanvas::CanvasFont)" 53bc223cb3288e32a417696ee61c29e5f01f209d "loplugin:unocast (cairocanvas::RepaintTarget)" 5f70b0b9f6bc4ab145ddbd9155590ed4a3b1b9ec "loplugin:unocast (SvXMLImport)" 068187a898cdd2e26e9b16c348ecc1ed2dee3f29 "loplugin:unocast (VCLXWindow)" 88b4f966202717cd4ad38a30a8eda22c3e69ed35 "loplugin:unocast (sfx2::sidebar::SidebarController)" f1b7a69b280aefe2f1b3b0f32193494fd765f2bd "loplugin:unocast (SvxLineStyleToolBoxControl)" ba76f0ba7e8de4d2953739c952004b7d9af47197 "loplugin:unocast (i18npool::Calendar_gregorian)" 840154daf934d8df52ead1cb7acd798c4d30f007 "loplugin:unocast (framework::AddonsToolBarWrapper)" b0e9c4c5f063cefa9557810e3349bdb9c7493091 "loplugin:unocast (GrammarCheckingIterator)" 8ee6cfc9655ce9de4617cea1a0d9cb9d7a4fbfac "loplugin:unocast (ucb::ucp::ext::Content)" 5b8cd77c112bc8c0e92b8fec215c3c8e802bbc0a "loplugin:unocast (basic::SfxScriptLibraryContainer)" 9e73ff9fce12e102bb3c3cea8d8bb96c88f2c9ad "loplugin:unocast (sdext::presenter::PresenterNotesView)" a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d "loplugin:unocast (SelectionChangeHandler)" c0b59ad6e35b0cb0dea0821e95f95569739078c1 "Consistently use comphelper::getSomethingImpl<I>(aIdentifier, this)" 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c "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>
2022-12-23loplugin:unocast (VCLXAccessibleComponent)Stephan Bergmann
(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-22loplugin:unocast (VCLXDialog)Stephan Bergmann
(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-22loplugin:unocast (VCLXMultiPage)Stephan Bergmann
(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-22loplugin:unocast (MutableTreeNode)Stephan Bergmann
(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-22loplugin:unocast (VCLXTabPage)Stephan Bergmann
(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-19loplugin:implinheritancehelper in toolkitNoel Grandin
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-19remove dependency from drawinglayer to frameworkNoel Grandin
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-16loplugin:unocast (VCLXWindow)Stephan Bergmann
(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-06tdf#152380: add checks for names and values sequences length equalityMike Kaganski
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-02tdf#152094 retain more accuracy from RefDevMode::MSO1Caolán McNamara
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-01loplugin:unusedfields make some fields privateNoel Grandin
Change-Id: Ia30e3b7f10ae11c7a74e6860ac0a6115caaa439f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-01Use cppuhelper::ImplInheritanceHelper for toolkit VCLX window classesStephan Bergmann
Change-Id: I102b49608b62b351d6a458b3fd56167b136b24e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143525 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-19loplugin:unusedmethodsNoel Grandin
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-14tdf#152012 Fix assert fail on opening date pickerHossein
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-10-21loplugin:referencecasting look for a new patternNoel Grandin
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-04tdf#150786 use a 'standard' theme for form controlsCaolán McNamara
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-09-26Fix typoAndrea Gelmini
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-26tdf#117173 a11y: Send SHOWING state change event on Window{Show,Hide}Michael Weghorn
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 155e8b1683f10847ff18e75287e2466220242bb1 ("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-19tdf#149797 Change highlight background color in some controlsIlhan Yesil
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-19Rename MouseNotifyEvent to NotifyEventTypeSamuel Mehrbrodt
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-16tdf#150974 Writer crashes when starting with WollMux installedNoel Grandin
regression from commit b2aa646ef09dc8434d3ca8a5bba53a8d8ff3f910 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-08Revert "tdf#150569 Modify hardcoded dates to extend the range of accepted dates"Juan C. Sanz
This reverts commit b20594f2fc8f6f9fdbf0b257b4e74d95a8d90139. 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-07tdf#150569 Modify hardcoded dates to extend the range of accepted datesjucasaca
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-02[API CHANGE] tdf#150683 a11y: Switch a11y child index to 64 bitMichael Weghorn
With 16k column support in Calc enabled by default in commit 4c5f8ccf0a2320432b8fe91add1dcadf54d9fd58 Date: Tue Mar 8 12:44:49 2022 +0100 change default Calc number of columns to 16384 (tdf#50916) , the number of Calc cells in a spreadsheet is larger than SAL_MAX_INT32, meaning that a 32-bit a11y child index is no more enough and using it resulted in integer overflows in methods handling corresponding Calc cells in the a11y layer. This e.g. had the effect of the Orca and NVDA screen readers not announcing focused or selected cells properly when their a11y child index was out of the 32-bit integer range. Switch the internal a11y child indices to 64 bit to be able to handle this properly internally. Since the platform APIs (at least AT-SPI on Linux and IAccessible2 on Windows; from what I can see LO's macOS a11y bridge doesn't directly expose the child index) are still restricted to 32 bit, larger child indices still cannot be exposed via the platform APIs. As a consequence, use of the the IAccessible2 and AT-SPI methods that use the child index remains problematic in those cases where the child index is larger. However, as an alternative to using the AT-SPI Table interface and the IAccessibleTable/ IAccessibleTable2 interfaces with the child index to retrieve information about a specific cell, both AT-SPI and IAccessible2 also provide interfaces to retrieve that information directly from the cell object (TableCell interface for AT-SPI, IAccessibleTableCell for IAccessible2). Those interfaces are already implemented/exposed for winaccessibility (s. `CAccTable`) and the qt5/qt6/kf5 VCL plugins (s. the `QAccessibleTableCellInterface` methods implemented in `QtAccessibleInterface`). With the switch to 64-bit internal a11y child indices, these now behave correctly for cells with a child index that doesn't fit into 32 bit as well. NVDA on Windows already uses the IAccessibleTableCell interface and thus announcing focused cells works fine with this change in place. Orca on Linux currently doesn't make use of the AT-SPI TableCell interface yet, but with a suggested change to do so [1], announcement of selected cells works with the qt6 VCL plugin with a current qtbase dev branch as well - when combined with the suggested changes to implement support for the AT-SPI TableCell interface in Qt [2] [3] and the LO change based on that [4] and a fix for a nullptr dereference [5]. The gtk3 VCL plugin doesn't expose the AT-SPI TableCell interface yet, but once it does so (via `AtkTableCell`), it also works with the suggested Orca change [1] in place. (Adding that is planned for an upcoming change, works with a local WIP patch.) For handling return values that are larger than what platform APIs support, the following approach has been chosen for now: 1) When the return value is for the count of (selected) children, the maximum value N supported by the platform API is returned. (This is what `ScAccessibleTableBase::getAccessibleChildCount` did previously.) The first N elements can be accessed by their actual (selection) indices. 2) When the return value is the child/cell index, -2 is returned for objects whose index is greater than the maximum value supported by the platform API. Using a non-negative value would mean that the index would refer to *another* actually existing child. A child index of -1 on the other hand tends to be interpreted as "child is invalid" or "object isn't actually a child of its (previous) parent any more)". For the Orca case, this would result in objects with a child index of -1 not being announced, as they are considered "zombies" [6]. What's still somewhat problematic is the case where more than 2^31 children are *selected*, since access to those children still happens by the index into the selection in the platform APIs, and not all selected items are accessible this way. (Screen readers usually just retrieve the first and last element from the selection and announce those.) Orca already seems to apply different handling for the case for fully selected rows and columns, so "All cells selected" or "Columns ... to ... selected" is announced just fine even if more than 2^31 cells are selected. (Side note: While Microsoft User Interface Automation - UIA - also uses 32-bit indices, it also has specific methods in the ISelectionProvider2 interface that allow to explicitly retrieve the first and last selected item, `ISelectionProvider2::get_FirstSelectedItem` and `ISelectionProvider2::get_LastSelectedItem`, but we currently don't support UIA on Windows.) Bound checks at the beginning of the methods from the `XAccessibleContext`, `XAccessibleSelection` and `XAccessibleTable` interfaces that take a child index (or in helper methods called by those) should generally already prevent too large indices from being passed to the methods in the lower layer code that take smaller integer types. Such bound checking has been been added in various places where it wasn't present yet. If there any remaining issues of this kind that show after this commit, they can probably be solved in a similar way (s.e.g. the change to `AccessibleBrowseBox::getAccessibleChild` in this commit). A few asserts were also added at places where my understanding is that values shouldn't be larger than what is supported by a called method anyway. A test case will be added in a following change. [1] https://gitlab.gnome.org/GNOME/orca/-/merge_requests/131 [2] https://codereview.qt-project.org/c/qt/qtbase/+/428566 [3] https://codereview.qt-project.org/c/qt/qtbase/+/428567 [4] https://gerrit.libreoffice.org/c/core/+/138750 [5] https://codereview.qt-project.org/c/qt/qtbase/+/430157 [6] https://gitlab.gnome.org/GNOME/orca/-/blob/82c8542002e36e0d3d918088d583162d25136143/src/orca/script_utilities.py#L5155 Change-Id: I3af590c988b0e6754fc72545918412f39e8fea07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139258 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-08-24tools: rename Rectangle::Justify() to Rectangle::Normalize()Chris Sherlock
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-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...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-12crashtesting: assert on export forum-fr-40415.ods to odsCaolán McNamara
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>