1843 Commits

Author SHA1 Message Date
Noel Grandin
70a60cece0 loplugin:unusedmethods
most of the removal is ripple effect from removing
    SvxIconChoiceCtrl_Impl::EditEntry
which became dead after
    commit 630b5db9a10cd49d24d5e563374bd68f1fe670f5
    Date:   Tue Nov 13 08:40:07 2018 +0200
    loplugin:singlevalfields in svtools
    
Change-Id: Ibfaa7c925cc5549a4858cc62c59d848aab72f460
Reviewed-on: https://gerrit.libreoffice.org/63481
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-17 07:31:54 +01:00
Noel Grandin
faa63cd14c new loplugin buriedassign
Change-Id: If6dd8033daf2103a81c3a7c3a44cf1e38d0a3744
Reviewed-on: https://gerrit.libreoffice.org/63466
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16 14:20:04 +01:00
Noel Grandin
a2751c0795 loplugin:staticmethods improvement
Change-Id: I8889ce8a7d2309b54454cfe4c6421282e1c6e755
Reviewed-on: https://gerrit.libreoffice.org/63434
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16 07:26:27 +01:00
Luboš Luňák
2dbda86cca make ScInterpreterContext also accessible without passing it around
E.g. ScModelObj::GetFormatter() can be rather deep in the call chain
and it just doesn't make sense to pass ScInterpreterContext* to
all the relevant places (and it's a question if it makes sense
to pass it around at all, googling shows that thread_local is not
really _that_ slow).

Change-Id: I9114ef8a10d82a10968391718099edccde7a2663
Reviewed-on: https://gerrit.libreoffice.org/63184
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-11-14 16:05:55 +01:00
Stephan Bergmann
638d619866 "oh dear, what can the matter be?"
Lets assume that e3290499009492e39e5ddd870d314bb5df494199 "loplugin
singlevalfields improvement" enabled loplugin:singlevalfields by accident.  (It
fails miserably for me.)

Change-Id: Id308a17469babae195fa8261d937036b0cc39ff0
2018-11-14 09:51:44 +01:00
Noel Grandin
e329049900 loplugin singlevalfields improvement
checking for casting to void* turns out to mask useful stuff, so
remove that and just deal with a few extra false+

Change-Id: Id9700d7ceda90ba8fdb38aa870f13a7ca3acb668
Reviewed-on: https://gerrit.libreoffice.org/63145
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-13 12:27:08 +01:00
Stephan Bergmann
3d885f2026 Adapt to new ConstantExpr in Clang trunk towards Clang 8
After <https://reviews.llvm.org/D53921> "Compound literals, enums, et al require
const expr" (making use of ConstantExpr recently introduced with
<https://reviews.llvm.org/D53475> "Create ConstantExpr class",
CompilerTest_compilerplugins_clang started to fail with

> [CPT] compilerplugins/clang/test/unnecessaryparen.cxx
> error: 'error' diagnostics expected but not seen:
>   File /data/sbergman/lo-clang2/core/compilerplugins/clang/test/unnecessaryparen.cxx Line 35: parentheses immediately inside case statement [loplugin:unnecessaryparen]
> error: 'error' diagnostics seen but not expected:
>   File /data/sbergman/lo-clang2/core/compilerplugins/clang/test/unnecessaryparen.cxx Line 35: unnecessary parentheses around identifier [loplugin:unnecessaryparen]
> 2 errors generated.

Change-Id: Iebcfcd9af30e26df02819fbffb105599fa6a1701
Reviewed-on: https://gerrit.libreoffice.org/63285
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-12 14:19:29 +01:00
Noel Grandin
0b11ce9dd2 loplugin:useuniqueptr extend to checking more local var deletes
Change-Id: I5da0f6ecd2577e92e679ed26dd42629dbac4afd4
Reviewed-on: https://gerrit.libreoffice.org/63132
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09 06:43:34 +01:00
Noel Grandin
1cfa1d9e10 loplugin:unusedfields
Change-Id: Id16846c19c57ec437a64146d0fa771c1bfc05135
Reviewed-on: https://gerrit.libreoffice.org/63028
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08 07:38:35 +01:00
Noel Grandin
8355de8778 loplugin:unusedmethods
Change-Id: Id5cddc6d85e227f18d10d7af6a8d4b25c40ab9f3
Reviewed-on: https://gerrit.libreoffice.org/63026
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08 07:38:13 +01:00
Noel Grandin
906f8e8937 loplugin:constantparam
Change-Id: I593ccc2fb43321caf3ff64d0c348b1bac742ad18
Reviewed-on: https://gerrit.libreoffice.org/63025
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08 07:37:53 +01:00
Noel Grandin
13c247b7fe new loplugin readability-redundant-pp
code originally from vmiklos, copied from dev-tools repo

