summaryrefslogtreecommitdiff
path: root/comphelper
AgeCommit message (Collapse)Author
2024-03-30tdf#42982 Add error messages to thrown exceptionsRMZeroFour
As part of the efforts in #42982 to improve the UNO API error reporting, this commit adds error messages in several files to help improve debugging experience. Change-Id: I7a51d4fd1e3a57798d70bc3464b034649948a287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165253 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-03-30tdf#146619 Drop unused 'using namespace' in: comphelper/Gabor Kelemen
Change-Id: I96982faf40e7654b0f8f26b666a17cbd057886a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165516 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-28Add comphelper::WeakImplHelperBaseNoel Grandin
in the same way I added WeakComponentImplHelperBase Change-Id: I26d93004c3ddf716063cfb2ded1bbda1b76c2a98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165449 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28lok: add isForkedChild method.Michael Meeks
This can be used to tag short-lived transient 'save' processes to encourage them not to mutate eg. filesystem state that is shared with the parent process. Change-Id: I027d18cbe4ce519b31c4fc1d3ac46b916d1efc87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165407 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 9dab5edb90d14ad6f71cc2ac96cc504c1e8c290b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165427 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-26convert ODatabaseMetaDataResultSet to comphelper::WeakComponentImplHelperNoel Grandin
Which means making a copy of comphelper::PropertyContainer Change-Id: I14a61fa40e2c1dfc66833e00817025397584b3ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165345 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-26Fix typoAndrea Gelmini
Change-Id: Iabc9a271c0c7d2c11da1db629335dcf7c73fff52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165331 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-26tdf#160184 ask user if they want to trust an untrusted certificatePatrick Luby
gpgme contexts uses the "auto" trust model by default which only allows encrypting with keys that have their trust level set to "Ultimate". The gpg command, however, gives the user the option to encrypt with a certificate that has a lower trust level so emulate that bahavior by asking the user if they want to trust the certificate for just this operation only. Also, abort saving if no certificates are selected which is an indication that the user cancelled the Select Certificate dialog. Change-Id: I20951b1e31b2dcf8adb82243742f8c00fbaca8c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165260 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-09Support o3tl::iterateCodePoints with both sal_Int32 and std::size_tStephan Bergmann
...and clean up the most gross casting offenses Change-Id: If0d646fb3e73e71a9a2735569395034973563a1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-08use more string_viewNoel Grandin
found by tweaking the stringview loplugin Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-06Use less boost_headers in low level librariesGabor Kelemen
Most of these don't use boost themselves, nor do they need it transitively since the use of boost::optional was removed Change-Id: Ic9dee1c4e160b313ec5b91677b02ffdea6c5779d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164440 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-02-27tdf#42982 Improve UNO API error reportingAhmedHamed
Change-Id: Ia27365b3e5539cdf0f96f01a96bbe58653eb46c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163788 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2024-02-23Fix warning C4477 when building with MSVC without -Wv:18Mike Kaganski
Discovered by https://gerrit.libreoffice.org/c/core/+/163717 Like these: C:/lo/core/comphelper/source/windows/windows_process.cxx(254): warning C4477: 'wprintf' : format string '%s' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'const void *' Change-Id: Ia804bad18366d4f9422d72f3061c83cb07e92073 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163783 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-22tdf#159519 comphelper,package: do not store document without SHA256Michael Stahl
The problem is that on Windows 7 the password-encrypted documents are stored unencrypted, without any error message. This is due to defensive programming in OStorageHelper::CreatePackageEncryptionData(), which happily continues if creating the SHA256 hash fails, which is the one required for storing anything newer than ODF 1.1. Also, the poorly named ZipPackage::GetEncryptionKey() should check for consistency, the expectation is that either there's no encryption key (empty sequence), or the expected one is in the sequence. Creating the SHA256 uses the crypto::NSSInitializer component, which is in xsec_xmlsec.dll, which is linked to libxmlsec-mscng.dll, which is linked to Win32 bcrypt.dll, which doesn't have BCryptKeyDerivation on Windows 7; to reproduce elsewhere, rm instdir/program/libxsec_xmlsec.so (regression from commit 26bf26272bf525b59b4a4ce18b3ce14c1febfd7b and (due to revert) commit bfd479abf0d1d8ce36c3b0dcc6c824216f88a95b) Change-Id: I0b22e20f6d4d0b1a12ed7d99fac7b5243910f9ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163708 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-02-13tdf#158237 comphelper: Use C++20 contains() instead of find() and end()AkshayWarrier
Change-Id: I99c27c2269051c6c145dbfd2ec12790d4bb1d5e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162338 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-02-13fix windows --enable-mergelibs buildNoel Grandin
after commit b663d94cf67a5af4fd89c1ac8bdffd6059f6bf85 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Feb 5 08:50:24 2024 +0200 create --enable-mergelibs=more Change-Id: Ib9f0b3b28df70a9bab10d9bb0aa77a2b2decc616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-13tdf#158237 comphelper: Use C++20 contains() instead of find() and end()Steven Casey (SMCode)
Change-Id: Iadb1203b1bd3f560c09ee38944c50190eed5735f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163269 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2024-02-12tdf#158337 use std::erase instead of std::remove followed by erasevarshneydevansh
Change-Id: I36043cd3aa234f98bd0b7cc2868e9094976472b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163123 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Hossein <hossein@libreoffice.org>
2024-02-09cid#1591762 Uncaught exceptionCaolán McNamara
Change-Id: I84af562e2900acfdfc1cef16d2745d9596cc7a56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163194 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-08tdf#157042: Revert "re-apply "optimize ConfigurationProperty::get()""Xisco Fauli
This reverts commit 3a4a00a51acca8f9b5e775547abff0c4dc9144d7. <x1sc0> noelgrandin, regarding tdf#157042, the commit was reverted in 24-2 and 7-6 branches but not in master so I was wondering what to do next. There are clear steps on how to reproduce it in comment 27 but it seems the crash is not reproducible with a debug build ( according to comment 37 ) <noelgrandin> x1sc0, let me try to reproduce that <noelgrandin> x1sc0, I cant reproduce, please just revert that on master Change-Id: I45dcf8f4b422e1a19eaa41ec7614db569b5aac7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163125 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-06elide some OString temporariesNoel Grandin
Change-Id: I2ecb6af11c95605c84e935b850fe94a1831a1497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163043 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-04cid#1591493 Unchecked return valueCaolán McNamara
Change-Id: I0d39e142d3fd4100f68f1fff3f9d305aa1b59728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162954 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-01check that rtl_random_getBytes() was successfulMichael Stahl
... everywhere it is used to generate material for encryption. Change-Id: Id3390376bb2f3a5fa1bbfd735850fce886ef7db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162873 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-17Add back XComponentContext to officecfg::...::get() callsStephan Bergmann
4256c764aee0777770466115a97420d9b55c23ac "do not pass XComponentContext to officecfg::...::get() calls" had removed it, for performance reasons, but 8a695046cfcc8f9ec835b208b0d56ca821a3ff84 "tdf#158375 Hack to make sure process service factory is set" is a case where it should be passed in. To hopefully avoid performance regressions, don't default to comphelper::getProcessComponentContext() for what gets passed in, but default to an empty Reference and only call comphelper::getProcessComponentContext() when actually needed in the implementation. Change-Id: I5b75ac2c28f36e21d1c8bc368b0b972c33c61a51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162205 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-16loplugin:unusedfieldsNoel Grandin
Change-Id: Ic53aacfc76cb73902cf5e304153975fa02509da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162110 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-06cid#1560051 Missing move assignment operatorCaolán McNamara
Change-Id: Ie59d391cd68f9d90fd8ac99a81ba8b997221165a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161716 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
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-29trace events: fix deadlock from non-recursive mutex.Michael Meeks
Release lock over s_pBufferFullCallback: #4 std::lock_guard<std::mutex>::lock_guard(std::mutex&) #5 comphelper::TraceEvent::getEventVectorAndClear() #6 0x00007f2367c61836 in comphelper::TraceEvent::getRecordingAndClear() #7 0x00007f236877263e in (anonymous namespace)::TraceEventDumper::flushRecordings() #8 0x00007f2367c60cb7 in comphelper::TraceEvent::addRecording(rtl::OUString const&) regression from: commit c2424341ed444647d979a69ae55268e96fad3d56 Date: Sun Jan 30 10:30:27 2022 +0100 comphelper : use std::mutex in traceevent Change-Id: Ic89d63d14f06d710937a4da759976ae308c9df45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161329 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-23ofz#65295 AbrtCaolán McNamara
Change-Id: I074a43191c4af304a2702012d0b810aad801d0d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161249 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-23cid#1545209 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: Idd82be5f2354787735f4e47e8cfe9e9a7371a973 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161203 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-22Use emplace_back instead of push_back (comphelper)Julien Nabet
Change-Id: Ie3b033dc159ee3f848afa3e8cbabdbdfd402e644 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161178 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-07simplify and modernise ScopedBitmapAccessNoel Grandin
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-29Extended loplugin:ostr: comphelperStephan Bergmann
Change-Id: I43baf9248f607b13720da4295eb2827b3f58b3f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160126 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-28tdf#156648 Prevent LO from adding an empty event listenerMatt K
The problem is that an empty interface listener can be added in Basic, which then crashes when trying to fire an event on that listener. The fix is to check for the existence of the listener before adding to the list of listeners. Change-Id: I3205ec1e6cdad431f6297f2b7833295b9eb64b8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-20Extended loplugin:ostr: comphelperStephan Bergmann
Change-Id: I338c3c263e940bbe6071827b2e19763b7dadc2e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159723 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-11-02'new Double' is deprecated in JavaNoel Grandin
replace with Double.valueOf Change-Id: If5be8e500e31ebf9d5fb20ea7dd474677d7c74ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158785 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-26cool#6893 cache the process component contextNoel Grandin
which we look up rather a lot Change-Id: Ie8bcf161a1d7a299a404f749cf08a13f33f7f1cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158506 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>