789 Commits

Author SHA1 Message Date
Noel Grandin
5e997f4dba disable this chunk of loplugin code on clang < 3.8
not worth the spaghetti of making it work across version

Change-Id: I0de923b16fb6d58cbad55adc9878ab39bc0c86ae
2016-11-01 12:58:17 +02:00
Stephan Bergmann
f25a15dc99 loplugin:vclwidgets: Adapt iterator hack to libc++
Change-Id: I1e4fbb06578b2b1d6de4b57507693b014d36cd3a
2016-10-31 21:01:18 +01:00
Stephan Bergmann
7441141bcf No good reason for dbaccess::OCacheSet::updateRow to be pure?
Most of its virtual member functions are (though insertRow is already a curious
exception), even though they are defined, so smells like a copy/paste error
rather than deliberate design.  And appears to have been the only reason why
loplugin:unnecessaryoverride filtered out such overriding of pure base
functions.

Change-Id: Ib2a40af9cd3cd3dbb26c4147f7d01de4e11f5f6e
2016-10-31 11:38:49 +01:00
Noel Grandin
eaf32cd43c fix unnecessaryoverride clang plugin on clang < 3.8
Change-Id: Id78d694cf7271a6abf94234958ab623cf1cd93a5
2016-10-31 11:54:06 +02:00
Noel Grandin
978c6e7a8f update vclwidgets plugin to check local variables
Change-Id: I91f7fc6b8419c0ed82194726eeb4c4657e998f22
Reviewed-on: https://gerrit.libreoffice.org/30428
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-31 09:44:46 +00:00
Khaled Hosny
0fd8ef082d Rename ServerFont to FreetypeFont
This is what it is actually is, we dropped support for server-side fonts
for a long time now. Renamed also a few related classes, but left
ServerFontLayout* ones as they will go away soonish.

Change-Id: I68a6dad51b6972368b7bf85a0b9c8089cc12740e
Reviewed-on: https://gerrit.libreoffice.org/30390
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-30 12:54:00 +00:00
Noel Grandin
8a22bc93e0 update unnecessaryoverride plugin to find pure forwarding methods
which can be replaced with using declarations.

Is there a more efficient way to code the search? Seems to slow the
build down a little.

Change-Id: I08cda21fa70dce6572e1acc71bf5e6df36bb951f
Reviewed-on: https://gerrit.libreoffice.org/30157
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-28 12:56:17 +00:00
Stephan Bergmann
97c28ad74f Various loplugin warnings in --enable-telepathy
Change-Id: I4c437491466c3029f2a9c93fb630c7b5a8d2ff21
2016-10-28 08:52:46 +02:00
Tor Lillqvist
3be8c4c2bb The badvectorinit plug-in probably can be retired
Let's hope it only catches false positives now.

noelgrandin agrees.

Change-Id: Ibd8310c31897aa6835bd6aaf90a49b5cd8f92948
2016-10-21 14:18:20 +03:00
Noel Grandin
e9ada6294d fix bug in expandablemethods plugin
where using a std::map instead of a std::set meant that it
sometimes miscounted the number of callsites

Change-Id: I1e2ebcf44fe006827e66620ae4c9bbc813835414
2016-10-20 10:49:58 +02:00
Stephan Bergmann
d6ff3d49df Plugin::isInUnoIncludeFile should not cover WORKDIR
...that got in, for no apparent reason, when various, slightly different
implementations of isInUnoIncludeFile got consolidated into one.

Change-Id: I64a9eb62703d57a0b7b57720ec9f251ffa780691
2016-10-19 10:56:35 +02:00
Noel Grandin
e7782a99a5 accidentally left the expandablemethods loplugin active
Change-Id: Ifadab184876163195ea3307ec32d2eed4ee00b92
2016-10-19 08:40:17 +02:00
Noel Grandin
98b77ad1e6 loplugin:expandablemethods in UnoControls..vbahelper
Change-Id: Iec2c5e13119d97c9ca87e083c0f7cb00227e5231
Reviewed-on: https://gerrit.libreoffice.org/29997
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19 06:24:23 +00:00
Stephan Bergmann
7eea236a24 -Werror=unused-function
Change-Id: I9e0585460d908024f75a1134bc1cd20d12ea3b4e
2016-10-18 09:12:27 +02:00
Noel Grandin
5af68a26f1 rename inlineablemethods plugin to expandablemethods
and add support for nested functions

