summaryrefslogtreecommitdiff
path: root/ucbhelper
AgeCommit message (Collapse)Author
2021-02-18loplugin:referencecasting add check for new rtl::Reference operatorNoel
rtl::Reference now has a conversion operator to uno::Reference, so look for places where we can simplify the code and use that. Change-Id: Ic81db50d670bed5e875300577d4bf5f3599cc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-05Revert "Fix typo in code"Stephan Bergmann
This reverts commit 3ed9bba283a6a67864c0928186e277240be0d9ba. osl_Pos_Absolut (include/osl/file.h) is part of the stable URE interface; it must not be changed. Change-Id: I1f49923a9351e4be5aee39b10720d38b424feb9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110435 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-04Fix typo in codeAndrea Gelmini
Change-Id: Ib8b306a27d25a34e784aeeb72708b0d5d1511f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110394 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-18tdf#123936 Formatting files in module ucbhelper with clang-formatPhilipp Hofer
Change-Id: Ic18cb095646f060046f83663f7b369533ffb481a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105723 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-11Drop some unused function parametersStephan Bergmann
Change-Id: I41ad8001e78ea82bf4d893b5faaa28400ff6efcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105575 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-14More fixes of uses of now-explicit OUString ctor taking raw sal_Unicode pointerStephan Bergmann
...in Windows-only code, after c927aab29ebfff1ce3ac0b2f27ae343025a9890c "Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicit". Interestingly, these occurrences were accepted by MSVC and only cause errors with clang-cl, so happened to go unnoticed until now. Change-Id: I33e7653e28a21541ef793b4b0750abb6037752db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104314 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-21Fix typosAndrea Gelmini
Change-Id: Iaf1d4aed07d1e6fcfe2392fb65cbd2fa196bcc1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101099 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-20Use OSL_UNREACHABLEStephan Bergmann
...in those places that used some code conditional on ENABLE_LTO to work around (non-)unreachability wranings. This removes all uses of the ENABLE_LTO C/C++ macro, so it can go completely. Change-Id: I67544986cb2d3fcd8051caf87c5129bd1086408c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101087 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-16loplugin:unusedmethodsNoel Grandin
Change-Id: I2dd10873be73256a3689233c7b1e37bde8f685ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03loplugin:flatten in ucbhelperNoel Grandin
Change-Id: Ic5a8ce908671bd492395bff01aa211b8bdd74ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: ucbhelperStephan Bergmann
Change-Id: Ie5e160e577ba0acc83617b2f4f2ca97b9d3f6da7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97727 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-10compact namespace in ucb..uuiNoel Grandin
Change-Id: I644d5e418028b4b4e66cf67b20a1155a689acab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-15Revert "loplugin:constfields in ucbhelper"Noel Grandin
This reverts commit 64035391ebe8810520a214a3ae0aeb4c1b039819. Change-Id: Icfde3e984f9ebf93a423d101aee385182f65dea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90518 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-17inline some acquire/release callsNoel Grandin
because these are all on the hot path, and in the best case, with enough inlining, the compiler can skip the call altogether and just do a locked CMPXHG instruction Change-Id: I099d6385f602e40e1767f9f1002b7514ecf436e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04move some headers inside ucbhelperNoel Grandin
Change-Id: Iccd80aa4e631abe002837ca61248e136de9a62eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87866 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-03remove some useless comment linesNoel Grandin
which merely announce that the next declaration is a class Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc Reviewed-on: https://gerrit.libreoffice.org/84229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19loplugin:fakebool (clang-cl)Stephan Bergmann
...plus follow-up loplugin:implicitboolconversion and loplugin:redundantcast Change-Id: I9fc9c5cb46fbb50da87ff80af64cb0dfda3e5f90 Reviewed-on: https://gerrit.libreoffice.org/83207 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-08use cppu::WeakImplHelper in CommandProcessorInfoNoel Grandin
Change-Id: Ifbb2d50b1d88f0bceed38bddd23858a54b8527dc Reviewed-on: https://gerrit.libreoffice.org/80403 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in ResultSetNoel Grandin
Change-Id: I9d6feef38532b0057e16fc3f25b0f285d3dfcb99 Reviewed-on: https://gerrit.libreoffice.org/80407 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in ResultSetMetaDataNoel Grandin
Change-Id: I28df6cd28ca099bb1a07c18a35eebd5529e094e9 Reviewed-on: https://gerrit.libreoffice.org/80409 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in ResultSetImplHelperNoel Grandin
Change-Id: If82ae3f5cee0ae893fd32ecafe3c7baf7ec00ed4 Reviewed-on: https://gerrit.libreoffice.org/80408 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in ContentProviderImplHelperNoel Grandin
Change-Id: I1b2c4a296de6d1d6769f9e82380d1b45d506daca Reviewed-on: https://gerrit.libreoffice.org/80406 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in PropertyValueSetNoel Grandin
Change-Id: I48b0292207a88234290ffc9a3ca5585ee9b924e3 Reviewed-on: https://gerrit.libreoffice.org/80405 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in InteractionRequestNoel Grandin
Change-Id: I5f79ac795d17158c3e74aa76baf8483892cec920 Reviewed-on: https://gerrit.libreoffice.org/80404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in PropertySetInfoNoel Grandin
Change-Id: I4da5d73ee7b531927066a1a4d4d7561ef9648483 Reviewed-on: https://gerrit.libreoffice.org/80402 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08use cppu::WeakImplHelper in ContentIdentifierNoel Grandin
Change-Id: Id9c0d5d1f69c516efdf45b070982bdf341e86ce8 Reviewed-on: https://gerrit.libreoffice.org/80401 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-08-23Mark move ctors/assignments noexceptMike Kaganski
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-16loplugin:sequenceloop in ucb..unotoolsNoel Grandin
Change-Id: Ie52d993c185ba43386b494baad0a484d5b365499 Reviewed-on: https://gerrit.libreoffice.org/77532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini
Change-Id: Ic49b4cc6f2d0e0ac4d2635da2447bc6a2db5322e Reviewed-on: https://gerrit.libreoffice.org/77275 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): ucbhelperStephan Bergmann
Change-Id: I7b795ca7180b87de717af9b7cbe59cb1bf130b36 Reviewed-on: https://gerrit.libreoffice.org/76633 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-15Drop GETVALUE_IMPL/SETVALUE_IMPL macrosArkadiy Illarionov
Replace with PropertyValueSet getValue/appendValue templates Change-Id: I5714e6c4e6daf5ba6a4a9f9b363de3a1541834da Reviewed-on: https://gerrit.libreoffice.org/74930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-29Flatten ContentProviderImplHelperArkadiy Illarionov
Change-Id: I0461ccfb2d9a9750b91863d9dee29cc5515201dc Reviewed-on: https://gerrit.libreoffice.org/74868 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-28Simplify Sequence iterations in ucbhelperArkadiy Illarionov
Use range-based loops or replace with STL functions Change-Id: I4e9f5ae006ecbc7513db7574e0f8e08c6940cdb7 Reviewed-on: https://gerrit.libreoffice.org/74828 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-02Use hasElements to check Sequence emptiness in [t-u]*Arkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: Idefe55e37f5c837c889548ffe7c5711400012a4d Reviewed-on: https://gerrit.libreoffice.org/71667 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-18Removed duplicated includesAndrea Gelmini
Change-Id: Id0222c9f6a7ef04ed46dc5ceacd814619b4d7c21 Reviewed-on: https://gerrit.libreoffice.org/70912 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-16tdf#42949 Fix IWYU warnings in ucbhelper/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Also include/ucbhelper had some false positives not yet on the blacklist Change-Id: I4500271ea35efd7e140c76255df95ff7bbdf9f27 Reviewed-on: https://gerrit.libreoffice.org/70745 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-22loplugin:unusedfields in ucb,ucbhelperNoel Grandin
Change-Id: Id15c92e54669bd5f26adfe0d0b9dda0e8894ccf3 Reviewed-on: https://gerrit.libreoffice.org/68161 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11loplugin:indentation in ucb..ucbhelperNoel Grandin
Change-Id: Ifa4b34065dacf9e144f076631c57f1d01aedaeeb Reviewed-on: https://gerrit.libreoffice.org/67608 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-01loplugin:useuniqueptr in ContentImplHelperNoel Grandin
Change-Id: I56909fcaf8088a353bbd0bb783c88d51b9f0822f Reviewed-on: https://gerrit.libreoffice.org/62654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24clang-tidy performance-unnecessary-copy-init in test..xmlscriptNoel Grandin
Change-Id: I1ae16467a8e58e8a50f59b7a140e9f8b68bde07e Reviewed-on: https://gerrit.libreoffice.org/62254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22Simplify containers iterations in ucb, ucbhelperArkadiy Illarionov
Use range-based loop or replace with STL functions. Change-Id: I3cdb0f89523008199af1550de164a52b75c52ba5 Reviewed-on: https://gerrit.libreoffice.org/62088 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27loplugin:constfields in ucbhelperNoel Grandin
Change-Id: Ic9d59b352dcb771191de963c0f6e90c74647c8b8 Reviewed-on: https://gerrit.libreoffice.org/60983 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>