Change-Id: Iadc2388fec888dde38cb4d59c78691dc1ea94c09
Reviewed-on: https://gerrit.libreoffice.org/62983
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-07 10:49:22 +01:00
Noel Grandin
347f347580 new loplugin collapseif
Look for nested if statements with relatively small conditions, where
they can be collapsed into one if statement.

Change-Id: I7d5d4e418d0ce928991a3308fc88969c00c0d0f2
Reviewed-on: https://gerrit.libreoffice.org/62898
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-06 07:45:44 +01:00
Noel Grandin
646a6307b9 loplugin:unusedmethods
Change-Id: I66ef078794ed1eb44dbfa854c589545e5f9ba78e
Reviewed-on: https://gerrit.libreoffice.org/62407
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-27 20:10:03 +02:00
Noel Grandin
c0cc59adca loplugin:singlevalfields improvement
look for any kind of types, not just POD types, helps to find
smart pointer fields that are only assigned nullptr

Change-Id: I2d887e98db012f03b646e1023985bcc196285abc
Reviewed-on: https://gerrit.libreoffice.org/62382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-26 11:20:07 +02:00
Noel Grandin
4bf2052e9d loplugin:unusedfields
Change-Id: I36d3e874aac2d57d4e6f24a0e89c9836704bb7a6
Reviewed-on: https://gerrit.libreoffice.org/62383
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-26 10:34:38 +02:00
Noel Grandin
87e7b4bf4b loplugin:useuniqueptr more exclusions
Change-Id: I70c6d4af999965497e23ec8180eb08aa6dc648c5
Reviewed-on: https://gerrit.libreoffice.org/62221
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-23 13:18:28 +02:00
Noel Grandin
63476c346b loplugin:staticvar ignore rtfkeywd.cxx for now
Change-Id: I2bd26bcad94aa905f0c87d92b43561855409e330
2018-10-22 15:36:05 +02:00
Stephan Bergmann
3929eab0c0 Disable loplugin:staticvar for now
produces false positive