Change-Id: I63daee5b3047fa1ed5de0e5ddaf998f8b17bc780
2016-10-18 08:51:07 +02:00
Noel Grandin
40fd53a238 loplugins: extract some common functionality
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
2016-10-18 08:51:07 +02:00
Noel Grandin
9d8d2e0787 simplify inlineablemethods loplugin
Change-Id: I72750a14664aa042da232c35cca3373ce367cfb0
2016-10-18 08:51:07 +02:00
Noel Grandin
281fa6ac6a some cleanups to the unusedmethods loplugin
- publicDefinitionSet is unnecessary, the python post-processor does not
need it
- remove the traversing of templates, clang will do that for us since we
have set the shouldVisitTemplateInstantiations() method

Change-Id: I0e96dad0b1cc941fe6c4a2e9227e86d8c3f1d85a
2016-10-18 08:51:07 +02:00
Noel Grandin
a18d92bca8 new loplugin inlineablemethods
look for methods that are:

(*) non-virtual
(*) only called once
(*) only called from inside their own class
(*) small i.e. < 40 characters

which are candidates for just having their code inlined

Change-Id: I0e9e8125d140282cdcdd2a77374059b17b2fcd7d
2016-10-18 08:51:07 +02:00
Stephan Bergmann
35d9cd4969 clang::FileEntry::getName now returns StringRef on Clang master
Change-Id: I94c9676e52a3c60ad70567396a8484e844176c6e
2016-10-16 19:43:15 +02:00
Noel Grandin
3223c551c3 loplugin:mergeclasses merge TextView with ExtTextView
Change-Id: If7e11dd8f6b2cb6dc19c6aa3f7e50e2e88861eac
Reviewed-on: https://gerrit.libreoffice.org/29828
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-14 18:34:57 +00:00
Noel Grandin
3e6c930842 loplugin:mergeclasses merge SfxWorkWindow with SfxFrameWorkWin_Impl
Change-Id: If6cab49904fdb044d85a4fd29f79faa7b52c9959
2016-10-14 12:53:01 +02:00
Noel Grandin
db0cb39225 loplugin:mergeclasses merge SwTextAttrIterator with SwLanguageIterator
Change-Id: Iaa9184f6145625c897fa5b919e9bf0c898b41102
2016-10-14 08:17:50 +02:00
Noel Grandin
94ea3a1882 loplugin:mergeclasses merge SwComboBox with CaptionComboBox
Change-Id: Ieef8f00cb1f6f8fb62ad385d1085e8a63161a710
2016-10-14 08:17:50 +02:00
Noel Grandin
0927bdaf6e loplugin:mergeclasses merge SvxListBoxControl with SvxUndoRedoControl
Change-Id: I5ba9c9d970246d80bb60e27e3b703ec03376c35c
2016-10-14 08:17:50 +02:00
Noel Grandin
6bdfb75733 loplugin:mergeclasses merge svx::ISlotInvalidator with svx::FmTextControlShell
Change-Id: I828ef52bc093d3fa2946f813a2dd09ac6b34e94c
2016-10-14 08:17:50 +02:00
Noel Grandin
2a504a24e4 loplugin:mergeclasse merge ScCbWarningBox with ScReplaceWarnBo
Change-Id: I7b55b036c1992b88b01b51053a3560e9f97986c9
2016-10-14 08:17:50 +02:00
Noel Grandin
a7e395f397 loplugin:mergeclasses ImplEESdrWriter with ImplEscherExSdr
Change-Id: Iea2241d9fc44b92e18101b3f367a643f03729183
2016-10-13 13:31:28 +02:00
Noel Grandin
62223f9a8a loplugin:unnecessaryoverride
Change-Id: I08c55a3023ec2e8990098eeb60e91cd18556e7ae
Reviewed-on: https://gerrit.libreoffice.org/29656
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-13 06:47:44 +00:00
Stephan Bergmann
da95ad47af typo
Change-Id: Iea55eee0e5e777e46bb02435f10bca03e554a15c
2016-10-12 08:49:35 +02:00
Noel Grandin
ed89525967 improve error message in refcounting plugin
Change-Id: I02b483c1d696913b33112b9248747f9c3d28dc55
2016-10-12 08:44:50 +02:00
Noel Grandin
5c84f40ea2 loplugin:constantfunction
update the plugin similarly to
    commit 3ee3b36ae0c064fb5c81268d8d63444309d1b970
    Author: Stephan Bergmann <sbergman@redhat.com>
    Date:   Fri Oct 7 12:05:49 2016 +0200
    loplugin:staticmethods: Don't be fooled by decls starting with macros

