789 Commits

Author SHA1 Message Date
Stephan Bergmann
b0339005b8 loplugin:sallogareas
Change-Id: I2220ab194384fb397716bf3227d38716ba54f537
2015-11-19 16:05:35 +01:00
Stephan Bergmann
526bbbbd2f isLookupContext already available in Clang 3.7.0
Change-Id: Ia17a116b1f7605b5a8d572c6a6f4ef64adea8f94
2015-11-19 10:12:17 +01:00
Stephan Bergmann
4a6268f0d3 Adapt compilerplugins to old Clang versions
Change-Id: I91335f1e81e251f0578792517dded9fae239fb61
2015-11-19 09:19:30 +01:00
Michael Stahl
526bfba0a0 vcl, sd: rename some overly generic static variables
Change-Id: I89159df36361f9ceff3401ef379c8230465617b7
2015-11-17 23:49:50 +01:00
Stephan Bergmann
6e6c095187 Fix check for std::weak_ptr (that may be in an inline namespace)
Change-Id: I048aef08df43d07544aafc69b711d258dc40bc21
2015-11-17 21:50:45 +01:00
Stephan Bergmann
27b45cc23c Work around loplguins:badstatics
Change-Id: I597dbc3e4288acb5b71f7a344ae78ba568451614
2015-11-17 21:31:46 +01:00
Stephan Bergmann
60c51ac007 Work around loplguins:badstatics
Change-Id: I9d8d0f6cc001de09d8d3f96d8ad7e243e07f426d
2015-11-17 19:38:41 +01:00
Stephan Bergmann
b0526e291d Work around loplguins:badstatics
Change-Id: I243dcb86cc1a99550b26962daf47c19eb62aa8df
2015-11-17 16:41:40 +01:00
Stephan Bergmann
b45aef86fa Improve comment
Change-Id: I25931d59fc1b4feb1fd1eaa036a64a28a269f409
2015-11-17 16:28:33 +01:00
Stephan Bergmann
097f8d6dbc Work around loplugin:badstatics
...about

  static ImplImageTree instance;

in ImplImageTree::get (vcl/source/gdi/impimagetree.cxx) due to

  StyleIconSet ImplImageTree::maIconSet;

(of type std::unordered_map<OUString, IconSet, OUStringHash>) due to

  IconCache ImplImageTree::IconSet::maIconCache;

(of type std::unordered_map<OUString, std::pair<bool, BitmapEx>, OUStringHash>),
reported at least when building against Mac libc++.  This is a false positive,
as ImplImageTree::shutDown cleans this up.

Change-Id: Idb1a99aa33f71286e57b31b7adb833e3ee8b5f5a
2015-11-17 16:21:51 +01:00
Stephan Bergmann
530bc021eb Improve loplugin:badstatics diagnostic output
Change-Id: Ia2f088a79b03ff866429e1cae73edccd36a01b4f
2015-11-17 15:05:34 +01:00
Stephan Bergmann
8312d2816a Use a DiagnosticsEngine::Note
...a Remark prints the whole stack of includes leading up to the source

Change-Id: I41e5bd2855b4a55b54e63432703f2e65b4c44249
2015-11-17 14:27:05 +01:00
Noel Grandin
d9e6270392 loplugin:unnecessaryvirtual
update the plugin with lessons learned from the mergeclasses plugin and
re-run it

Change-Id: I9d622eb3d05fceaf8fa764c533c8fa5dfb4c7711
Reviewed-on: https://gerrit.libreoffice.org/20015
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-17 12:26:32 +00:00
Michael Stahl
2ee802245e compilerplugins: enhance badstatics plugin to follow pointers
.... and references. This gives numerous false positives as pointers may
be re-set prior to shutdown, so needs a white-list.

Change-Id: I19a011c6f19501cc31b3d9ae76b599296f132478
Reviewed-on: https://gerrit.libreoffice.org/19949
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-17 09:19:24 +00:00
Samuel Mehrbrodt
40fa83871e Move CommandInfoProvider to vcl and use it from there
Change-Id: If7e3ef81cad8974bc54f359096e3ecc700fa62d6
Reviewed-on: https://gerrit.libreoffice.org/19984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-11-16 14:48:47 +00:00
Samuel Mehrbrodt
099f1016fa Cleanup: Consolidate the different ways to get command labels/tooltips
Change-Id: Ieab809a3122c9d592894b84ec2e68195a4e02dde
2015-11-16 08:08:09 +01:00
Noel Grandin
3bdd176731 cppcheck:stlIfStrFind
"Inefficient usage of string::find() in condition; string::compare() would be faster."

