summaryrefslogtreecommitdiff
path: root/toolkit
AgeCommit message (Collapse)AuthorFilesLines
2023-03-13convert UnoControlModel and friends to use std::mutexNoel Grandin21-239/+224
Which means creating a variant of the cppuhelper::OPropertySetHelper helper class which uses a std::mutex. Since we can do virtual base classes now (which the original could not), use that and a new helper class comphelper::UnoImplBase to share std::mutex m_aMutex; bool m_bDisposing; fields that the OPropertySetHelper wants to share with the parent class. Change-Id: I05ad465a3d3653ed4e109137e3e1c58190da8d97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148474 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-10improve loplugin:unnecessarylockingNoel Grandin1-9/+2
to find more locking we can remove Change-Id: Ief7bc5ec2a1ff31f22a0ad366910b7fcc4725818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-08BaseMutex->std::mutex in MutableTreeDataModelNoel Grandin1-16/+32
Change-Id: I9028c0ac35b2f375ef0d72201ca4b9f8eb99c7b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-08deduplicate MutexAndBroadcastHelperNoel Grandin5-33/+33
there are two very similar classes, standardise on the one in include/comphelper Change-Id: If85729dcea01e65a2d095bb211fe643c783ebf1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-22toolkit: Port AccessibleStatusBarTest to test::AccessibleTestBaseColomban Wendling1-56/+11
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 Grandin4-9/+24
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 Grandin1-61/+68
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 Grandin1-65/+65
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 Grandin1-2/+1
(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 Bergmann2-21/+3
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 Bergmann1-10/+0
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 Bergmann1-0/+1
(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 Bergmann4-6/+15
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 Grandin2-9/+1
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 Grandin3-9/+1
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 Grandin3-45/+11
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 Grandin3-9/+2
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 Grandin3-10/+2
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 Grandin2-8/+4
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 Grandin1-13/+0
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 Grandin2-4/+1
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 Grandin8-17/+10
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 Bergmann3-7/+3
...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 Bergmann1-11/+3
...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 VERSINI1-1/+2
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 Bergmann3-1/+3
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 Bergmann7-85/+12
...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 Bergmann1-2/+12
(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 Bergmann3-1/+16
(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 Bergmann3-1/+15
(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 Bergmann1-6/+25
(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 Bergmann3-1/+15
(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 Grandin2-52/+2
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 Grandin3-790/+15
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 Bergmann1-1/+2
(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 Kaganski1-0/+3
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 McNamara2-11/+12
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 Grandin1-2/+1
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 Bergmann8-688/+35
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 Grandin1-5/+0
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 pickerHossein1-1/+1
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 Grandin3-18/+10
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 McNamara1-0/+18
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 Gelmini1-1/+1
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 Weghorn1-0/+32
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 Yesil5-1/+134
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 Mehrbrodt2-3/+3
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 Grandin1-0/+26
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. Sanz2-4/+4
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 datesjucasaca2-4/+4
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>