Change-Id: I98ac3216d5acf89a49a26feb089ae2fd34e6e510
Reviewed-on: https://gerrit.libreoffice.org/29665
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-11 06:15:21 +00:00
Stephan Bergmann
1dac51334b Handle loplugin:fpcomparison false positives by whitelist
Change-Id: I58e2beb0695a27922856bd8f8988d9e4508aceb6
2016-10-10 13:10:48 +02:00
Stephan Bergmann
e492d7bcd1 loplugin:fpcomparison, macOS redux
Change-Id: Ie41be540209b4af7c0571f7c16bedd0665daff10
2016-10-09 16:23:49 +02:00
Stephan Bergmann
995318e299 loplugin:badstatics: reliably look into std container types
Change-Id: Ifca7325533e3f7d5ce5c59cc6b14d4232d4fc792
Reviewed-on: https://gerrit.libreoffice.org/29614
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-09 07:40:55 +00:00
Stephan Bergmann
160478912a loplugin:badstatics
ScAddInListener has a member

  ScAddInDocs* pDocs; // documents where this is used

where ScAddInDocs is set<ScDocument*>, and ScDocument has a memmber

  VclPtr<SfxPrinter>    pPrinter;

so that's only a chain of (apparently non-owning) pointers.

Change-Id: I050218320eb2c588dcfaee80225f4e45a515ed32
Reviewed-on: https://gerrit.libreoffice.org/29613
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-09 07:40:09 +00:00
Stephan Bergmann
3ee3b36ae0 loplugin:staticmethods: Don't be fooled by decls starting with macros
...like SAL_DLLPRIVATE coming from UNO include files.

Change-Id: I9eb64c96b7e9e2a3742a166cedcf635d98fe65a0
2016-10-07 12:07:43 +02:00
Stephan Bergmann
f1cb6a031e loplugin:staticmethods: sw
Change-Id: I2b06eb926ebc8ab04883da3272ea239a12e09436
2016-10-07 12:07:43 +02:00
Stephan Bergmann
b8711a1383 loplugin:nullptr: remove duplicate warnings
Change-Id: I859d9ac8f7e4134bdac59b39e95eb563d1291e8b
2016-10-07 10:38:06 +02:00
Stephan Bergmann
e03499917e loplugin:fpcomparison: also look into member functions
By accident, the plugin had only looked into non-member functions until now.
However, for the vast majority of newly found cases, it is unclear to me whether
the relevant code needs fixing or not, so I put all those into a giant whitelist
for now.  Maybe the plugin's sginal/noise ration just isn't worth it, anyway.

Change-Id: I7997a0ebdb4211af208285611656a40ead97d935
2016-10-06 16:55:45 +02:00
Noel Grandin
c1e18e05a5 merge dbaccess::StorageInputStream with dbaccess::StorageXMLInputStream
Change-Id: I05b54b8a2fe4ff0c8b9f89e3d29e864e8665b7b8
Reviewed-on: https://gerrit.libreoffice.org/29519
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05 06:42:05 +00:00
Noel Grandin
ac9373e65e merge sd::FuOutline with sd::FuOutlineText
Change-Id: Ie8191ac91175ba51f89809aaa53bc1ffacf42df0
Reviewed-on: https://gerrit.libreoffice.org/29520
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-04 12:19:10 +00:00
Noel Grandin
bd89dff261 loplugin:mergeclasses various fixes
better tracking of templates, ignore more noise in the plugin so the
python has less log to process

Change-Id: I62874236d362529bd566140ac3fcc65e734fd62c
2016-10-04 09:30:37 +02:00
Andrea Gelmini
8f9af8dd97 Fix typos
Change-Id: Ie44267e7c9f92eb1920f05235826abff761251f1
Reviewed-on: https://gerrit.libreoffice.org/29430
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-10-03 13:43:44 +00:00
Andrea Gelmini
c0bcdde2a0 Fix typos
Change-Id: I6aeda978911b25caa45d4e459e581fc743e93d2c
Reviewed-on: https://gerrit.libreoffice.org/29442
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-01 20:10:06 +00:00
Andrea Gelmini
943919692e Fix typos
Change-Id: I8374d6d08f4eb4ae2821e213371c615b92d7e9ab
Reviewed-on: https://gerrit.libreoffice.org/29432
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-01 19:02:02 +00:00
Noel Grandin
4481158f63 unuseddefaultparams plugin has been superceded
by the countusersofdefaultparams plugin

Change-Id: I79cdc4cf884deea212ee76e1436f07696ff49f44
2016-09-30 09:41:03 +02:00
Noel Grandin
4d87443bf5 loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c
Reviewed-on: https://gerrit.libreoffice.org/29321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-30 06:57:26 +00:00
Noel Grandin
3468dab9ff clang plugins: do "dotdot" normalisation
which fixes some false positives

Change-Id: I555349180b5ca819f29695789f1545ba2177bd09
Reviewed-on: https://gerrit.libreoffice.org/29320
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-27 12:08:52 +00:00
Noel Grandin
7419057e3e loplugin:unusedmethods in chart2..svx
Change-Id: Ifb6045885049733415895f58cdd911256f48323c
Reviewed-on: https://gerrit.libreoffice.org/29187
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-22 18:57:43 +00:00