summaryrefslogtreecommitdiff
path: root/comphelper
AgeCommit message (Collapse)Author
2022-01-21fix opengl slide transitionNoel Grandin
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-21Fix typosAndrea Gelmini
Change-Id: I6ba7c7db6c58fde2e7648ccf32b93fc05f5eae65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128620 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-21comphelper: move JsonToPropertyValues() from desktop/Miklos Vajna
Because filter/ code will need this in a bit, and that can't depend on desktop/. Change-Id: I07f0f8ef30942a2d11388c6721c7f277e117bfba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128709 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-20comphelper: fix UAF in SequenceOutputStreamService dtorMichael Stahl
Change-Id: I91f77ee9ab4d509ebee3d04f94a3c63986de0ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128657 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-19WASM more initial bits and piecesJan-Marek Glogowski
All the small stuff, which is needed for the WASM build, but is not really worth an extra patch. * No soffice.sh script needed for WASM * WASM soffice.bin executable extension is html * Some small additional SAL_LOG output * Default to colibre icon theme * Test for qt5 even without X11 * Remove emconfigure artefacts at the end of the configure run * No oosplash for WASM * Disable the Office IPC thread * Suppress -Wno-enum-conversion for Cairo builds * Fix libnumbertext by using gb_EMSCRIPTEN_CPPFLAGS * Map EMSCRIPTEN to LINUX nls * No extra newlines for missing icon theme images * Print the missing dependency in some gbuild error messages * Copy Qt WASM loader, HTML template and SVG logo for binaries * Especially build the vcldemo for Emscripten Change-Id: I356370c72cc09357411e14d0c00762152877a800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128584 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14make comphelper::OInterfaceContainerHelper4 more threadsafeNoel Grandin
(*) 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-13Recheck modules [a-c]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I74a3c3a67c3639376e2251c3eb917fa4139dfbd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127808 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-10small cleanups to TempFile related codeNoel Grandin
unnecessary temporary variables Change-Id: Iefa6c9a6627311495e6cd2f01f5446082ae0589d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-09Simplify some TempFile service codeNoel Grandin
Change-Id: Id39be33dcc5aa9378e29c850cb71d3662093ab25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-09implement anyToHash() and use it for SdrCustomShapeGeometryItemLuboš Luňák
Using anyLess() still has quite some cost with bsc#1183308, this makes the cost almost unnoticeable. Since some values of Any are not handled, return empty std::optional for those cases. Change-Id: Ib45a81441e8bb456c4749f9bc53a981f09bbb1a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128109 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-01-09use C++ class handling ownership for anyToString()Luboš Luňák
This matches changes I did for anyLess() in my previous commit. Change-Id: Id38c49c10223340b7359765e1071d8a9f72ba92e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128046 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-01-09make anyLess() work also for compound types such as sequencesLuboš Luňák
The previous implementation used the specific predicates, which are not recursive. And since that'd require constructing Any instances, which copies, which would be slow, write new code based on anyToString() instead. Change-Id: I439f81d4b1efbd46c10d50d0725a5f6f40968b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128045 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-12-26Let comphelper::Base64::decode* take std::u16string_viewMike Kaganski
Change-Id: I5b04f7adf11c61f52b7bfb0f52c8c075f838f0f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127480 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-26Avoid OUStringBuffer::toString where possibleMike Kaganski
Change-Id: I99abbe97a48b2077e28d6221fb70036e5e412657 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127479 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-26fix comphelper::WeakComponentImplHelper::queryNoel Grandin
Which was not hanling queries for sub-interfaces. We need to copy the complicated query function from cppuhelper, unfortunatly. It has a signature that includes the base class, so we cant re-use it. Change-Id: I3668abb67c6cb669086ce32505b383ac11d3c3ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127511 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25Revert "Init WeakComponentImplHelperBase::m_bDisposed"Mike Kaganski
This reverts commit c1f21a6ce6491ac82a022502c618e2758d3b3a31. Reason for revert: a better fix is implemented in commit f0c0c62c10e4ffdb9ce44202e2540d2f39a9fcb5 author Noel Grandin <noel.grandin@collabora.co.uk> date Sat Dec 25 11:43:11 2021 +0200 uninitialised field in comphelper::WeakComponentImplHelperBase That change allows to keep the ctor implicitly defined and inline. Change-Id: Icb8064ebc77d4120d279d30df5de4ebee5479b4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127474 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-25pass unique_lock as param in WeakComponentImplHelperBase::disposingNoel Grandin
so that subclasses can drop the lock while calling listeners Change-Id: I6105438110af08f10b0ed50057b28172c3442b95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25Init WeakComponentImplHelperBase::m_bDisposedJan-Marek Glogowski
From the Jenkins_Linux_Ubsan TB: /comphelper/source/misc/compbase.cxx:20:9: runtime error: load \ of value 190, which is not a valid value for type ´bool´ ... in comphelper::WeakComponentImplHelperBase::dispose() \ /comphelper/source/misc/compbase.cxx:20:9 Maybe also the problem breaking Java for the Jenkins_Linux_Dbg since the comphelper::WeakComponentImplHelperBase patches went in. Regression from commit 252dd254b5b29298457b889623783152e9bed534 ("new comphelper::WeakImplComponentHelper"). Change-Id: Idebf6dfcc051f8fcb4cde1fb66d40b38e6f9dddc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127449 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-25tdf#145090 LO Calc Crash with drop-down-menuNoel Grandin
avoid attempting to call into widgets while in the middle of dispose regression from commit 8d485ec0cd35ee1ae7684f2b6ca96c0f0c6f9dac IsDisposed->isDisposed in vcl/../window Change-Id: If346dc9dc8547f8da28d091bfa20eff39162a0b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24new comphelper::WeakImplComponentHelperNoel Grandin
to replace the cppu:: equivalent with a lightweight version that uses std::mutex instead of osl::Mutex Change-Id: I1b7873a0c2d9cda21f529e43a4ac2fa7574c91a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127335 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21loplugin:flatten in canvas..cuiNoel Grandin
Change-Id: I208767eaa60d913fe2882403f1f9351eb08256f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-19use more cppu::BaseMutexNoel Grandin
Change-Id: I7ac096acfde05aa58a48fb76e895e880e27225d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-19use more cppu::BaseMutexNoel Grandin
Change-Id: Iddd7438161ead93b27cf8e8058ca5b1eae3d8001 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18add unit tests for OInterfaceContainerHelper3Noel Grandin
Change-Id: I2baf512a3b5edd3ce29e302e444dfa5e65724613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127007 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-17loplugin:unusedvariablecheck improveNoel Grandin
to find unused smart pointer variables Change-Id: I200bdd8949032a0e061de61f7903a156651793e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127006 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-17use more OInterfaceContainer3::notifyEachNoel Grandin
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-12-16comphelper : use std::mutex in numberedcollectionArnaud Versini
Change-Id: Ifd8b1668ceac69f5393a279ffb19070655149e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124126 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-07loplugin:unusedmethodsNoel Grandin
Change-Id: Ic1ba90447575278d854af85312271c41766b776b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03replace comphelper::OListenerContainer with OInterfaceContainerHelper3Noel Grandin
OInterfaceContainerHelper3 is in wide use and can do the same thing with less ceremony Change-Id: I5252738d6b7bda6245c66da46352944ead79bd52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03Rather use ScopeGuard to prevent catch and rethrowStephan Bergmann
...than 6bc5d6cac2fd9e029357c618510a3b5f3aa7c085 "remove counter-productive catch-all blocks" Change-Id: I07fe5821ef5bf60f74f5ceb5feedd7dc79e73dfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126275 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2021-12-03use OMultiTypeInterfaceContainerHelperVar3 in GenericPropertySetNoel Grandin
Change-Id: I8ce94a11b632f51086480acef8dcfc3e8bea1b65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126193 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-29remove counter-productive catch-all blocksNoel Grandin
There is no point in these - the rethrow will crash the process anyway, so trying to recover anything is a waste of time. And they very unhelpfully obscure the stacktrace of the actual underlying problem. Change-Id: I8e4439e5e2c517aa80a1750a05c207d274c73012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125980 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-27use more OInterfaceContainerHelper3 in ImplEventAttacherManagerNoel Grandin
Change-Id: I5c73d61a5b7a0a7fcc218e0ee839be5b9fdbb987 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125916 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-27use more OInterfaceContainerHelper3 in OPropertyBagNoel Grandin
Change-Id: I915614c8e70a0f179655530b2c8822fa06c21386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125915 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22osl::Mutex->std::mutex in MimeConfigurationHelperNoel Grandin
Change-Id: Ib9a628d42448aea858271094ef5bdaac022b0f21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in OLockListenerNoel Grandin
Change-Id: I391de15296932ea65f2335b0df7a76e2f77a1a50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-09rtl::Static to thread-safe staticNoel Grandin
Change-Id: I35e2a252708228bdbeaee557ef35763c64608653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-04comphelper : use std::mutex in enumhelperArnaud Versini
Change-Id: I871c406e8ff94e646545cb82e0d1e2e2ec80c6e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-01comphelper: fix SequenceOutputStreamService::getWrittenBytes()Michael Stahl
With com.sun.star.io.Pipe, you must call closeOutput() or reading from the other end will block forever. If you use com.sun.star.io.SequenceOutputStream, you can't read the output after calling closeOutput() on it because for no good reason it throws a NotConnectedException. Let's just fix it so that a sequence of closeOutput() then getWrittenBytes() returns the finished buffer. Change-Id: Ia6ce28ec05e00e5f1c703dea8669e0271c0b9c20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123057 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-29Prepare for removal of non-const operator[] from Sequence in comphelperMike Kaganski
Change-Id: Ie4f3675adc888ecf175c5342c87d416f34f8dce1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124351 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26tdf#144374 DOCX: export the password for editingTünde Tóth
The password for editing wasn't exported in DOCX, resulting unprotected documents in Writer and in MSO 2019 or newer. Change-Id: Ieb8a339795635bc1c4223ccbe2a40ea85222cc2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123543 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-22LOK: maintain blocked command list per viewPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h include/sfx2/viewsh.hxx libreofficekit/source/gtk/lokdocview.cxx sfx2/source/view/viewsh.cxx Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22LOK: unify freemium APIs and uno command restriction APIsPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKit.hxx sfx2/source/control/unoctitm.cxx Change-Id: I3badb038822331ab5cb30df6a66ce9a0640cf340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124047 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22LOK: introduce way to restrict uno commandsPranam Lashkari
With this new API we can define which uno commands to restrict their functionality Conflicts: desktop/qa/desktop_lib/test_desktop_lib.cxx include/LibreOfficeKit/LibreOfficeKit.h include/LibreOfficeKit/LibreOfficeKit.hxx include/sfx2/viewsh.hxx Change-Id: I9f3fd659d373e56542c5323922a53564f1cfb27b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124046 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-19Remove a std::remove_reference_tStephan Bergmann
...which is unnecessary (short of dubious explicit invocations like `makePropertyValue<int const &>(i)`) as T can never be deduced to be a reference type there. And add some test code (that also tests the bit-field scenario mentioned in the commit message of 23cded985ba0131f85ee445492c04871fbfb6351 "Specialize comphelper::makePropertyValue for arithmetic types"). Change-Id: If41ce20ab643041dd9721d05373eeb32fd099ead Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-18make RR easier to useNoel Grandin
breaks easily without the RNG being repeatable Change-Id: Ia464a04f0623668088564c7121f39f04aa68b2ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-15Simplify vector initialization in comphelperJulien Nabet
Change-Id: Ibcf65cbbf5c0619813bd87a6deb4b75fe524986e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123661 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15comphelper: fix bad error handling in CreatePackageEncryptionData()Michael Stahl
Not sure if rtl_digest_SHA1 can realistically return an error but avoid out-of-bounds write in this case. (regression from commit 9188ea83c346fdc2f668178ae7538665a1b09c02) Change-Id: If5f134cbcd9236338d1938242a469d7c79e87f06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123649 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>