> [CXX] svtools/source/svrtf/rtfkeywd.cxx
> /home/sbergman/lo/core/svtools/source/svrtf/rtfkeywd.cxx:38:23: error: var should be const, or whitelisted [loplugin:staticvar]
> static RTF_TokenEntry aRTFTokenTab[] = {
> ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

Change-Id: I7cd96988218d1192ced2fadff911c7ec89088012
2018-10-22 15:16:38 +02:00
Noel Grandin
f29389f1b1 loplugin:staticvar ignore this case for now
Change-Id: Ic0e5e113ff16dbb3fb246c52f5a2fee8d9f52304
2018-10-22 13:24:09 +02:00
Noel Grandin
fd56d5fd40 loplugin:unusedfields improvemements
treat fields touched in operator== as not being important, which
finds some more stuff (but also adds some false+)

Change-Id: I3f5d504d7dec7945a917afbcd58c92df74f03645
Reviewed-on: https://gerrit.libreoffice.org/62020
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22 12:47:48 +02:00
Noel Grandin
76dd28afc9 loplugin:staticvar in various
looks for variables that can be declared const and static i.e. they can
be stored in the read-only linker segment and shared between different
processes

Change-Id: I8ddc6e5fa0f6b10d80c75d5952df8ddd311cf892
Reviewed-on: https://gerrit.libreoffice.org/61591
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22 12:47:37 +02:00
Noel Grandin
b979e7181f loplugin:singlevalfields look for fields that can be bool
Change-Id: Ief773b661a8378a10db56943b32127c7a2c86d11
Reviewed-on: https://gerrit.libreoffice.org/62037
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22 07:55:46 +02:00
Noel Grandin
6ee4375763 new loplugin staticvar
looks for variables that can be declared const and static i.e. they can
be stored in the read-only linker segment and shared between different
processes

Change-Id: I577fb2070604003e56fb44f8a02c9684070311cf
Reviewed-on: https://gerrit.libreoffice.org/61817
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17 08:25:17 +02:00
Noel Grandin
16690220ed loplugin:singlevalfields
tighten up the handling of binary operators

Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee
Reviewed-on: https://gerrit.libreoffice.org/61777
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17 08:25:06 +02:00
Noel Grandin
eaf0c263eb loplugin:staticconstfield improvements
And fix
  ScXMLCachedRowAttrAccess::Cache
which was never setting its mnTab field, and hence would never
be hit.

And fix oox::xls::CellBlockBuffer, which was never setting mnCurrRow.

Change-Id: I2c46aa050b9ebe3c2dc2e52579555f97945dd61c
Reviewed-on: https://gerrit.libreoffice.org/61772
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15 19:22:21 +02:00
Tamás Zolnai
f4e4231286 Relicense LoopVarTooSmall plugin to use LLVM license
Change-Id: I9e8cf6d7c2474f8c4c624dd9040890997c43f788
Reviewed-on: https://gerrit.libreoffice.org/61789
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-10-15 16:07:13 +02:00
Noel Grandin
ca014eca8a loplugin:constantparam
Change-Id: I895ceffa468d84d22e4a81b7a6b06eaed0bd839d
Reviewed-on: https://gerrit.libreoffice.org/61776
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15 13:09:09 +02:00
Noel Grandin
afed3d177b loplugin:unusedfields
Change-Id: I4ebd1e89daf7ba5e6ab709f56c0fec5b49f50dd0
Reviewed-on: https://gerrit.libreoffice.org/61774
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15 12:53:27 +02:00
Noel Grandin
bb234655bf loplugin:unusedmethods
Change-Id: I0226d33cbe224519cf2ed9ea5143ffe68fdbc884
Reviewed-on: https://gerrit.libreoffice.org/61775
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15 12:53:17 +02:00
Noel Grandin
a84e3df74e loplugin:constfields in oox
Change-Id: I1e110d193ebfa30ab1ab0d85bfb6dc409e341439
Reviewed-on: https://gerrit.libreoffice.org/61728
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15 07:56:21 +02:00
Noel Grandin
d4d37662b0 loplugin:constfields in reportdesign,sal,sax
and improve the rewriter so I spend less time fixing formatting

Change-Id: Ic2a6e5e31a5a202d2d02a47d77c484a57a5ec514
Reviewed-on: https://gerrit.libreoffice.org/61676
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12 12:46:45 +02:00
Stephan Bergmann
0bf6185516 Fix failure of loplugin:useuniqueptr with older compilers
...where CompilerTest_compilerplugins_clang failed in
compilerplugins/clang/test/useuniqueptr.cxx due to Foo24's

  HTMLAttrs::const_iterator it = m_aSetAttrTab.begin();

and either the old compiler lacked Clang's recent
<https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above
initialization expression happens to include a CXXBindTemporaryExpr, at least
with libstdc++), or an even older compiler was used in pre-C++17 mode, so the
above initialization expression happens to include an elidable CXXConstructExpr
copy constructor call.

Change-Id: I757a9ad76829e399b4fe2da1c82863909b8c9657
Reviewed-on: https://gerrit.libreoffice.org/61531
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-10 13:46:22 +02:00
Stephan Bergmann
7ceee0f1ec Extend loplugin:redundantinline to catch inline functions w/o external linkage
...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-09 14:47:17 +02:00
Noel Grandin
664db0d945 loplugin:unusedmethods
Change-Id: Icd7a0f9909f36363b307b4fe7ee920183881afbb
Reviewed-on: https://gerrit.libreoffice.org/61576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09 14:16:36 +02:00
Noel Grandin
ef0c0dfd77 loplugin:unusedfields
Change-Id: Iacce8e12a85f857192dc0520b795e1990a3612db
Reviewed-on: https://gerrit.libreoffice.org/61575
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09 12:30:36 +02:00
Stephan Bergmann
5688cd1d9a Fix loplugin:useuniqueptr for libc++ (macOS)
...after 05a337e297eb0cfe88c99503d760bd9eaf495b7d "loplugin:useuniqueptr look
for deleting in loops with iterators", where it didn't emit the warning for
Foo24 in compilerplugins/clang/test/useuniqueptr.cxx during
CompilerTest_compilerplugins_clang, because in the initialization of

  HTMLAttrs::const_iterator it = m_aSetAttrTab.begin();

