summaryrefslogtreecommitdiff
path: root/include/comphelper
AgeCommit message (Collapse)Author
2023-12-30move IsFuzzing to comphelperCaolán McNamara
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-24tdf#146619 Recheck include/ with find-unneeded-includes --noexcludeGabor Kelemen
to see if some exclusions became obsolete Change-Id: Id88351f5448511b35994c58c6cb749784da3b45e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156993 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-12-24OInterfaceIteratorHelper3 always copies maData contents in ctorCaolán McNamara
while I think the idea is that the copy on write should only be done by OInterfaceContainerHelper3, i.e. that ownership really transfers to OInterfaceIteratorHelper3 and OInterfaceContainerHelper3 makes a new one if that turns out to be necessary Change-Id: I6e97e3b303f133edbbb35ac23f39cf5348ad49fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161257 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-21allow passing if deep detection is wantedCaolán McNamara
which naturally requires the data to achieve Change-Id: If23e7dbd009f3d8e60422ec4d485b459d5721c8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161135 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-20tdf#158375: disable DDE when DisableActiveContent is setSarper Akdemir
Change-Id: I167f6ea5d740b5a53cd02a9b865e65ff980a8877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160922 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
2023-12-10cid#1546281 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546278 COPY_INSTEAD_OF_MOVE cid#1546276 COPY_INSTEAD_OF_MOVE cid#1546247 COPY_INSTEAD_OF_MOVE cid#1546244 COPY_INSTEAD_OF_MOVE cid#1546243 COPY_INSTEAD_OF_MOVE cid#1546220 COPY_INSTEAD_OF_MOVE cid#1546209 COPY_INSTEAD_OF_MOVE cid#1546207 COPY_INSTEAD_OF_MOVE cid#1546206 COPY_INSTEAD_OF_MOVE cid#1546205 COPY_INSTEAD_OF_MOVE cid#1546197 COPY_INSTEAD_OF_MOVE cid#1546180 COPY_INSTEAD_OF_MOVE cid#1546172 COPY_INSTEAD_OF_MOVE cid#1546165 COPY_INSTEAD_OF_MOVE cid#1546164 COPY_INSTEAD_OF_MOVE cid#1546158 COPY_INSTEAD_OF_MOVE cid#1546151 COPY_INSTEAD_OF_MOVE cid#1546135 COPY_INSTEAD_OF_MOVE cid#1546132 COPY_INSTEAD_OF_MOVE cid#1546129 COPY_INSTEAD_OF_MOVE cid#1546128 COPY_INSTEAD_OF_MOVE cid#1546122 COPY_INSTEAD_OF_MOVE cid#1546117 COPY_INSTEAD_OF_MOVE cid#1546113 COPY_INSTEAD_OF_MOVE cid#1546106 COPY_INSTEAD_OF_MOVE cid#1546099 COPY_INSTEAD_OF_MOVE cid#1546091 COPY_INSTEAD_OF_MOVE cid#1546085 COPY_INSTEAD_OF_MOVE cid#1546069 COPY_INSTEAD_OF_MOVE cid#1546063 COPY_INSTEAD_OF_MOVE cid#1546062 COPY_INSTEAD_OF_MOVE cid#1546058 COPY_INSTEAD_OF_MOVE cid#1546056 COPY_INSTEAD_OF_MOVE cid#1546051 COPY_INSTEAD_OF_MOVE cid#1546040 COPY_INSTEAD_OF_MOVE cid#1546030 COPY_INSTEAD_OF_MOVE cid#1546028 COPY_INSTEAD_OF_MOVE cid#1546015 COPY_INSTEAD_OF_MOVE cid#1546001 COPY_INSTEAD_OF_MOVE Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-23tdf#158321 No error message when file doesn't existNoel Grandin
Revert "reduce allocations in InterceptedInteraction" This reverts commit e3c961e6a3917d95534652e0f982918cc1079015. Change-Id: I26ba0acaa088dff1800ccd69513056f821bd4d7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-16comphelper: use c++20 contains() instead of find() and end()Miklos Vajna
Whether an element is contained inside a container is better to be checked with contains() instead of find() because contains() conveys the intent more clearly. Change-Id: I267d915c95fcf9c98b2e11daa89c8fe801e59a75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159484 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-10tdf#158007 - UI: Part 23 - Unify lockdown behavior of Options dialogBalazs Varga
for Writer - General Page. Change-Id: I2c679ee7f8e2d282a9f9ff19fc1743cb9bb6dbe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159250 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-10-31Update an URLMike Kaganski
Change-Id: Ie1b01d3d17f453ae1aa3d53c17e52cd4106e222e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158687 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-24tdf#155040 sw floattable, RTF: fix table is overlapped by subsequent inline oneMiklos Vajna
The document had overlapping text on load since commit 05425f73bfa41d3f7591461e2ad0beb4fafc39b4 (sw floatable: teach the RTF import about SwFormatFlySplit, 2023-04-21). Interestingly the DOCX equivalent was fine, there the inline table is shifted down, below the floating table, so the overlap doesn't happen. Fix the problem by moving the AddVerticalFrameOffsets=true code from the DOCX filter to the shared dmapper, because RTF needs the same. See commit 50223ea6e212b60b7d33839c2753c5601fb50f95 (tdf#98987 sw: add AddVerticalFrameOffsets compat mode, 2016-03-31) for more details about this compat flag. It was already enabled for DOC, too. Change-Id: I948b179c9ec5fa24377014b0e86826568c417b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158372 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-13Follow-up on "Make sure __cpp_lib_source_location is consistently defined"Stephan Bergmann
(113e064117b2632974a696b950634229d70c5b96). Mike pointed out that I forgot to fix the generated code and that "https://en.cppreference.com/w/cpp/compiler_support/20 lists <version> as supported since gcc libstdc++ 9, and README.md requires libstdc++ 8.5." Change-Id: Ic7477e39e334735c4a563195fee335a599a0ef79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157933 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-13Make sure __cpp_lib_source_location is consistently definedStephan Bergmann
...following up on 9c5f597fc80a8a910c1f898556ef2a3226dfe40c "use std::source_location instead of std::experimental::source_location". __cpp_lib_source_location is defined in both <source_location> (but which we can apparently not rely on here, trying to figure out whether to #include it in the first place) and <version>, so lets hope that all our toolchains support C++20 <version> by now and #include that. Change-Id: I7ba41cae60dbbf6b3ec275edb06af66f184daf93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157910 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12use std::source_location instead of std::experimental::source_locationNoel Grandin
https://en.cppreference.com/w/cpp/compiler_support says that this is supported in GCC >= 11 CLANG >= 16 Visual Studio >= VS 2019 16.10 And our Visual Studio baseline is now 2019. We still need to make the ifdef conditional check clang, because __has_include will happily return true even if the current clang does not support the necessary builtins. Change-Id: I5f2743e204b8ed22d4651053f3ae579a4a192a45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157515 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-06cid#1547076 Uninitialized scalar fieldCaolán McNamara
Change-Id: Iddccb0a468fd5341115851da1720a8fee97a92f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157634 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-03replace ErrorInfo with simpler mechanismNoel Grandin
Instead of returning ErrCode class everywhere, return a new class ErrrCodeMsg, which combines an ErrCode with the other parameters that are used to control the error reporting. I do not change everything that uses ErrCode here, I started from SfxBaseController/SfxMedium and worked outwards. This change serves two purposes (1) Replace the extremely whacky ErrorInfo mechanism we were using to smuggle information into the error handler reporting mechanism with a very straightforward approach of just combining it into the error class. (2) Allow us to capture the source location that produced the error, which makes debugging the source of a problem soooo much easier. Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-02reduce allocations in InterceptedInteractionNoel Grandin
the list of intercepted interactions is static per sub-class, so just pass up a o3tl::span at constructor time. Change-Id: Ib45c5a3338e0eb3848486dfc707052f07492eb61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157480 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-22tdf#146619 Recheck include/c* with IWYUGabor Kelemen
Change-Id: I0cf6f675483bddf82e7347b484a874c71963bfd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156984 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-06tdf#156683 a11y: Handle both disposing variants in context wrapperMichael Weghorn
commit db0044242a897e447988169630ff74e4c8bfecf9 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Sep 6 09:12:23 2023 +0200 tdf#156683 a11y: Forward when wrapped a11y context is disposing switched from overriding `disposing()` to overriding `disposing(const css::lang::EventObject&)` in `OAccessibleContextWrapperHelper` in order to make sure that the corresponding entry in the `AccessibleEventNotifier` client map is removed and event listeners for the wrapper get notified (via `AccessibleEventNotifier::revokeClientNotifyDisposing`) when the wrapped object is disposing. As Noel points out in [1], the `disposing()` case should probably still be overriden/handled and make sure that the wrapped object etc. get disposed, so disposing one object via the other works both ways. (If the wrapped object is disposed, so is the wrapper. If the wrapper gets disposed, so is the wrapped object.) Therefore, add back `OAccessibleContextWrapper::disposing()` and extract the logic to a separate helper method that is called from both `disposing` variants. [1] https://gerrit.libreoffice.org/c/core/+/156592/comments/bb7c24bc_94033649 Change-Id: If15fd1839b222ad94fcbc569842dc43b517d3574 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-06tdf#156683 a11y: Forward when wrapped a11y context is disposingMichael Weghorn
`OAccessibleContextWrapper` wraps an `XAccessibleContext` held in the `m_xInnerContext` member and forwards calls to its own methods to that one. The lifecycle of the wrapper should match that of the wrapped context, so handle when the wrapped context is disposing by overriding `XAccessibleContext::disposing` (that takes a `css::lang::EventObject&` parameter) instead of overriding `WeakComponentImplHelperBase::disposing` (the `disposing` method not taking a param) that's meant to be called when/right before the object itself gets disposed (but wasn't called at all e.g. for the `OToolBoxWindowItemContext` case in tdf#156683). This makes sure that the corresponding entry in the `AccessibleEventNotifier` client map is removed and event listeners for the wrapper get notified (via `AccessibleEventNotifier::revokeClientNotifyDisposing`) when the wrapped object is disposing and fixes the tdf#156683 crash on exit with gtk3 observed in the libreoffice-7-6 branch: /usr/include/c++/13/debug/vector:450: In function: std::debug::vector<_Tp, _Allocator>::const_reference std:: debug::vector<_Tp, _Allocator>::operator[](size_type) const [with _Tp = com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>; _Allocator = std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >; const_reference = const com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>&; size_type = long unsigned int] Error: attempt to subscript container with out-of-bounds index 0, but container only holds 0 elements. Objects involved in the operation: sequence "this" @ 0x561465d8e510 { type = std::debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >; } warn:desktop:197113:197113:desktop/source/app/crashreport.cxx:61: minidump generated: /home/michi/development/git/libreoffice-WORKTREE/instdir/program/../program/../crash//e338ad13-2338-4cd0-8d5c069d-c28f5cf5.dmp Backtrace: 1 comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear interfacecontainer4.hxx 397 0x7f2c39915cdc 2 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing accessibleeventnotifier.cxx 204 0x7f2c39913c75 3 comphelper::OAccessibleContextWrapper::disposing accessiblewrapper.cxx 610 0x7f2c3992f033 4 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 0x7f2c3947491b 5 cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::accessibility::XAccessibleContext>::dispose compbase.hxx 90 0x7f2bf8b31c70 6 cppu::WeakComponentImplHelperBase::release implbase.cxx 79 0x7f2c39474664 7 cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::accessibility::XAccessibleContext>::release compbase.hxx 86 0x7f2c3993133c 8 comphelper::OAccessibleContextWrapper::release accessiblewrapper.cxx 475 0x7f2c3992e536 9 com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::clear Reference.hxx 231 0x7f2c26929685 10 atk_object_wrapper_dispose atkwrapper.cxx 1074 0x7f2c26928a2e 11 atk_object_wrapper_finalize atkwrapper.cxx 670 0x7f2c26927677 12 g_object_unref 0x7f2c3418c48c 13 AtkListener::~AtkListener atklistener.cxx 57 0x7f2c26900547 14 AtkListener::~AtkListener atklistener.cxx 58 0x7f2c2690057e 15 cppu::OWeakObject::release weak.cxx 230 0x7f2c39556056 16 cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release implbase.hxx 115 0x7f2c2690a92e 17 com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference Reference.hxx 114 0x7f2c39921b9f 18 std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>> stl_construct.h 151 0x7f2c399217af 19 std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> *> stl_construct.h 163 0x7f2c39920bd5 20 std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> *> stl_construct.h 196 0x7f2c3991f10b ... <More> Reverse-debugging to the start of `atk_object_wrapper_dispose` (s. frame 10 above), shows that the the `mpContext` is`: uno::Reference to ((anonymous namespace)::OToolBoxWindowItemContext *) 0x5637df79f1b8 Also, call the base class implementation of the same method, i.e. `OAccessibleContextWrapperHelper::disposing` instead of directly disposing via `OAccessibleContextWrapperHelper::dispose`. The former will call `dispose` via its base class implementation if it hasn't been disposed yet, s. `OComponentProxyAggregationHelper::disposing`. Change-Id: Ief66ffbe075af40f10c5fafa62063bda55f66b2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156610 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-08-30tdf#156835 - FILEOPEN XLSX: add SHA-384 encryption support for ooxml importBalazs Varga
Password protected file with SHA-384 encryption does not open before this patch. Change-Id: I482233f788b8e9da210ad6d2a6c4ece18d05d248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156282 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-19Fix typoAndrea Gelmini
Change-Id: I6649e13646e4fd33dd1858f5a5a56ec0955005dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155841 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-02Silence C++20 volatile increment deprecation warningsStephan Bergmann
...as seen with path set 2 of <https://gerrit.libreoffice.org/c/core/+/155121/2> "Bump baseline to C++20", > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19: > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16: > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void enter() { gnEnterCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void leave() { gnLeaveCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:59:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void enter() { gnEnterCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:54:19: note: in instantiation of member function 'CrashZone<SkiaZone>::enter' requested here > CrashZone() { enter(); } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: note: in instantiation of member function 'CrashZone<SkiaZone>::CrashZone' requested here > SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); } > ^ > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/source/app/watchdog.cxx:19: > In file included from /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/opengl/zone.hxx:16: > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:60:39: error: increment of object of volatile-qualified type 'CrashZone::AtomicCounter' (aka 'volatile unsigned int') is deprecated [-Werror,-Wdeprecated-volatile] > static void leave() { gnLeaveCount++; } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/include/comphelper/crashzone.hxx:55:20: note: in instantiation of member function 'CrashZone<SkiaZone>::leave' requested here > ~CrashZone() { leave(); } > ^ > /home/tdf/lode/jenkins/workspace/android_arm/vcl/inc/skia/zone.hxx:23:5: note: in instantiation of member function 'CrashZone<SkiaZone>::~CrashZone' requested here > SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); } > ^ (<https://ci.libreoffice.org/job/gerrit_android_arm/31168/>) Change-Id: Ia63c54ed5bde6678ef6b544c1edad9600534ff05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155264 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-04loplugin:constantparamNoel Grandin
Change-Id: Iee554baae7239c9bf0ac35cab6ff235a88dc29a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153973 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-02loplugin:singlevalfieldsNoel Grandin
Change-Id: I091fac5ed41b2fb58dee5e3e1b8dd805c8dc4966 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153813 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-14Make encodeForXml accessible for other modulesSzymon Kłos
and share similar code Change-Id: I7729a46d40845893f577c273c1ab340f69ebb51b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151230 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151754 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-24Remove unused comphelper::adjustIndexToStartOfSurrogateStephan Bergmann
...introduced in 28cc0bff10f5dcec0c7b698ae7ba275845b2cad1 "Break comphelper::adjustIndexToStartOfSurrogate out of o3tl::iterateCodePoints" in preparation for bd5c3582581f37513f45b518e348f443d5d57334 "a11y: Fix returning unpaired surrogates when retrieving characters", but which never picked it up Change-Id: I5a10a3053d2f51333e27b74a808a41df7c1912ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152183 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-23tdf#155235 workaround gtk3 accessiblibility crashes on closeNoel Grandin
we are still working around the problem here, which is that various bit are not firing accessibility events when their children change. So clear the static map in comphelper on shutdown, to prevent crashes resulting from objects being kept alive after vcl has shutdown Change-Id: I3ae216b345a1bb4cb4e3fde3527e4d4aa5968f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152161 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-19loplugin:virtualdeadNoel Grandin
Change-Id: I089fd6b9281cc35768462e83a7e18588f357df4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-18tdf#63130 reduce large memory copies when reading from BinaryDataContainerNoel Grandin
rather than writing a bunch more code, extract the common part from comphelper::SequenceInputStream into a new base class Change-Id: I0d3561e3ca2e748b904128e3b5955e27196d7170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151943 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-09comphelper/servicedecl.hxx is unusedNoel Grandin
Change-Id: I3ddb06a31c746bfd7da72368a51266d688b1230b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151570 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-06update loplugin:stringview* for o3tl::iterateCodePointsNoel Grandin
And change o3tl::iterateCodePoints to use sal_Int32 for its second param, to integrate better with places where the parameter comes from an UNO API, which cannot use std::size_t Change-Id: I7b9dd2c9bc7f48e6c4a912f039f1b5dae7beae69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-05tdf#155149 Crash when exiting cell edit modeNoel Grandin
regression from commit 2dc240a82646fc23c673a6fd5a29ade934dd5b67 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue May 2 14:47:43 2023 +0200 improve AccessibleEventNotifier::addEvent and commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu May 4 10:06:14 2023 +0200 tdf#105404 [API CHANGE] add index to accessiblity change event (*) Send better index hints (*) Error check the index hints better (*) Convert asserts to warnings and fall back to old code when index hint is wrong. Change-Id: I8e752fc26e729c9c8926beb2c7b196f5418a147e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151419 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-05Break comphelper::adjustIndexToStartOfSurrogate out of o3tl::iterateCodePointsStephan Bergmann
...as what they do is orthogonal (and it turned out that the use case that motivated the addition of o3tl::iterateCodePoints in the first place needs them independently, anyway) Change-Id: Id33901a2f7ac627253654ee6d883305dcf5a456f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151415 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-02tdf#137544 reduce cost of AccessibleEventNotifierNoel Grandin
the ListenerContainer can be a moveable type, which means we can store it in a node and avoid an indirection and an extra allocation. Also use unordered_map to speed up lookups. Change-Id: I888f0418b035e459cce3facd956ba51db97335a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-19loplugin::unusedmethodsNoel Grandin
Change-Id: I6a07860edb13588b83345babeb53675aedc43f7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-14loplugin:stringviewparam improvementsNoel Grandin
improve the check by checking for methods that exclude using string_view, rather than checking for methods that __can__ use string_view, which leads to exposing some holes in our o3tl/string_view.hxx coverage. Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-12remove unnecessary methodNoel Grandin
Change-Id: I9ef8f2cb2e3836c879532f690794df642c2449de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150255 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-05avmedia,*: guess the mime type of media files based on file nameMichael Stahl
.. at least for the most popular types, and do it automatically in MediaItem::setURL(). This should work in practice in most cases and is much simpler than adding some type detection or calling into platform dependent avmedia backends. Remove the parameter that was only ever set to "application/vnd.sun.star.media" anyway, the same value that would be used if it's missing. Stop using that silly type for everything, only use it when guessing fails. In case an ODF document is loaded, it will use the mime type loaded from the file (see setting of MediaMimeType in SdXMLPluginShapeContext) and not guess it because that would require updating the entry in manifest.xml as well. Change-Id: I8ce29cf7425678ae11dda1d8c875be818f8623af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150049 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-04-02remove IEventNotificationHook from comphelper::OPropertySetNoel Grandin
this class is a copy of cppuhelper::OPropertySet, and this feature is unused in that class too, so we are not likely to need it Change-Id: I9e3f0f7d786052f87f5a18c67e9b78409752fd99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-31simplify subclasses of comphelper::OPropertySetHelperNoel Grandin
they should deal in terms of the fast property IDS, they should not need to override setPropertyValueImpl, so just remove this, and standardise on the subclasses overriding setFastPropertyValueImpl Change-Id: I190955ccc4ae3e07dd481a1044f3c074dd1a40aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-31make some method in comphelper::OPropertySetHelper finalNoel Grandin
Change-Id: Ia745a0d7568cf8f9180ed2e28cfd11da94cd186a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-30loplugin:stringadd in variousNoel Grandin
when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I8cf6a47ad357ddc73e2c430d966be72d5efd1485 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149767 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-13lok: introduce resetCompatFlagXisco Fauli
and reset logic of setCompatFlag/isCompatFlagSet changed in afb7b373c34bd6a1608a30eb8267fa6f8231e853 "CppunitTest_sc_tiledrendering: reset CompatFlag in tearDown Otherwise, there are some tests setting it to scPrintTwipsMsgs, so depending on the order of execution, it might affect other tests" Change-Id: I306ac0b77b65f99879f4018cfbc57354a158f38a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148783 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-13convert UnoControlModel and friends to use std::mutexNoel Grandin
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-02-22create new OPropertyChangeListener2 and use it in FmFieldWinNoel Grandin
create OPropertyChangeListener2 as a modified copy of OPropertyChangeListener which uses std::mutex instead of osl::Mutex Change-Id: Ic6be1c62992749e4f0dd23a8c95de63dc45eba3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-22OPropertyChangeListener::setAdapter can be privateNoel Grandin
Change-Id: I5b849babe365300d1b6443caaacce45f4c7bf7c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147431 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-22BaseMutex->std::mutex in CommandDispatchNoel Grandin
Change-Id: Ic73a84eb793d45e1041698e45e2c844a1e2f2f66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>