Change-Id: I90403b1d05eff6499c10be33068e5fd4fed30b62
Reviewed-on: https://gerrit.libreoffice.org/19966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 06:46:07 +00:00
Noel Grandin
f73284fb86 new loplugin ptrvector - find bad comparison of container<unique_ptr>
Change-Id: Idb18ae1ca2f7c644680703dc3b7dd3cd6000e040
2015-11-13 15:18:06 +02:00
Michael Stahl
5fe6606901 sc: loplugin:badstatics: remove pActiveEdWnd global variable
Just use a Link, or rather std::function to set a member in the tab
page.  Unfortunately loplugin:vclwidgets complains about the new member.

Change-Id: Ie2f9cb73c38292d02057d43b12694c6609fa0db8
2015-11-13 12:25:25 +01:00
Noel Grandin
5c142dd31d loplugin:mergeclass, fix and update results
Change-Id: I0660833db69604c5c4dd3c5826f1baac3086e052
2015-11-11 13:48:34 +02:00
Oliver Specht
fa91dd31f3 5th step to remove tools/rtti.hxx
tools/rtti.hxx removed
completed the interface of some Sdr.*  Items
and removed pseudo items

Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a
Reviewed-on: https://gerrit.libreoffice.org/19837
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-11 10:49:30 +00:00
Noel Grandin
0521461eee disable loplugin memoryvar for now
seems to be crashing with latest(trunk) clang sometimes

Change-Id: Ice92b35deb6cb4610dbd53f570d0b43e9d2a2834
2015-11-11 11:35:43 +02:00
Noel Grandin
db17d3c17c new loplugin: memoryvar
detect when we can convert a new/delete sequence on a local variable to
use std::unique_ptr

Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc
Reviewed-on: https://gerrit.libreoffice.org/19884
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-11 07:16:20 +00:00
Stephan Bergmann
986c495052 Missing isInLokIncludeFile check
Change-Id: I6577987f3f3717337e6607ffbe38397f229978f0
2015-11-10 11:26:03 +01:00
Stephan Bergmann
1cd6e2e08e Keep LibreOfficeKit.hxx compatible with C++03
Change-Id: Ic2f123c9b341dbb421b766c3bba1fc56c1bfb41d
2015-11-10 11:08:30 +01:00
Noel Grandin
6c80a8fe89 new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f
Reviewed-on: https://gerrit.libreoffice.org/19815
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-09 08:34:40 +00:00
Michael Stahl
10afa00c8c compilerplugins: enhance "badstatics" plugin to find members
Finds static variables of types that have bad non-static members.

Change-Id: I81ee940580c0f043feb543840ea4d3dd27734202
2015-11-06 20:37:38 +01:00
Michael Stahl
22fb58a6fa compilerplugins: getAsTagDecl doesn't exist in clang 3.5
Change-Id: If7277820227486e2eb578a167e0fd9f05c8f74ae
Reviewed-on: https://gerrit.libreoffice.org/19823
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-06 19:38:13 +00:00
Stephan Bergmann
938f670928 loplugin:stringconstant: elide explicit ctor usage
Change-Id: I962db9583ef9cada42a61b6a95eeea818fceeead
2015-11-06 12:33:41 +01:00
Noel Grandin
609b227873 fix tdf#95488, crash in report wizard
This reverts commit bb76b8f10697f3d5ca1f9a2f19902b043bd61cd7
"loplugin:mergeclasses"

Change-Id: Ib65459ab45cd4cefa859ed75f9ddc4f070879b1d
2015-11-05 12:02:00 +02:00
Stephan Bergmann
b16a337231 Improve warning messages
Change-Id: I75eb9f17a3dcc688314355fa957e3f34086b161a
2015-11-05 09:30:42 +01:00
Stephan Bergmann
1a6044dd8a Do not implicitly run this for now; it breaks the build
Change-Id: I84679c4ca395f934bca8f92f0587f6cf16cfa5e6
2015-11-05 08:07:48 +01:00
Bjoern Michaelsen
2e5be58e7c complete initial compiler plugin for the ServiceDocumenter
- this creates a set of static html-meta-redirect-pages linking the UNO
  implementation name to its C++ class, while doing a clang compile from
  scratch
- the output is written to $(WORKDIR)/ServiceImplementations
- still quite some corner cases missing, e.g:
  - anonymous namespaces
  - non-trivial getImplementationName() functions

