summaryrefslogtreecommitdiff
path: root/ucbhelper
AgeCommit message (Collapse)AuthorFilesLines
2020-03-15Revert "loplugin:constfields in ucbhelper"Noel Grandin2-4/+4
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 Grandin2-116/+0
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 Grandin9-6/+252
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 Grandin3-4/+0
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 Bergmann4-1/+32
...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 Bergmann1-2/+2
...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 Grandin1-32/+0
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 Grandin1-45/+0
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 Grandin1-31/+0
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 Grandin1-33/+0
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 Grandin1-28/+0
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 Grandin1-32/+0
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 Grandin1-49/+0
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 Grandin1-29/+0
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 Grandin1-52/+0
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 Grandin2-12/+6
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 Kaganski1-2/+2
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 Grandin2-6/+6
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 Gelmini1-1/+1
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 Bergmann2-2/+2
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 Illarionov1-121/+120
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 Illarionov1-111/+97
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 Illarionov7-165/+100
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 Grandin1-1/+1
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 Illarionov2-2/+2
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 Gelmini1-1/+0
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 Kelemen15-31/+38
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 Grandin1-4/+1
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 Grandin1-2/+2
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 Bergmann1-1/+1
...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 Grandin1-8/+5
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 Grandin1-1/+1
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 Illarionov2-32/+13
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 Grandin3-17/+10
Change-Id: Ic9d59b352dcb771191de963c0f6e90c74647c8b8 Reviewed-on: https://gerrit.libreoffice.org/60983 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann1-2/+2
...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-13tdf#42949 Fix IWYU warnings in include/ucbhelper/*Gabor Kelemen12-0/+24
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7bfeef47abaf94cfb355db95c0fdb928ce36c0a6 Reviewed-on: https://gerrit.libreoffice.org/60232 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-12loplugin:simplifyconstruct in ucbhelper..vclNoel Grandin3-6/+1
Change-Id: Id435bb3289dcfd9a7aeca6a661e249085958cb7c Reviewed-on: https://gerrit.libreoffice.org/60392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:returnconstant in ucbhelper,drawinglayerNoel Grandin1-2/+1
Change-Id: I4e84c570fe0e555a3aeb1f11632715de466d6e0e Reviewed-on: https://gerrit.libreoffice.org/58192 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-11clean up UNO available() implementationsNoel Grandin1-1/+1
There seems to be some confusion here. available() is actually the number of bytes that can be read without blocking, but most implementations seems to be just returning the number of bytes remaining in the stream. Since we're doing that, let's do it properly. (*) some of them were just casting, instead of clamping, which will return wrong values sometimes. (*) FileStreamWrapper_Impl/OInputStreamWrapper/OTempFileService were doing unnecessary work, instead of just asking the underlying SvStream for it's remaining size Change-Id: I3ef26e0363e989ed3e00be0fdb993e1cdeb7819f Reviewed-on: https://gerrit.libreoffice.org/57264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29tdf#114227 Add support for OS proxy to ucbhelper::InternetProxyDecider on UnixNoel Grandin1-12/+51
Also make m_nProxyType a scoped enum so the code is a little easier to follow. Change-Id: Ic2862a1de8fe1005c4fb25147b3effc49b95140c Reviewed-on: https://gerrit.libreoffice.org/56599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-26tdf#114227: Add support for PAC to ucbhelper::InternetProxyDecider on WindowsMike Kaganski2-3/+155
Change-Id: I62c76efb354949699615a44d9482df24e3eaa314 Reviewed-on: https://gerrit.libreoffice.org/56433 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-03-12loplugin:redundantfcast look for redundant copies in return statementsNoel Grandin1-1/+1
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-18Fix typosAndrea Gelmini1-1/+1
Change-Id: I633e4921042809c628e55825b70c540767eba1d3 Reviewed-on: https://gerrit.libreoffice.org/48140 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-11loplugin:useuniqueptr cppu,idlc,io,ucbhelperNoel Grandin2-45/+21
Change-Id: I6d8c24fabd52b39c66ce0b88b547df7ec85dad76 Reviewed-on: https://gerrit.libreoffice.org/47725 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-24loplugin:passstuffbyref even more return improvementsNoel Grandin1-1/+1
Change-Id: I2a752025cd429e4d271626402dce5d8a8b0c76d2 Reviewed-on: https://gerrit.libreoffice.org/47021 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin1-1/+1
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-05one slash is enoughDavid Tardon1-1/+1
Change-Id: I35fbca7592f3e17a071df567f691c62fe9232fc1
2017-11-03Replace lists by vector or deque in ucb/ucbhelperJulien Nabet1-20/+8
Change-Id: I9f72d7c8ab48f8dc2eec779db2f40531a33db6f9 Reviewed-on: https://gerrit.libreoffice.org/44238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-25loplugin:constmethod in comphelper,ucbhelperNoel Grandin3-8/+8
Change-Id: I27a860fbbedd2174c60c199af18cae76e02abc25 Reviewed-on: https://gerrit.libreoffice.org/43759 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: ucbhelperStephan Bergmann13-23/+23
Change-Id: I47fe099aa042085e71a08f4260e78773a25c2860