2001 Commits

Author SHA1 Message Date
Noel Grandin
58bc1cba20 convert LineType to scoped enum
and remove unused LINE_HORIZONTAL

Change-Id: I39ee05b444b4da46758ff30176e041a02bee54e8
Reviewed-on: https://gerrit.libreoffice.org/63740
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22 07:34:59 +01:00
Noel Grandin
fe39cd0df3 convert SalRGB to scoped enum
and remove unused values

Change-Id: Id10c18e832d54a6e530c3fe197b230d2d511d79c
Reviewed-on: https://gerrit.libreoffice.org/63739
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22 07:34:34 +01:00
Noel Grandin
bab2753312 loplugin:unusedenumconstants in EEControlBits
(*) remove effectivly unused enum constants

(*) tweak the plugins heuristics some more to remove false+ in this enum

(*) twweak the python post-processing step to avoid a KeyError

Change-Id: I2943ec94c00f71dcd049f5c9ef33db259c005ba3
Reviewed-on: https://gerrit.libreoffice.org/63709
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22 07:34:15 +01:00
Caolán McNamara
47897fdd93 weld SwCondCollPage
and put back original SvTreeListBox a11y factory use

Change-Id: I4ad8ce29d8fed6ec5d44e9a1d641919a89226b79
Reviewed-on: https://gerrit.libreoffice.org/63501
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-21 22:08:04 +01:00
Stephan Bergmann
7fb708ed9f Linkage::ModuleLinkage was only introduced in Clang 5
Change-Id: Ib27908cba00ca120b3bd2ea1dc291c29120a27a4
Reviewed-on: https://gerrit.libreoffice.org/63705
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-21 13:58:12 +01:00
Noel Grandin
2dbd02b576 loplugin:redundantfcast improvements
check for calls to constructors, and extend the list of types we check
for unnecessary temporary creation

Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec
Reviewed-on: https://gerrit.libreoffice.org/63472
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21 12:44:55 +01:00
Noel Grandin
0acbfd466a loplugin, remove unnecessary filtering in post-processing
removing things that point to the same source location is only really
necessary for the method-based analyses, the other's dont need it, and
it can hide stuff we are interested in

Change-Id: Ib5c3b4c2ed4011c158a199fcd08096285976b831
2018-11-21 12:14:35 +02:00
Noel Grandin
5e2322ec84 loplugin:unusedenumconstants improvements
add some unit tests, and improve the heuristics

Change-Id: I95aa97a87e178ce8d506bd245710d0ae66ad08a4
Reviewed-on: https://gerrit.libreoffice.org/63647
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-20 14:48:27 +01:00
Stephan Bergmann
b0e819bbc0 Fix loplugin:staticconstfield
...(ExprWithCleanups around the CXXConstructExpr in initializers for members of
O[U]String type, with older Clang, as used in
compilerplugins/clang/test/staticconstfield.cxx), and thus revert
e3e8d52625c2dc7a277a955d4ae2ad10c60c5f1b "Temporarily disable
compilerplugins/clang/test/staticconstfield" again.

Change-Id: Ic5fcdd1a26e4a6810369e4f9d909200d25feb12e
Reviewed-on: https://gerrit.libreoffice.org/63628
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-20 11:18:45 +01:00
Stephan Bergmann
50e644253f Take array-to-pointer decay into account in loplugin:redundantcast
Change-Id: I3c5bace180605d1a72a74feb1bf9f9b184a16d83
Reviewed-on: https://gerrit.libreoffice.org/63545
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-19 09:25:35 +01:00
Noel Grandin
67408174f8 loplugin:constantparam
Change-Id: Ifc2a8db82bd8bb508bce7f226e2cb499d1e6f6f8
Reviewed-on: https://gerrit.libreoffice.org/63492
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-19 07:43:51 +01:00
Noel Grandin
9656150f31 loplugin:singlevalfields
Change-Id: If21bdaa8431a4d40bbf70a6e9a119d77a3596012
Reviewed-on: https://gerrit.libreoffice.org/63487
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-19 07:42:14 +01:00
Noel Grandin
5197e6582e remove unused IS_TRAVELSELECT
Change-Id: I2651b28ec52a001b67cdb3b2d88e8bca0eeb7790
Reviewed-on: https://gerrit.libreoffice.org/63493
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-17 17:45:51 +01:00
Stephan Bergmann
c89a4996b8 Adapt to C++2a char_t
u8 literals incompatibly change their type (as implemented by recent Clang
trunk)

Change-Id: Ia4f7b91f5d86656a056303d2754981ab2093a739
Reviewed-on: https://gerrit.libreoffice.org/63494
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-17 17:17:26 +01:00
Caolán McNamara
1ee42f427f drop unused SvTreeListBoxFlags::IS_EXPANDING
Change-Id: I60ecf3b157cad3ebc58b6349690eccc0fedbd26a
Reviewed-on: https://gerrit.libreoffice.org/63482
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-17 13:51:07 +01:00
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
Tamás Zolnai
323bf83979 Add the already referenced LICENSE.TXT with the LLVM license
From: https://opensource.org/licenses/UoI-NCSA.php

Change-Id: I81dc98ec532e3cd6787abc491d81346fae87c087
Reviewed-on: https://gerrit.libreoffice.org/61793
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-10-15 15:56:05 +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