summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2021-12-07improve loplugin:cow_wrapperNoel Grandin2-16/+60
to find my previous attempt at this, which only obscured the problem <noelgrandin> I'm such an idiot <noelgrandin> I changed a whole bunch of code to avoid calling const methods on a non-const object <noelgrandin> from p->foo() to std::as_const(*p).foo() <noelgrandin> can you spot the mistake? <bubli> Is this a job interview question? :D <vmiklos> noelgrandin: you did the opposite, now you always call const member functions, while you wanted to always call non-const member functions? <noelgrandin> more like a "why didn't the smart people on this channel tell me I was an idiot" :-) <noelgrandin> in this case, we have o3tl::cow_wrapper, which overrides operator* and operator-> <vmiklos> ah, and by the time you would add/remove the const, cow_wrapper already did the expensive task of copying based on const/non-const <noelgrandin> exactly <thorsten> heh Change-Id: I5366e6a87c414b862668b61e6adfbccfdd9d3b04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-07loplugin:unusedmethodsNoel Grandin2-287/+467
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-07loplugin:unusedfieldsNoel Grandin4-268/+284
Change-Id: Id39c3f484a364fb5163444febe99aee79daf1a76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-07loplugin:unnecessaryvirtualNoel Grandin2-85/+65
Change-Id: I231195c36d620254cbcd2f4d7bbb9044f7887fe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-30Silence loplugin:badstaticsStephan Bergmann1-0/+5
> /Users/stephan/lo/core/vcl/osx/a11yfocustracker.cxx:40:33: error: bad static variable causes crash on shutdown [loplugin:badstatics] > static AquaA11yFocusTracker SINGLETON; > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ > /Users/stephan/lo/core/vcl/inc/osx/a11yfocustracker.hxx:85:35: note: ... due to this member of 'AquaA11yFocusTracker' [loplugin:badstatics] > std::set<VclPtr<vcl::Window>> m_aDocumentWindowList; > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ Change-Id: I7fd0b1808e5433bab6e1436c345044a5ce804f4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126115 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-26-FIIntrin.h in CC/CXX is no longer needed for my clang-cl buildStephan Bergmann1-0/+1
...at least with Clang 14 trunk now (but I didn't check which llvm commit would be responsible for that, and which version of LLVM that appeared in first). That also means the -D_CRT_RAND_S hack in CXX is no longer needed either. (See the mail thread starting at <https://lists.llvm.org/pipermail/cfe-dev/2015-November/046012.html> "[cfe-dev] clang-cl question".) Change-Id: If1b1b4fa17782161c3b72ac68fdef28b0e044a31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125859 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-23Fix test for clang-cl with the MSVC template instantiation modelStephan Bergmann1-0/+3
(Otherwise, the FunctionDecl's body was null and all the error and note diagnostics were flagged as expected but not seen.) Change-Id: I32acb6e0028433c9b40545cf91d8fe1acd19a77a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125682 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-22sw: prefix members of SwDBManager, SwWebGlosDocShell, SwWordCountWrapper ...Miklos Vajna1-1/+1
... and SwZoomControl See tdf#94879 for motivation. Change-Id: I74f31e45a8c215d406371a23b64d548fbb851d28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125641 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-17drop unused PopupMenuFlags::NoHorzPlacementCaolán McNamara1-2/+0
Change-Id: Ic279160f96e5aa2a37690f987c2323b91b2ec49c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125415 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-17retire loplugin:simplifyboolLuboš Luňák2-176/+0
The plugin was originally written to rewrite dumb old OOo code like 'variable != 1 ? true : false'. All that code has already been rewritten, and now this plugin just enforces matter-of-taste stylistics on new code. Change-Id: I8cd2accd7c0ac365b75dcba51a9049bf9e293869 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125346 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-17remove loplugin:finalprotectedLuboš Luňák2-35/+0
It just forces a custom rule that serves no real purpose. There's no technical difference. If one day a class gets inherited from then this information will be lost/incorrect. And mixing access on a virtual function is poor style. Change-Id: I0c27db8d694ad191a118d4e1d3d4a240e00456fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125337 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-15Adapt CompilerTest_compilerplugins_clangStephan Bergmann1-6/+6
...to Clang 14 trunk <https://github.com/llvm/llvm-project/commit/4d8fff477e024698facd89741cc6cf996708d598> "[clang] retain type sugar in auto / template argument deduction" Change-Id: I3f106eeedf00e622c294c4e4c8326cf3a5e418cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125214 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-11Drop ScGlobal::GetEmptyOUString() and EMPTY_OUSTRINGMike Kaganski4-24/+0
OUString default ctor already uses a static instance (through rtl_uString_new), no need to have another module-specific static. Commit d8037ae18a297229d1b79f8f76331abfd548350d had removed its sw counterpart some time ago. Change-Id: I140fe13bc1f6b0cbe188e83e602fdebe995e467a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125061 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-10new loplugin:stringliteraldefineNoel Grandin2-0/+228
look for #define FOO "foo" that can be converted into OUStringLiteral. This is the first pass of this plugin, only doing those #define which are local to a single compilation unit. Change-Id: Ic8610e29ec42c36d03db5014a93c244315d5bbea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124962 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-10Avoid unhelpful loplugin:stringview from implicit conversionsStephan Bergmann2-12/+19
> compilerplugins/clang/test/stringview.cxx Line 149: instead of an 'rtl::OString' constructed from a 'const rtl::OStringLiteral<4>', pass a 'std::string_view' [loplugin:stringview] > compilerplugins/clang/test/stringview.cxx Line 150: instead of an 'rtl::OUString' constructed from a 'const rtl::OUStringLiteral<4>', pass a 'std::u16string_view' [loplugin:stringview] (see the discussion at <https://gerrit.libreoffice.org/c/core/+/124950> "operator==(OString, OStringLiteral)") Change-Id: I5481bef8b8bad7bf9bdf4fff29161f0809051f2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124990 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-09Adapt test to clang-cl on Windows (sal_Int32 typedef int vs. long)Stephan Bergmann1-2/+2
Change-Id: Ic3a27643bd3d5ca3a25449171a3a59140b915769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124901 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-03Silence loplugin:toolslong in ucb/source/ucp/webdav-curl/CurlSession.cxxStephan Bergmann1-0/+1
...similarly to how it was already done for its ucb/source/ucp/webdav-neon/NeonSession.cxx cousin Change-Id: I78124f45d4cb08131ee5d6e8c2606b38407c0668 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124637 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-03loplugin:constparamsNoel Grandin1-9/+11
Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-02Tweak loplugin:implicitboolconversion to allow some more bool -> sal_BoolStephan Bergmann2-53/+77
...in templated code, to cater for the needs of <https://gerrit.libreoffice.org/c/core/+/124400> "Prepare for removal of non-const operator[] from Sequence in testtools". For one, by defining ImplicitBoolConversion::TraverseInitListExpr, make sure that Clang versions before and after <https://github.com/llvm/llvm-project/commit/0a42fe70a566f22599e04a6f1344ca2dc5565e17> "[AST] Treat semantic form of InitListExpr as implicit code in traversals" behave the same. Old versions of Clang would have erroneously reported Sequence<Sequence<sal_Bool>> s2{ { false } }; (and reported Sequence<Sequence<sal_Int32>> s4{ { false } }; twice) in compilerplugins/clang/test/implicitboolconversion.cxx when one of the four combinations of syntactic/semantic visit of the outer/inner InitListExpr defeated the intended suppression logic in ImplicitBoolConversion::TraverseCXXStdInitializerListExpr. And for another, ImplicitBoolConversion::TraverseInitListExpr can subsume the exising ImplicitBoolConversion::TraverseCXXStdInitializerListExpr. But for a third, that would still make Sequence<Wrap2<sal_Bool>> s6{ { false } }; in compilerplugins/clang/test/implicitboolconversion.cxx emit a false warning, so add a cheesy "TODO" chicken-out special case to ImplicitBoolConversion::checkCXXConstructExpr for now. Change-Id: Ib9a1b78a7812feb98c673b75a357af7737168342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124583 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-01loplugin:unusedmember: Work around more cases not marking an enum as referencedStephan Bergmann2-5/+40
...similar to the "For some reason..." workaround already present in VisitElaboratedTypeLoc. (Thanks to mst for finding this.) Change-Id: Ic682e8290efa64093d3c4a831dfb4d23091b6056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124559 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-26tdf#142010 XLS import: fix bad calculation after editingLászló Németh1-8/+0
Inserting a column messed up formulas in the test document of tdf#142010. This was a regression resulted by the tdf#89281 fix for a performance regression in XLS import related to shared formulas. Revert of commit ba686b9bd2596811141e4028947334f10799c356 "tdf#89281 fix performance regression of XLS import - cleanup" and commit b18b5b7edf3d14ef5f0efe53e367f88a423088c4 "tdf#89281 fix performance regression of XLS import". Change-Id: I96636fb1d84939385efbe7054a4271ff10b88907 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124151 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-25Adapt to Clang 14 trunk diagnostic output changeStephan Bergmann4-15/+15
<https://github.com/llvm/llvm-project/commit/aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7> "Recommit: Compress formatting of array type names (int [4] -> int[4])" Change-Id: I911934a778fddde0d0022f2e2601d1f9c371fe69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124142 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-20loplugin:indentation check for indent inside blockNoel Grandin2-14/+41
look for places where the statements inside a block are not indented Change-Id: I0cbfa7e0b6fb194b2aff6fa7e070fb907d70ca2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-19tdf#145203: FIREBIRD cannot create a tableJulien Nabet1-0/+3
Regression from: https://cgit.freedesktop.org/libreoffice/core/commit/?id=1cf57765dd9a66982ecf9cd33687005a70c70c3f 2021-10-08 loplugin:moveparam in connectivity Change-Id: Iec0fa1597e63d42ee3a905bf55eff798b3f46177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123787 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15loplugin:unnecessaryoverride corner case is subsumed nowStephan Bergmann2-8/+1
...by modifications done to the plugin in af908d9f18fbb83a5c393f856026cebefd821f18 "Avoid usage of incomplete types in member functions defined in-class" (if the dtor's definition is spelled `= default;` rather than `{}`, but which should always be possible) Change-Id: Iddce2baf3635a12131854e86a609951309ffbc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-15Avoid usage of incomplete types in member functions defined in-classStephan Bergmann2-3/+7
...that started to fail now at least with clang-cl (where the MSVC rules when to emit inline member function definitions are more aggressive than for other ABIs) with --with-latest-c++ and --with-visual-studio=2022 (where usage of incomplete types in std::vector now triggered > In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:31: > In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\memory:11: > In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\exception:12: > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(744,50): error: incomplete type 'Primitive' used in type trait expression > struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(59,53): note: in instantiation of template class 'std::is_trivially_destructible<Primitive>' requested here > struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest...>::type { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(64,44): note: in instantiation of template class 'std::conjunction<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here > _INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value; > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\xmemory(934,20): note: in instantiation of variable template specialization 'std::conjunction_v<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here > if constexpr (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) { > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(1632,13): note: in instantiation of function template specialization 'std::_Destroy_range<std::allocator<Primitive>>' requested here > _Destroy_range(_Myfirst, _Mylast, _Al); > ^ > C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(583,9): note: in instantiation of member function 'std::vector<Primitive>::_Tidy' requested here > _Tidy(); > ^ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(74,5): note: in instantiation of member function 'std::vector<Primitive>::~vector' requested here > TransitionScene( > ^ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(42,7): note: forward declaration of 'Primitive' > class Primitive; > ^ etc.). Which in turn required tweaking of loplugin:unnecessaryoverride to avoid false > In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:67: > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(389,18): error: unnecessary user-declared destructor [loplugin:unnecessaryoverride] > TransitionScene::~TransitionScene() = default; > ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ > C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(81,12): note: declared here [loplugin:unnecessaryoverride] > inline ~TransitionScene(); > ~~~~~~~^~~~~~~~~~~~~~~~~~ Change-Id: Ia72fb44e6e92ff47376d7b7159c0df7cbf883b69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123648 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski3-132/+1
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-12loplugin:unusedmethodsNoel Grandin2-602/+556
Change-Id: Ifd3a1ccef68ebc4cd4e7785357e6a476f6669eb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-12loplugin:unusedfieldsNoel Grandin4-387/+393
Change-Id: I5e9bb4417cf6f8e3c1de1c8570e0635fdf6364bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123453 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-12loplugin:moveparam check for collection paramsNoel Grandin2-34/+115
Empirically, when we are passing a collection type to a constructor, 80% of the time, we are passing a local temporary that can be moved instead of being copied. Change-Id: I5acc9d761c920691934a4be806a3d3ab6cdbab96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123056 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann2-33/+7
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-09Rename bookmrk* -> bookmark*Julien Nabet2-3/+3
Change-Id: I9dec77b2af8abe5abb286ff76ed85d1e4078ee6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123325 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-07drop 'using namespace std' in compilerpluginsJulien Nabet2-84/+80
Change-Id: I12b4e32b9561657bdbe062b5fb7c18e2ef6ce601 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123196 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-04loplugin:constmethodNoel Grandin1-1/+25
Change-Id: I56af10be5f1155db4c7f2190495fe036a9b4236a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123054 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-03A more lightweight O[U]StringConcatenationStephan Bergmann2-6/+24
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-02new loplugin:moveparamNoel Grandin2-0/+170
Look for places where we can pass Primitive2DContainer by move reference and so avoid unnecessary copies. Change-Id: I1db167feba6d1a616ca6fc39778118ae20106bd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122964 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-01loplugin:constparamsNoel Grandin1-1/+4
Change-Id: I0d1ad95a9944c9077a1b9db11f2ae05f993c2b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122900 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constmethod handle more casesNoel Grandin1-9/+33
remove some of the naming limitations, and handle pointer parameters better. I only let the plugin run up till vcl/ Change-Id: Ice916e0157031ab531c47f10778f406b07966251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constparams improve handling of pointer paramsNoel Grandin2-2/+47
Change-Id: I4c0002e72703eded435bfe4985f5b0121bf8524b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28Make loplugin:bufferadd look through O[U]String::operator std::[u16]string_viewStephan Bergmann2-0/+15
Change-Id: I79a32f64541a90b0b824f7721e8815c1e7c873ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122788 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-27tdf#89383 DOCX import: fix permission for editingTünde Tóth1-2/+2
w:writeProtection passwords in DOCX documents created with Word weren't asked and verified to permit editing. Change-Id: I53d73e3acaf0c0fd398ded2de52e1d8ef00cfd56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122384 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-23Extend loplugin:stringviewparam to starts/endsWithStephan Bergmann2-3/+5
Change-Id: I4b8fb5e963e582836440587dcaa2922cb5d05bc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-22Adapt to Clang 14 trunk change in diagnosticsStephan Bergmann3-3/+3
<https://github.com/llvm/llvm-project/commit/131e8786640a49daf533b7ead4d3b5b82e0aea2a> "Print nullptr_t namespace qualified within std::" Change-Id: Idb3ebceadfa5a831429b8c3239de426e599eb9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122459 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-22fix crash in compilerplugins/clang/unnecessaryoverride.cxx:328Michael Stahl1-0/+3
Somehow the compountStmt doesn't have anything in the body? Happens in CurlSession.cxx but not sure where. Change-Id: I69bd2e694e22c891f34242b8bee28012e793f0c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122457 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2021-09-18make FORCE_COMPILE_ALL more flexible than all or nothingLuboš Luňák17-26/+31
Rename it to FORCE_COMPILE and it takes the --enable-symbols specification of what to include, for example FORCE_COMPILE="all -sw/ -Library_sc". Change-Id: I92afd8e0abc75d3566285c197d6640c26c03db36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122248 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-15loplugin:virtualdead HasExtraRedlineTable always returns trueNoel Grandin2-33/+30
Change-Id: Ibc703b4c2adc6c6579cc4be50d274504ba957f45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15loplugin:unusedfieldsNoel Grandin4-349/+117
m_pSoftMaskStream is dead since commit 581e7d7057afa87036d84e42c0e0a8a7368e20c7 Author: Joseph Powers <jpowers27@cox.net> Date: Thu Sep 1 20:51:15 2011 -0700 unusedcode.easy: PDFWriter cleanup Change-Id: If397981fb09a7b74ba2294513c13186cc51ad5fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15loplugin:unnecessaryvirtualNoel Grandin2-65/+83
Change-Id: Ia7617a0fd4413cbaafaae8fbfee2b2ea819fde8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-13loplugin:mergeclassesNoel Grandin2-30/+90
Change-Id: I908518ac14715f7e546a154b1d5a5ab77eeb4155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122021 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-13loplugin:cow_wrapperNoel Grandin2-0/+121
check the classes that use o3tl::cow_wrapper so that they don't unnecessarity trigger copies Change-Id: I545e627598217f3e61ba2c384adb8d4f8b404829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>