the HTMLAttrs::const_iterator CXXConstructExpr happens to have a second,
defaulted argument.

Change-Id: I882a6dfb5cab1b147f790072f2545b13172c0f9a
Reviewed-on: https://gerrit.libreoffice.org/61530
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08 16:58:44 +02:00
Miklos Vajna
e056e30f82 compilerplugins: the useuniqueptr clang plugin test fails on 5.0.1
I'm not sure what is the first version that passes it, let's go with 6.0
for now.

Change-Id: I7a150fbc2a722a6a47d91de4b00893303add5cc8
2018-10-08 12:31:17 +02:00
Andrea Gelmini
54d82085cc Fix typo
Change-Id: I822fa325d37955583a21e4d7ce2e79a4d5b02fc5
Reviewed-on: https://gerrit.libreoffice.org/61462
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-06 12:15:01 +02:00
Noel Grandin
05a337e297 loplugin:useuniqueptr look for deleting in loops with iterators
Change-Id: I0e5bf671ee11265c0afa8770430ec9e064e05fe3
Reviewed-on: https://gerrit.libreoffice.org/61402
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-05 16:18:57 +02:00
Noel Grandin
6f28db10d7 loplugin:unusedmethods
Change-Id: I9e583df920657ab401162db79decb192c4f69f90
Reviewed-on: https://gerrit.libreoffice.org/61283
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03 12:09:21 +02:00
Noel Grandin
4969f4c0d3 loplugin:constfields in sw
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f
Reviewed-on: https://gerrit.libreoffice.org/61177
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03 11:56:43 +02:00
Noel Grandin
487fc22690 loplugin:unusedfields
Change-Id: I3d2cdd80b542dbdbd29971ef837111191809f081
Reviewed-on: https://gerrit.libreoffice.org/61282
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03 11:03:31 +02:00
Noel Grandin
dbeb289888 loplugin:unusedmethods
Change-Id: I7db0c27ff2213210ed4b46ebbadc1a2f74a18257
Reviewed-on: https://gerrit.libreoffice.org/61249
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03 08:28:10 +02:00
Noel Grandin
be98dffedd loplugin:unusedfields
Change-Id: Idf6f7f2946eecada64d2a586194533840ec8cc63
Reviewed-on: https://gerrit.libreoffice.org/61248
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03 08:26:20 +02:00
Stephan Bergmann
b0eab4b2d2 Add loplugin:includeform documentation
Change-Id: I5a8c6ab0a967d9da2e1764301cd54f87f467a653
Reviewed-on: https://gerrit.libreoffice.org/61176
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-01 16:15:11 +02:00
Jan-Marek Glogowski
1f2f53501c implicitboolconversion: ignore quint64 bitfield
Change-Id: I97380455b9f526b75c7d3855d188d2f659035ba2
Reviewed-on: https://gerrit.libreoffice.org/61170
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-01 10:57:27 +02:00
Noel Grandin
2fbb97367a loplugin:unusedmethods
Change-Id: I5f9ef043d76c55f2c761fd08a2bc1dae66b675c8
Reviewed-on: https://gerrit.libreoffice.org/61073
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-28 13:31:49 +02:00
Andrea Gelmini
a8cd67e269 Fix typo
Change-Id: I3473cb5a565aba822428178030572325425c6a13
Reviewed-on: https://gerrit.libreoffice.org/61030
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-09-28 09:26:22 +02:00
Noel Grandin
a6c7c2fe1b loplugin:unusedfields
Change-Id: I355fad84ed8765e8eb3fadb7c239b3b902ec1747
Reviewed-on: https://gerrit.libreoffice.org/61059
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-28 09:06:48 +02:00