summaryrefslogtreecommitdiff
path: root/comphelper/source/misc
AgeCommit message (Collapse)Author
2023-11-10avoid unnecessary intermediate bufferNoel Grandin
and make it more obvious that we are doing recursive stuff here Change-Id: I00209e0123eaacb015484949700ea0c983278fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159285 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10reduce noise in exceptionToStringImplNoel Grandin
otherwise we end up with log messages like wrapped: void message: "at C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/comphelper/source/misc/diagnose_ex.cxx:66" when we call ourself to print out sub-exceptions Change-Id: I9e598a6b68469e9baa3232811f310b7e24f1b77e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159284 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: comphelperStephan Bergmann
Change-Id: I2a422f921739adf81131082d57ab7601dfb46d8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158147 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
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-13loplugin:unodispose in comphelperNoel Grandin
Change-Id: I0f23916204fd6d96b2b1641effe693cb0764f630 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-09-06a11y: Just use std::map::clearMichael Weghorn
... instead of creating an empty map and calling `std::map::swap`. Change-Id: Ieb53cc1a75d1e52452987ad234562d175f762ad0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156582 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-25Revert "use more Reference::query instead of UNO_QUERY_THROW"Noel Grandin
This reverts commit 7fc6063914432d58d86cfcbd728d967e7c86ebfd. sberg noticed that there is a difference now: there's a subtle difference now, in that if y was null originally, it would have thrown a (caught) exception, whereas now it will crash in the y.query<X>() call. Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18use more Reference::query instead of UNO_QUERY_THROWNoel Grandin
since querying with exceptions is consideably more expensive Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-22Simplify a bit construction of AccessibleEventObject objectJulien Nabet
Change-Id: I0012de655d2ea24c822cf10828e7a31fa2e535ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154754 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2023-07-17Simplify a bitMike Kaganski
Change-Id: Iaf09fd3ad3587cdd7079c70785cdee6ea52b247e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154531 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-26replace find_if by none_ofDr. David Alan Gilbert
A set of cases where find_if is used just to test if there are no matches; use none_of as per tdf#153109 Change-Id: I6c705ab7a8289914743199722a444ee40d11d746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-25merge some stringaddsNoel Grandin
found with a lightly tweaked version of the loplugin:stringadd and some hand-holding. Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-23a11y: Fix returning unpaired surrogates when retrieving charactersColomban Wendling
Fix implementations of XAccessibleText's getTextAtIndex(), getTextBeforeIndex() and getTextBehindIndex() when called with AccessibleTextType::CHARACTER to return the whole code point rather than an unpaired surrogate. This is still not perfect because XAccessibleText::getCharacterCount() will return an incorrect value (code units rather than code points), but it fixes the most useful case of retrieving the character at e.g. the caret offset. This fixes the GTK3 and Windows backends as well without further changes. Qt6 also mostly works according to Michael Weghorn, but for a bug on Qt's side (https://bugreports.qt.io/browse/QTBUG-113438). MacOS backend doesn't seem to be affected in the first place. Change-Id: I53f07bcba78c6b267939257542a521b106101e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151303 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
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-10re-enable typeid checking in exceptionToStringImplNoel Grandin
now that we have valid RTTI tables for the UNO proxy objects generated by the bridge code. (We won't get a useful typeid for them, but for all other objects, we will, so this is still worth doing) Change-Id: I32bfa0099a242021f353fc4065e8660eb6c7cd93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151585 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> 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-02improve AccessibleEventNotifier::addEventNoel Grandin
we use the OInterfaceContainerHelper4 notifyEach function to avoid copying a vector of listeners Change-Id: I96476bb6100630a5c5d0f5d0973f821de702db39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151290 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-25Add script to find unused using declarationsGabor Kelemen
As a complementer to clang-tidy-12 --checks="-*,misc-unused-using-decls" Pros: - simple, fast! - finds some more unused declarations, somehow - works on non-linux specific parts of the code - clang-tidy (for me) trips on files with external headers, this does not Change-Id: If2db989114ac5c2841ed2e89ff7bd7a9e419f567 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150612 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-24loplugin:unnecessarygetstr extend to more std::string checkingNoel Grandin
suggested by mike kaganski Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-23use more TOOLS_WARN_EXCEPTIONNoel Grandin
so we get more complete information when something goes wrong Change-Id: Ia73623f748b0779cf80b0086bd8258791590e9ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-21loplugin:unnecessarygetstr extend to checking std::string::c_strNoel Grandin
Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 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-12fix o3tl::equalsAsciiLNoel Grandin
after I got it wrong in both the original commit commit d15a6560bd445cd1931e9fded6ad8ecfdd54211b use more string_view and in the attempted fix commit dd41ea3ec1f579fabb9f674184b52c1be77e2fdb fix for o3tl::equalsAscii thanks to sberg for spotting that Change-Id: Iff12879de823553b2623db48979e9a720302f2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150240 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-11fix for o3tl::equalsAsciiNoel Grandin
from commit d15a6560bd445cd1931e9fded6ad8ecfdd54211b use more string_view where the new method was named incorrectly Change-Id: Ia4513fa67f5bda8b6cb56e3db22df48b5e3c7283 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150217 Tested-by: Jenkins 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-03-24loplugin:stringadd in c*Noel Grandin
after my patch to merge the bufferadd loplugin into stringadd Change-Id: I66f4ce2fd87c1e12eefb14406e0e17212f68ceff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149497 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-11osl::Mutex->std::mutex in OOfficeRestartManagerNoel Grandin
Change-Id: I473d604346280cb24c299e0e6d6ca2621a2200a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148658 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-10CppunitTest_sc_tiledrendering: reset CompatFlag in tearDownXisco Fauli
Otherwise, there are some tests setting it to scPrintTwipsMsgs, so depending on the order of execution, it might affect other tests Change-Id: Ib0d08b1fe4e172bd5b03d63260e6b1c3fde26595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148635 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-19osl::Mutex->std::mutex in OWeakEventListenerAdapterNoel Grandin
Change-Id: I3ebd6cfdb8ff76b2d1988c3c481ef4effa5c2964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-09re-apply "optimize ConfigurationProperty::get()"Noel Grandin
This reverts commit 05b2bfc289df8712097cc1e640bf7d3bc6b86a84, but adds clearing of some more members, which were holding onto references to bits of config data after the config service was disposed. Change-Id: I9969ee2472445e4e1dbe8ea15e081401845ad29c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146605 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-06Revert "optimize ConfigurationProperty::get()"Xisco Fauli
This reverts commit 7df433cdc33b4d6ba38eafad9282d015571433ef and its follow-ups: * b4b63d0c46979ad6b6aae5d6a4ea6672ea248e10 "try to fix some shutdown crashes" * 203ad037ccb9fdebffea4f622229ded90635eb8b "try to fix shutdown crashes in ConfigurationWrapper" since it introduced a crash starting with LibreOffice 7.4 See https://crashreport.libreoffice.org/stats/signature/void%20rtl::str::release%3C_rtl_uString%3E(_rtl_uString*) Later, it was reverted in libreoffice-7-4 branch with df79a29ea20fb698d650be45a48c607f54476dea "Revert "optimize ConfigurationProperty::get()" (7.4 only)" so the crash is no longer reported in that branch. OTOH, Noel tried to fix it in master/libreoffice-7-5 branches with the two commits mentioned above but the crash is still being reported in LibreOffice 7.5 After talking to him, he suggested to revert it all Finally, adapt code to make loplugin:stringviewparam happy with getPropertyValue Change-Id: Id9fa97d2a81a590e53abd027e978d2d6179222b8 Change-Id: Id2e3475c342770be5705a74b9c0b45f45d6be5ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146586 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-29lok: support per-user timezoneAshod Nakashian
This adds support for user-specific timezone. When none is provided during loading, the system default is used. Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk> Change-Id: Ie863450687eb82bc475268a09c9112e9fd50020f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144816 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit abaf8c0af1c6c7fe01276fdf2ae62419c7b0f654) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146211 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-25Use ImplInheritanceHelper in OAccessibleTextHelperStephan Bergmann
(Explicitly deleting the special member functions is needed to avoid MSVC > include\cppuhelper/implbase.hxx(152): error C2280: 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper(comphelper::OAccessibleExtendedComponentHelper &&)': attempting to reference a deleted function > include\comphelper/accessiblecomponenthelper.hxx(220): note: see declaration of 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper' > include\comphelper/accessiblecomponenthelper.hxx(220): note: 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper(comphelper::OAccessibleExtendedComponentHelper &&)': function was explicitly deleted > include\comphelper/accessibletexthelper.hxx(133): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText>>(cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText> &&)' being compiled > include\comphelper/accessibletexthelper.hxx(133): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText>>(cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper,com::sun::star::accessibility::XAccessibleText> &&)' being compiled ) Change-Id: I00377be4a5fb44b2ef2b5001823ca0d89ead026b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146109 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-25Use ImplInheritanceHelper in OAccessibleSelectionHelperStephan Bergmann
(Explicitly deleting the special member functions is needed to avoid MSVC > include\cppuhelper/implbase.hxx(152): error C2280: 'comphelper::OAccessibleComponentHelper::OAccessibleComponentHelper(comphelper::OAccessibleComponentHelper &&)': attempting to reference a deleted function > include\comphelper/accessiblecomponenthelper.hxx(191): note: see declaration of 'comphelper::OAccessibleComponentHelper::OAccessibleComponentHelper' > include\comphelper/accessibleselectionhelper.hxx(120): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection>>(cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection> &&)' being compiled > include\comphelper/accessibleselectionhelper.hxx(120): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection>::ImplInheritanceHelper<cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection>>(cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper,com::sun::star::accessibility::XAccessibleSelection> &&)' being compiled > include\cppuhelper/implbase.hxx(151): error C2248: 'comphelper::OAccessibleComponentHelper::OAccessibleComponentHelper': cannot access private member declared in class 'comphelper::OAccessibleComponentHelper' > include\comphelper/accessiblecomponenthelper.hxx(191): note: see declaration of 'comphelper::OAccessibleComponentHelper::OAccessibleComponentHelper' > include\comphelper/accessiblecomponenthelper.hxx(185): note: see declaration of 'comphelper::OAccessibleComponentHelper' ) Change-Id: I2414d9f777de42b62c33492a90299aa9a9d53699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146108 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>