summaryrefslogtreecommitdiff
path: root/ucbhelper
AgeCommit message (Collapse)AuthorFilesLines
2023-11-23tdf#158321 No error message when file doesn't existNoel Grandin1-2/+6
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-16tdf#146386 deprecate, remove usage of Inet::Settings::ooInetFTPProxyNameMichael Stahl1-33/+1
* officecfg: deprecate Inet::Settings::ooInetFTPProxyName/Port * ucbhelper: stop handling these settings * sfx2: remove SID_INET_FTP_PROXY_NAME and SID_INET_FTP_PROXY_PORT and usage from SfxApplication::GetOptions() * shell: remove proxy config code from backends * stoc: the JavaVM would have its "ftp.proxyHost" properties set based on officecfg values; remove that * sysui,vcl: remove protocol from KDE desktop files and file picker Change-Id: Iba02676cf6e519e2fa60ba925209436d38e75f49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159500 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-15loplugin:unusedmethodsNoel Grandin3-157/+0
Change-Id: I1e125bbd388953491b3f869641484fea737d39ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159423 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: ucbhelperStephan Bergmann1-10/+10
Change-Id: Ib4b300e8b21f772c97dcb49d666f93d2821f0859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158247 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-14Use exception ctors, instead of setting members laterMike Kaganski2-12/+4
Avoids overwriting source location in message Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-12loplugin:unusedmethodsNoel Grandin1-4/+0
Change-Id: I27782fb4b912d8b0d5f19cbe296c2a3b98b2bfd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann1-1/+1
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-02reduce allocations in InterceptedInteractionNoel Grandin1-4/+4
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-08-18ucbhelper,ucb,desktop: InternetProxyServer is problematicMichael Stahl1-5/+12
It turns out that every single client of InternetProxyDecider simply concatenates the 2 members of InternetProxyServer into a single string and passes it on to curl_easy_setopt(CURLOPT_PROXY), which will happily take a URL including scheme and everything. It turns out that the awful GetUnixSystemProxy() tries to cut off the scheme in a terrible way, but GetPACProxy() does no such thing and WINHTTP_PROXY_INFO::lpszProxy may or may not contain scheme in its entries; fix this to only separate the port and leave the rest alone. So why do we need a InternetProxyServer struct? Because officecfg has separate entries that correspond to its members, and so InternetProxyDecider gets separate events on its listener interface when any of them changes, which is easiest to handle if it stores these separately. So just return a concatenated URL with or without scheme in getProxy(). Change-Id: I43c696471c8bec90667b5930fa00975adb432fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09Use _beginthreadex instead of CreateThreadMike Kaganski1-2/+4
The documentation for ExitThread [1] has this comment: A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multithreaded version of the CRT. If a thread created using CreateThread calls the CRT, the CRT may terminate the process in low-memory conditions. Since ~all our code uses CRT, be safe and use _beginthreadex. [1] https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createthread Change-Id: If3e566592e921b00240e08aa759d8cdbc421d44b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155513 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-27Use getXWeak in ucbhelperMike Kaganski3-9/+9
Change-Id: I6bdc3acf86854fe3f91aa09cb52d67a2b11ca8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150879 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-07improve some usage of OInterfaceIteratorHelper4Noel Grandin1-5/+1
we can drop the lock immediately after construction (since the iterator holds a thread-safe COW link to the underlying listener container) Change-Id: I08f8fa9ed7393747938572097f3c25f5f3f847fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-30loplugin:stringadd in ucbhelper..uuiNoel Grandin1-17/+6
when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I49549347c1c041cc9ce103aed1fe1cc3bc1a780f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-20osl::Mutex->std::mutex in ucbhelper::FdInputStreamNoel Grandin1-5/+5
Change-Id: I10482c3a5f9848f45463837d5d8982476b3910a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147340 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13enforce proper locking when calling OInterfaceContainerHelper4Noel Grandin1-2/+2
Change-Id: Ic86305f3d16148925c7753200a687f36f08a6516 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-12ucb: remove unnecessary commentsChris Sherlock12-73/+2
Change-Id: I56b8766526972bbf75425baabcecab9f45510fd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139763 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-10loplugin:passstuffbyrefNoel Grandin1-2/+2
Change-Id: Ib2b2650da7abc9260897f9b5aad619a0ea6ae941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138052 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-01Use some more O3TL_UNREACHABLEStephan Bergmann1-7/+1
Change-Id: Ibcf1b1de7b43460266e99fc9f27c1de0b510a361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136779 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-27clang-tidy modernize-pass-by-value in ucbhelperNoel Grandin7-30/+36
Change-Id: I9f73760a800bee5a810add9ee0ebed3a778ddd8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136475 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24elide some OUString allocationNoel Grandin1-1/+2
Change-Id: I29df28792eb413005a85235fce7295320798ae65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23elide some OUString allocationNoel Grandin1-1/+2
Change-Id: I5f0b9057b86ec98b66b4ce2d6c681b8cb93d49e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-07tdf#121740 fast path in cancelCommandExecutionNoel Grandin1-6/+19
skip the cost of constructing a SimpleIOErrorRequest in the common case Change-Id: Ib0a8989a9ffa76e6b71f984e0f32be94ec5cb8ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-06osl::Mutex->std::mutex in Content_ImplNoel Grandin1-39/+52
Change-Id: I5e3983958629ac732c031b9b59e96deaac63e7ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03Just use Any ctor instead of makeAny in ucbhelperStephan Bergmann7-13/+13
Change-Id: I54169b62d93018d06655c92c0ba99fdee499a8e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133751 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29Revert "use more string_view in ucbhelper"Noel Grandin1-9/+10
This reverts commit d9c3f05dcb6c03633bbcc8d88e55237a0855d9a5. This is likely a pessimisation since the OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos ); was previously likely mostly just copying the whole string in which case it would return the same object. Change-Id: I1e09630f0095d194deb72f70bba2d65c04771487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133491 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28use more string_view in ucbhelperNoel Grandin1-10/+9
Change-Id: Ief60eda8be8e184b9d637ab84fec2f8740c04396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26Use o3tl::make_unsigned in some placesStephan Bergmann1-2/+3
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-12Recheck modules [uU]* with IWYUGabor Kelemen8-16/+4
See tdf#42949 for motivation Change-Id: If710445176681de8e0a0b6c65f58ecaca19dbccf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132768 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin1-3/+3
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08use more subView when converting to Int32Noel Grandin1-2/+3
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin1-3/+3
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-06No need to call makeStringAndClear to pass a string viewMike Kaganski1-1/+1
Change-Id: Ic794e91da7a8cc405116104544f02d1b659b753a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129553 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-21fix opengl slide transitionNoel Grandin1-2/+0
regression from commit 62efb188668a3296591dcfa3658185e2f982e356 use comphelper::WeakComponentImplHelper in SlideShowVie Switch notifyEach to leave the mutex locked after being called, because that seems to compose better - because after a call it is in the same state that was when we entered the call. Change-Id: I42e80cc7be1b65ed8cab24ab7c11210e056d916d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-14make comphelper::OInterfaceContainerHelper4 more threadsafeNoel Grandin2-10/+12
(*) make all the methods that require an external mutex take a std::unique_lock as a parameter, so that call sites cannot forget (*) make the forEach method drop the lock when firing listener methods, to reduce the odds of deadlock Change-Id: I0a80e3b3d1c1c03b7de4a658d31fcc2847690903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-14no need to hold OInterfaceContainerHelper4 by unique_ptrNoel Grandin2-19/+9
when empty, it is only a single pointer big anyway Change-Id: I3e45dd705c4bef3799435617db1a4192d62860e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128403 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in CommandProcessorInfoNoel Grandin2-39/+32
Change-Id: I7de1e3e822b272fa4719c9113089c5e4852498ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in PropertySetInfoNoel Grandin2-52/+48
Change-Id: I6db00939e9896fc2798d2eea09a7675fb9504f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127542 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in ResultSetMetaData_ImplNoel Grandin1-2/+3
Change-Id: I58d67d1d52241eeb01b98972779238b7abae5a68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-27osl::Mutex->std::mutex in ResultSet_ImplNoel Grandin1-46/+39
Change-Id: I1c1900e94893b42a3ad4a5ef58f0cfe277305344 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127544 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ucbhelper::PropertyValueSetNoel Grandin1-5/+5
Change-Id: Ie4d3392e26a24ff3ffd9869809bb48bee7fcc2bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127067 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18osl::Mutex->std::mutex in ResultSetImplHelperNoel Grandin1-10/+8
Change-Id: I7567369120593579740e23668d3426a25377a105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-17use more OInterfaceContainer3::notifyEachNoel Grandin1-6/+2
Change-Id: I0dd6e9f1514792e73a31e81896d09c27c1912318 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126966 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22use more OInterfaceContainerHelper3 in ContentImplHelper_ImplNoel Grandin1-21/+11
Change-Id: Id4e4fca8a5a4e2d050752e666a843e7d8661ec0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125635 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in ucbhelperMike Kaganski7-47/+14
Change-Id: I06b04e3eed46aba8aac528b2c394d60e733533a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124405 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-31Fix OSL_ENSURE in ucbhelperJulien Nabet1-1/+1
Following: https://cgit.freedesktop.org/libreoffice/core/commit/?id=6d200d8e739595bd4c6310bede7d66e3c05fbb85 loplugin:moveparam in ucbhelper Change-Id: I90bf228932887f66b7f9d2e61d2d17bfa91d1935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124531 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski2-2/+2
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski2-2/+2
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-10loplugin:moveparam in ucbhelperNoel Grandin1-2/+2
Change-Id: Id6b03af5ecd662ce2e390bb76819cfe5d2ec05ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06loplugin:moveparam in ucbhelperNoel Grandin1-4/+4
Change-Id: I1b9cc0366fb8e9b2525a56816ae4f76737a31b73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-07no need to use UNO_QUERY hereNoel Grandin2-8/+4
Change-Id: I1bfe8238d7c08f27d2b21f9fe79712aba045c812 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120152 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>