summaryrefslogtreecommitdiff
path: root/cppuhelper
AgeCommit message (Collapse)Author
2020-05-18android: Actually let's avoid the exceptions via bridges only on aarch4.Jan Holesovsky
Change-Id: Id2830f09ca6afd11f6f866565f37bdb7ba45bfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84205 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-05-18android: Avoid throwing exceptions through the bridges.Jan Holesovsky
From some reason it does not work, so let's do the same we are doing on iOS; at least for now. Change-Id: I915f8683a112548fc3defc1114f9dce3aa7be30e Reviewed-on: https://gerrit.libreoffice.org/84067 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/84204 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-05-08preload: cleanup failed module load warnings and rename them.Michael Meeks
Change-Id: Iafa89df6f724fa6b64712d970502091e38300dad Reviewed-on: https://gerrit.libreoffice.org/83341 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-19improve and enable loplugin:fragiledestructorNoel Grandin
Where the problem was benign and the class was not extended, I marked the class as final. Where the problem was benign and the class was extended, I marked the relevant callee methods as final. Other cases were excluded in the plugin. Change-Id: Idb762fb2206af4e8b534aa35ff77f8368c7909bc Reviewed-on: https://gerrit.libreoffice.org/79089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-19loplugin:constvars in cppuhelper..desktopNoel Grandin
Change-Id: Iaf42114ab98875c4bc1545684f1893540b998ef2 Reviewed-on: https://gerrit.libreoffice.org/77723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet
in cppuhelper, desktop, drawinglayer, embeddedobj, extensions Change-Id: I4c970f08c0723299f79c9e18bc71b7372a7092e4 Reviewed-on: https://gerrit.libreoffice.org/77636 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-12Optimize cppu::supportsService to use const methods of SequenceMike Kaganski
... and standard algorithm instead of loop. Change-Id: Ic90fa7e227807768f094b9fc231f3ba3d48e6139 Reviewed-on: https://gerrit.libreoffice.org/77350 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): cppuhelperStephan Bergmann
Change-Id: I6535fd0cf4f8b906c62fa51cb555da548c6e99ae Reviewed-on: https://gerrit.libreoffice.org/76688 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-29loplugin:sequentialassignNoel Grandin
Change-Id: I56a9bf698b60bd278c71cc632aacef2bd2f4c13f Reviewed-on: https://gerrit.libreoffice.org/76501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19loplugin:referencecasting in cppcanvas..cuiNoel Grandin
Change-Id: Ib8a513d88575cef9c1479b91adff98170c9323e8 Reviewed-on: https://gerrit.libreoffice.org/75937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18Resort pProperties when really needed (cppuhelper)Julien Nabet
so not when pProperties[i-1].Name == pProperties[i].Name and call getConstArray() only if there have been a sort Found when testing tdf#125941 when editing table: $8 = uno::Sequence of length 29 = { {Name = "AutoIncrementCreation", Handle = 49, Type = uno::Type "string", Attributes = 0}, {Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 0}, {Name = "CatalogName", Handle = 30, Type = uno::Type "string", Attributes = 0}, {Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes = 0}, {Name = "DefaultValue", Handle = 20, Type = uno::Type "string", Attributes = 0}, {Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 0}, {Name = "Description", Handle = 19, Type = uno::Type "string", Attributes = 0}, ... Change-Id: I645f7d24d552222cf520e346f4505f5a14979a30 Reviewed-on: https://gerrit.libreoffice.org/74124 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-05Use hasElements to check Sequence emptiness in cppcanvas..desktopArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-22New loplugin:dataStephan Bergmann
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-12regenerate PCH headersLuboš Luňák
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-20Fix typoAndrea Gelmini
Change-Id: I08d6e2cb30c54b9e7b11498850e5f5cd7de1a98d Reviewed-on: https://gerrit.libreoffice.org/70994 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-29preload: cleanup disabled messages and simplify flow.Michael Meeks
Change-Id: I249b81afe5ec2fab5e0aaf73a2cde62173fa803e Reviewed-on: https://gerrit.libreoffice.org/69912 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-03-25preload: add the ability to disable various components.Michael Meeks
Helps filter stupid stuff that makes no sense for online - eg. reportbuilder or jdbc. Change-Id: I40e06954c45fdefd21528202f4587ae83eb994c2 Reviewed-on: https://gerrit.libreoffice.org/69567 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-03-17tdf#120703 PVS: remove redundant static castsMike Kaganski
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I6d1523e71b3e06be1cf41abaabb44e49fe11cd8e Reviewed-on: https://gerrit.libreoffice.org/69369 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04Revert "new loplugin typedefparam"Noel Grandin
This reverts commit 9865440d217d975206a3f91612f0666312bc8fd8. This is not ready to land yet, seems like the latest update of the logic reveals a bunch more places I need to fix before it can land.
2019-03-04new loplugin typedefparamNoel Grandin
verify that parameters use the exact same typedef-names (if any) in definition and declaration Change-Id: I55d2817f599b0253904dce2d35a1a93967e15a77 Reviewed-on: https://gerrit.libreoffice.org/68439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-03Simplify containers iterations in cppcanvas, cppu, cppuhelperArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I72bf7cdb632c04e2fc8d4f7ab85cb6571222aa07 Reviewed-on: https://gerrit.libreoffice.org/68636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-19Some uses of C++17 class template argument deductionStephan Bergmann
Change-Id: I47c469c0fcdff41d83729be9489c946e81ef3686 Reviewed-on: https://gerrit.libreoffice.org/68020 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-14tdf#42949 Fix IWYU warnings in cppuhelper/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I0eebd82b96d630da0597166cf87d398072607c13 Reviewed-on: https://gerrit.libreoffice.org/67473 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-08loplugin:indentation in cppu..cuiNoel Grandin
Change-Id: If625e5bf38ca8e1f12686038c7c9be8d0303b6f6 Reviewed-on: https://gerrit.libreoffice.org/67536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-28Do not use indexed getToken for a single callMatteo Casalin
Change-Id: Ib1026754a7db034af5910d84d008d0ef997ebb96 Reviewed-on: https://gerrit.libreoffice.org/65672 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2018-12-17kde5: remove older kde/tde plugins, and references to thatThorsten Behrens
KDE4 is out of maintenance upstream since Nov. 2014, and binaries provided by TDF have switched to KDE5 as the official backend. Change-Id: I165465b56d3ba3a18912b203c06ae8fc6111c0c9 Reviewed-on: https://gerrit.libreoffice.org/60014 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-21improve function-local statics in basic..cuiNoel Grandin
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee Reviewed-on: https://gerrit.libreoffice.org/63701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-11cppCheck narrowed variableScope rEntryZdibák Zoltán
Change-Id: I04b0b0dc85afdceead9766d8a45e21055074d5fc Reviewed-on: https://gerrit.libreoffice.org/63248 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-11-04replace double-checked locking patterns with thread safe local staticsMike Kaganski
Change-Id: I1bf67196e97411aeecc13ed4f91d1088a315e323 Reviewed-on: https://gerrit.libreoffice.org/62839 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-27tdf#120703 (PVS): V519 The variable is assigned values twice successivelyMike Kaganski
Change-Id: I9265425a215609ef6bf4298ba39c8399f215ce27 Reviewed-on: https://gerrit.libreoffice.org/62406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V794 The assignment operator should be protectedCaolán McNamara
Change-Id: Ia443a0e61a091d877c8da26bf7d45bf4261f8669 Reviewed-on: https://gerrit.libreoffice.org/62166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-17loplugin:staticvar in cppuhelper..desktopNoel Grandin
Change-Id: I21cf6bafab6e865b90b29caa73183a8e00b538d1 Reviewed-on: https://gerrit.libreoffice.org/61865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-01loplugin:useuniqueptr in ComponentContextNoel Grandin
no need to store such small movable and ref-counted objects separately Change-Id: Idf4262a8edbfe07fcb4b96d1025924224b72b5b6 Reviewed-on: https://gerrit.libreoffice.org/61113 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-15Re-think cppu::throwException() and the C++/UNO bridge on iOSTor Lillqvist
It seems that on iOS, where we don't have any Java, Python, BASIC, or other scripting, the only thing that would use the C++/UNO bridge functionality that invokes codeSnippet() was cppu::throwException(). codeSnippet() is part of what corresponds to the code that uses run-time-generated machine code on other platforms. We can't generate code at run-time on iOS, that has been known forever. Instead we have used some manually written assembler to handle it instead. We used to have a Perl script to generate a set of code snippets for different cases, different numbers of parameters of the called function and whatnot, but that went away at some stage some year ago. (It is unclear whether that broke the C++/UNO bridge on iOS, or whether the stuff continued to work even after that.) Anyway, this handwritten assembly, or the manual construction of internal data structures for exceptions, or something else, seemed to have bit-rotten. Exceptions thrown with cppu::throwException() were not catchable properly any longer. Instead of digging in and trying to understand what is wrong, I chose another solution. It turns out that the number of types of exception objects thrown by cppu::throwException() is fairly small. During startup of the LibreOffice code, and loading of an .odt document, only one kind of exception is thrown this way... (The lovely css::ucb:InteractiveAugmentedIOException.) So we can simply have code that checks what the type of object being thrown is, and explicitgly throws such an object then with a normal C++ throw statement. Seems to work. Sadly the cppu::getCaughtException() API still needs some inline assembly in the C++/UNO brige. That seems to work though, knock on wood. This commit also adds a small "unit test" for iOS, copied from cppuhelperm to ImplSVMain(). Ideally we should not copy code around of course, but have a separate unit test app for iOS that would somehow include relevant unit tests from source files all over the place. Later. Change-Id: Ib6d9d5b6fb8cc684ec15c97a312ca2f720e87069 Reviewed-on: https://gerrit.libreoffice.org/60506 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28Fix typo in codeAndrea Gelmini
To complete commit: e9fa088735bfbd34bc81f1925438691f746db070 It passed "make check" on Linux Change-Id: I2772b1ac5d4024bb11f3e09e24afc566b7091fb8 Reviewed-on: https://gerrit.libreoffice.org/59693 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins