1600 Commits

Author SHA1 Message Date
Noel Grandin
e9586cf0b5 loplugin:unusedfield improvements
improve the read-only check to ignore reads from fields that are guarded
by a boolean check, something like:
   if (field)
       field.foo();
this produces some false positives at the moment because I'm not
correctly handling the else block, but also some useful new dead code.

Change-Id: Id21fa1a56c171d09d979769b978b6eef14e8b695
Reviewed-on: https://gerrit.libreoffice.org/52664
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-10 10:38:23 +02:00
Noel Grandin
c91956452b loplugin:useuniqueptr in ScXMLTableRowCellContext
Change-Id: Ie2c50b08eed674c129f0f66eae502c61e565a7f8
Reviewed-on: https://gerrit.libreoffice.org/52495
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-06 15:13:20 +02:00
Noel Grandin
1e0d5d0c98 loplugin:unusedmethods
Change-Id: If88b11419fc6d483ef689d2199a347c00622e01c
Reviewed-on: https://gerrit.libreoffice.org/52358
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-04 11:52:53 +02:00
Noel Grandin
0e493cae40 new loplugin:dbgunhandledexception
enforce that DBG_UNHANDLED_EXCEPTION is called first in a catch block,
otherwise it cannot do it's job properly

Change-Id: I906436c6861212c44f8f21552ccbceb54f15c6e1
Reviewed-on: https://gerrit.libreoffice.org/52303
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03 14:54:55 +02:00
Noel Grandin
4450b2a166 pass area param to DBG_UNHANDLED_EXCEPTION
and update sallogareas plugin to enforce this

Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a
Reviewed-on: https://gerrit.libreoffice.org/52249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03 08:38:50 +02:00
Noel Grandin
e075ee967d give DBG_UNHANDLED_EXCEPTION_WHEN an area parameter
and rename it to DBG_UNHANDLED_EXCEPTION, to make it more like
the SAL_WARN-type macros.

Use some macro magic to deal with different numbers of arguments.

Update the sallogareas plugin to check the area parameter of
DBG_UNHANDLED_EXCEPTION.

Change-Id: Ie790223244c3484f41acb3679c043fb9b438e7c4
Reviewed-on: https://gerrit.libreoffice.org/52073
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-02 08:58:08 +02:00
Noel Grandin
d9e6d51c7a loplugin:unusedfields
Change-Id: Id2dea1d3a56d5d3be03c5a2a4f2ef530a05f9b19
Reviewed-on: https://gerrit.libreoffice.org/52185
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31 20:21:42 +02:00
Noel Grandin
bbf326364c loplugin:unusedmethods
Change-Id: Idca950f341a8a0521ea2fa3d705164fcf2481027
Reviewed-on: https://gerrit.libreoffice.org/52183
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31 15:05:56 +02:00
Noel Grandin
4162339adb loplugin:unnecessaryvirtual improve result output
and merge some of the template function results

Change-Id: I9a7855ce6720d022ea5b988d68f0d59ff81ee5b9
Reviewed-on: https://gerrit.libreoffice.org/51985
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-31 15:05:40 +02:00
Noel Grandin
8e27afa534 loplugin:unnecessaryvirtual
Change-Id: Ic044a6e4568e707022d87bc5712205fbdf084ba2
Reviewed-on: https://gerrit.libreoffice.org/52067
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29 18:15:16 +02:00
Noel Grandin
73e6a7975b loplugin:unusedmethods
Change-Id: I7805ac9bc6f8c0aa5ba4804777e7d7c2c29a78f3
Reviewed-on: https://gerrit.libreoffice.org/52066
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29 14:45:43 +02:00
Noel Grandin
c6bc9f71fb disable expressionalwayszero loplugin on clang-3.8
can generate OOM

Change-Id: Ie9fbed147687c06727a702616764a18d91b38e9c
Reviewed-on: https://gerrit.libreoffice.org/52052
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-29 09:31:42 +02:00
Noel Grandin
7f7653c11b new loplugin virtualdown
Look for virtual methods where we can push their definition "down" i.e.
the base virtual method does not need to exist at all, because all the
call-sites are calling the more specific overrides.

Change-Id: Ib8e82637bfb6bc2a06df45de0e289d27344fb3ab
Reviewed-on: https://gerrit.libreoffice.org/51986
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28 13:00:53 +02:00
Noel Grandin
862dc17e43 loplugin:expressionalwayszero improvements
Change-Id: I00bdbc58d2295a0be30b47c85eae6b9abfec17b2
Reviewed-on: https://gerrit.libreoffice.org/51868
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-27 08:22:09 +02:00
Stephan Bergmann
449d416335 Let prefix arguments to hasPathnamePrefix end in slash
...for better precision

Change-Id: I5f273b7c66ba931647805c415622b5ac767ff987
2018-03-27 08:20:47 +02:00
Stephan Bergmann
cbd1f3695f Use isSamePathname instead of hasPathnamePrefix, where appropriate
Change-Id: I75f32fc66877c0fb1e71be3b5e8b6d6c1b9c4d36
2018-03-27 08:20:47 +02:00
Stephan Bergmann
23f439df05 ...in which case .. path segments need to be resolved in SearchPath, too
...for cases like

> In file included from vcl/source/outdev/hatch.cxx:32:
> vcl/source/outdev/../gdi/pdfwriter_impl.hxx:47:10: error: replace "..." include form with <...> for inclusion of a source file not next to the current source file, or a header, vcl/source/outdev/../gdi/pdffontcache.hxx [loplugin:includeform]
> #include "pdffontcache.hxx"
>          ^~~~~~~~~~~~~~~~~~

Change-Id: Ib486e0cf16a157b90f838536a15c40c2a34ef72b
2018-03-23 21:15:26 +01:00
Stephan Bergmann
8789f4f65b Check isOkToRemoveArithmeticCast in loplugin:redundantfcast too
...to avoid warnings like

> C:/lo64/core/svx/source/table/accessiblecell.cxx(400,12):  error: redundant functional cast from 'long' to 'sal_Int32' (aka 'long') [loplugin:redundantfcast]
>     return sal_Int32(0x0ffffffL);
>            ^~~~~~~~~~~~~~~~~~~~~

with clang-cl

Change-Id: I4a48a9f10ad75f76a3c6ab6152ab279df9a3fbcc
Reviewed-on: https://gerrit.libreoffice.org/51780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-23 16:11:49 +01:00
Stephan Bergmann
1ed1753be2 Handle .. path segments in loplugin:includeform again
...after 119d8137695e38c16e9fad9f3ce8a774f58e4b9a "Revert 'Allow compiler
plugins for online'", to fix cases like

> In file included from vcl/unx/gtk3_kde5/gtk3_kde5_cairo.cxx:20:
> vcl/unx/gtk3_kde5/../gtk3/cairo_gtk3_cairo.cxx:12:10: error: replace "..." include form with <...> for inclusion of a source file not next to the current source file, or a header, vcl/unx/gtk3/cairo_gtk3_cairo.hxx [loplugin:includeform]
> #include "cairo_gtk3_cairo.hxx"
>          ^~~~~~~~~~~~~~~~~~~~~~

Change-Id: I12b3049862825f10834333b154c9343a3e3bec6d
2018-03-23 15:41:26 +01:00
Stephan Bergmann
119d813769 Revert "Allow compiler plugins for online"
This reverts commit b39e627be45f847554f11fdac040b6f4da4054ba.  The assumed (see
comment at <https://gerrit.libreoffice.org/#/c/46769/4/compilerplugins/clang/
plugin.cxx@633>) performance bottleneck of isSamePathname -> getAbsolutePath
does show up in Flamegraph inspections of LO builds.  But changing (non-member
function) isSamePathname to only call getAbsolutePath if (PluginHandlder member
function) isLOOLMode is true would need some code reorg, and Online development
doesn't seem to make too much actual use of the plugin, so conclusion on IRC was
to revert.

Change-Id: I0f04fdcc87087dac516630ed5e48361f5ea332ca
Reviewed-on: https://gerrit.libreoffice.org/51774
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-23 13:02:23 +01:00
Noel Grandin
c1ee9b9f74 loplugin:unusedmethods
Change-Id: Ice171112d3e737cf0e0edabbc59a1307a4a4f5ad
Reviewed-on: https://gerrit.libreoffice.org/51282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-15 07:30:34 +01:00
Noel Grandin
1b61d0417b loplugin:unusedmethods
Change-Id: I7c780be3e2740fd9b03c39ebe16935d61caf4f7e
Reviewed-on: https://gerrit.libreoffice.org/51257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-14 13:21:49 +01:00
Noel Grandin
fb1825bf3f loplugin:unusedmethods remove unused code from canvas
which my plugin had previously been ignoring. Since that time, the
plugin has gotten a little smarter, and makes less mistakes.

Change-Id: Id791c932fd056ae7da833436c4dd2600b69a0bfa
Reviewed-on: https://gerrit.libreoffice.org/51212
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-13 19:25:02 +01:00
Noel Grandin
2f5868c430 loplugin:redundantfcast look for redundant copies in return statements
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-03-12 07:37:24 +01:00
Noel Grandin
cb34e6083c loplugin:unusedmethods
Change-Id: I027adbe65edd5f07534bb36f9f54c55f30ba516e
Reviewed-on: https://gerrit.libreoffice.org/50998
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12 07:36:37 +01:00
Caolán McNamara
cf4b65c75c weld color picker
Change-Id: I487b9a0cc13b2b60a0f1e28667773b5d3b5c66cc
Reviewed-on: https://gerrit.libreoffice.org/51001
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-11 21:34:45 +01:00
Noel Grandin
e408e1d6d1 loplugin:unusedfields
Change-Id: Idd0cdd38718c3822db4d4b94ca2315a416bc27bb
Reviewed-on: https://gerrit.libreoffice.org/50997
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-10 12:04:41 +01:00
Noel Grandin
2d40c43e86 loplugin:redundantfcast look for unnecessary temporaries
when calling methods that take a const&

Change-Id: Idf45dfd9fea0de6fae0b1f89550f2f7fc302aa15
Reviewed-on: https://gerrit.libreoffice.org/50970
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-09 07:14:51 +01:00
Noel Grandin
e151ce85d1 loplugin:constantparam ignore some SFX macro generated code
Change-Id: Ic5d9a17aeec51d59e26c49bbdf5719e6d8f6486f
2018-03-08 14:41:03 +02:00
Noel Grandin
bb7ade140d loplugin:unusedmethods
Change-Id: Id6b4edd265cb6bef31c72e2a0a440211d51c7c33
Reviewed-on: https://gerrit.libreoffice.org/50900
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08 08:44:32 +01:00
Noel Grandin
44d5188b2f loplugin:unusedfields
Change-Id: Id332557cbe7fb42d3d794612f26aa3ac161548d9
Reviewed-on: https://gerrit.libreoffice.org/50902
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08 08:13:44 +01:00
Arnaud Versini
e4b13d90bf finalclasses : correct the comments with name in downcase
Change-Id: Iad623ff608d015e95fe226babff18241488dabf0
Reviewed-on: https://gerrit.libreoffice.org/50730
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-04 18:07:00 +01:00
Noel Grandin
08ab1f46b1 loplugin:oncevar extend to tools/gen.hxx types
Change-Id: I5c75875da44334569c02e2ff039b33c38397a0a2
Reviewed-on: https://gerrit.libreoffice.org/50283
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-26 07:21:04 +01:00
Stephan Bergmann
f8d23c84fc Improve loplugin:dyncastvisibility a bit
Change-Id: Iab9d333d08a8b90a69f3a096e5f39baf3e7bb638
Reviewed-on: https://gerrit.libreoffice.org/50279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-25 14:21:47 +01:00
Noel Grandin
64ada386b9 new loplugin:doubleconvert to with ColorData work
Change-Id: Ib8f2ef485f548645c4b0e7cf080b72b28c4e278d
Reviewed-on: https://gerrit.libreoffice.org/50226
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-23 13:40:15 +01:00
Caolán McNamara
5e85f475ee drop unused button mask enum
Change-Id: Id94c6ecdfc642888eea8c13e55d38326b2d7ad12
Reviewed-on: https://gerrit.libreoffice.org/50145
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-22 09:54:57 +01:00
Noel Grandin
50d0ec571f rename redundantcopy loplugin to redundantfcast
Change-Id: I34e28a30a4f1fd264c18c901cd94094531543271
2018-02-22 08:56:29 +02:00
Noel Grandin
331b4603be loplugin:redundantcopy extend to Color
Change-Id: I224cc955d49ee100d328e0171da710f38068d2d4
Reviewed-on: https://gerrit.libreoffice.org/50114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22 07:23:57 +01:00
Stephan Bergmann
ba8a70365e New loplugin:nestedunnamed
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c
Reviewed-on: https://gerrit.libreoffice.org/50048
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-21 08:09:46 +01:00
Noel Grandin
924c0e34fd loplugin:changetoolsgen in svx
and fix the regex in the plugin for matching += operator

Change-Id: I26b3e3fac1d4ef3e756cc9431b983b5f27ee76d6
Reviewed-on: https://gerrit.libreoffice.org/50037
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21 06:04:19 +01:00
michael.weghorn
82a213880f Remove now unused libgetuid.so
Some scripts in which it was used have been removed
(commit e1082e45361a92a31adedcc3ed0a35c704bca543) and
the more reliable 'fakeroot' is now in use at all
other places where libgetuid.so was previously used
(s. tdf#115554).

Change-Id: I638e96e5c8d671e3b145b79f33de718fe34ea514
Reviewed-on: https://gerrit.libreoffice.org/49837
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-19 16:17:02 +01:00
Noel Grandin
da2f9c20f6 loplugin:changetoolsgen various improvements
- use AdjustFoo variants of methods on Rect/Size/Point
- ignore double assignments
- improve error messages
- handle expressions that include macros by using getExpansionLoc
- replace ++X() with X() + 1

Change-Id: Ida6b06b2a92e9226168aff6b1b8031f5867687b4
2018-02-16 08:28:50 +02:00
Noel Grandin
288447449d rename loplugin changerectanglegetref to changetoolsgen
Change-Id: I378f64ac0879d4c6ea574b1674e96ffb9cc89732
2018-02-12 10:29:38 +02:00
Noel Grandin
78bd5d5fb4 loplugin:changerectanglegetref also fix Point and Size
Change-Id: I373af0a62e3785c4abc2d27b0b31121c9d596ca3
2018-02-12 10:29:38 +02:00
Noel Grandin
fc80919370 fix loplugin rewriter source range checking
after
    commit 94ab8e4360a2a7a932656e99f718244321d0f923
    Date:   Fri Feb 9 15:28:41 2018 +0200
    improve loplugin rewriter double source modification detection

Change-Id: Ibf0a64fe4cc3dd6bf5ae16672b3d748a842196e4
2018-02-12 10:29:38 +02:00
Noel Grandin
94ab8e4360 improve loplugin rewriter double source modification detection
because my new rewriter easily generates overlapping rewriting.

Move the code from flatten and salcall up into the pluginhandler, and
drop the simpler detection logic.

Change-Id: I3da51ac510954a5d4276cee0924cc5dc1fc9a734
Reviewed-on: https://gerrit.libreoffice.org/49493
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-10 06:54:27 +01:00
Noel Grandin
c07b913cc6 add setter methods to tools::Rectangle
intended to replace the existing methods that return mutable ref

And add the clang rewriter I will use to do most of the work.

Change-Id: If00be13da5c16c07671cedbcfea21528bac33c8a
Reviewed-on: https://gerrit.libreoffice.org/49430
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-09 07:56:12 +01:00
Noel Grandin
5d15bb5849 remove debugging code
Change-Id: Ia5018354a764f900091cb5e03327721fa66591c9
2018-02-06 09:48:06 +02:00
Noel Grandin
987cd20a33 loplugin:useuniqueptr in ImpEditEngine
Change-Id: I5afc846c803f5191bb5e04590923059e88434b76
Reviewed-on: https://gerrit.libreoffice.org/49176
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05 07:52:50 +01:00
Noel Grandin
1b67ad6ff8 remove connectivity OSubComponent
push the logic that is still necessary down into the subclasses

Change-Id: I99424f0b3c654c5652991a4140b17ceb02224e50
Reviewed-on: https://gerrit.libreoffice.org/49087
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02 11:21:36 +01:00