Change-Id: I19a0e8a3901277dc3811eb428cac9d00737f14a9
2015-11-05 00:15:52 +01:00
Stephan Bergmann
0305078a6a skeleton implementation for ServiceDocumenter compiler plugin
Change-Id: I6a9c957c0c4dac16365d269e57c30210619d23c9
2015-11-05 00:15:48 +01:00
Noel Grandin
59b072e22b yyyyy
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-04 14:10:44 +02:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Michael Stahl
bf18f1b353 compilerplugins: add "badstatics" to detect abuse of VCL Bitmaps
VCL Image/Bitmap/BitmapEx instances must not have static life-time
because then they will be destructed after DeInitVCL() and that
likely segfaults.

Change-Id: I3ff8d32de729c971b190028094cb4efe206395e2
2015-11-02 16:39:19 +01:00
Michael Stahl
048d47d54d compilerplugins: check that we're not building ccache preprocessed
... input, which breaks because a) isInUnoIncludeFile() will not
recognize the paths (which is actually fixable if it used
getPresumedLoc() to get the path), and b) the isMacroBodyExpansion()
check in salbool.cxx (which doesn't look fixable).

So instead of printing lots of spurious warnings just abort.

Change-Id: I77fd77b4986d2b099453309ecdf31be9cf93ceec
Reviewed-on: https://gerrit.libreoffice.org/19693
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-10-30 16:31:13 +00:00
Michael Stahl
7ef698a47b compilerplugins: fix warning message copy-pasta
Change-Id: I3b845ae46b0d0b14be90382727cc02a838a0392e
2015-10-30 16:09:37 +01:00
Noel Grandin
644487a115 loplugin:unusedmethods
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861
Reviewed-on: https://gerrit.libreoffice.org/19231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-27 08:20:43 +00:00
Noel Grandin
3ce9af420a loplugin:unusedmethods
Change-Id: I73180266c0af98dbd8d29bd3b11850996b94def9
Reviewed-on: https://gerrit.libreoffice.org/19195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-10-27 02:33:18 +00:00
Serge Krot
0b018d202d tdf#39440: fix several warnings reported by cppcheck
Change-Id: I560d28b7cc67740c6479494d0e5aa62d2ac6ffae
Reviewed-on: https://gerrit.libreoffice.org/19587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-10-25 22:31:44 +00:00
Noel Grandin
382eb1a23c remove untyped Link<>
Change-Id: I809f9e10309ceadda0a82c3818277323b34ec61b
Reviewed-on: https://gerrit.libreoffice.org/19491
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-21 07:44:43 +00:00
Andrzej Hunt
7276c34667 Ignore the default constructor for loplugin:badvectorinit too
The default constructor doesn't necessarily have 0 parameters,
hence we need to explicitly test for this too.

Change-Id: I685c44ab373ec8234a86824a77cc523a355c8b05
Reviewed-on: https://gerrit.libreoffice.org/19496
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-21 06:54:08 +00:00
Stephan Bergmann
931c51f65b Make loplugin:defaultparams handle enum values and nullptrs
Change-Id: I0c57b414d9230406cf2632494ccfa576510b0e61
2015-10-20 14:39:48 +02:00
Noel Grandin
56e6f0da83 new loplugin: badvectorinit
look for places calling the 1-argument vector fill constructor and then
immediately called push_back, which is generally a sign that its
leaving empty slots.

Change-Id: I34e69b8d09cc48c0d409499faaf192b9f86bc517
Reviewed-on: https://gerrit.libreoffice.org/17525
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2015-10-20 11:35:31 +00:00
Stephan Bergmann
7ba3711606 Remove accidentally committed debug code
Change-Id: Iba6b97d1a4a0988a3b0404bd14097f92a500d8ae
2015-10-20 11:43:58 +02:00
Stephan Bergmann
415d43473e Make loplugin:defaultparams work for multiple default params per function
Change-Id: I0aa3841e1ac3375f519384f3012450bc683d1c51
2015-10-20 08:43:18 +02:00
Noel Grandin
ec20e65469 loplugin:mergeclasses, merge IControlContext with OBrowserListBox
Change-Id: Ib3e54c9fe8d9445ad799e4b06c41443093af87fb
2015-10-13 10:07:50 +02:00
Noel Grandin
38b4b7590d loplugin:mergeclasses, merge OOdbcLibWrapper with OOdbcEnumeration
Change-Id: I2e564e90c11bb46022a5e258ad013aeb2fe4ca2e
2015-10-13 10:07:50 +02:00