66 Commits

Author SHA1 Message Date
Stephan Bergmann
812ee8c53f Look through derived-to-base ImpliciCast
...as happens on Windows when looking at

  maControlToPropertyMap.clear();

in PrintDialog::dispose (vcl/source/window/printdlg.cxx), where std::map's clear
happens to be declared at some base class std::_Tree.

Change-Id: I41810514bca59af8b4f2812d9412ce6a8d43576c
2017-09-28 18:31:53 +02:00
Stephan Bergmann
b4c9c0d137 More clang::*Type vs. llvm::*Type ambiguities
Change-Id: I21133976793ab018c633dda077029666308526db
2017-09-11 10:48:12 +02:00
Stephan Bergmann
faa7491131 Fix loplugin:vclwidgets' disposeOnce check
Found when trying to temporarily add a SAL_DEBUG to (otherwise empty)
~NotebookbarTabControl (sfx2/source/notebookbar/NotebookbarTabControl).
2017-06-26 16:37:20 +02:00
Jochen Nitschke
97ee2bbd40 extensions: remove COMPMOD preprocessor defines
COMPMOD_RESPREFIX=abp was unused ever since initial commit in 2001.

COMPMOD_NAMESPACE was used to set the namespace name qualifier of
the helper in componentmodule.hxx to the extension's namespace name.

I don't see why this is necessary as the helper is always compiled in
a separate extension library.

Change-Id: I287607008db3dc0ebc32731536747a921c91807d
Reviewed-on: https://gerrit.libreoffice.org/39184
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 09:05:43 +02:00
Stephan Bergmann
fee8afc229 getBody() can be null for a defaulted dtor
Not sure why that started to pop up only now, maybe something changed with
recent Clang trunk.

Change-Id: Ib6587b66afbf3e43d92c78432c0bfd61c74ba6c5
2017-06-06 09:23:17 +02:00
Stephan Bergmann
df8d092c3a Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
2017-05-18 09:56:01 +02:00
Stephan Bergmann
5a7123d686 Fix build after 7d71451e8e0226d3f3f523611f55132eda6ec10f
"vcl: change pImpl class names to fit with existing convention"

Change-Id: Ic02ca5b71a96b852951ac1b14b966b1ba2f006e9
2017-04-27 10:03:03 +02:00
Chris Sherlock
da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 09:31:31 +02:00
Stephan Bergmann
35196c3275 loplugin:vclwidgets: Adapt check for 'assert' for MSVCRT
Change-Id: I12a77b5b53e3a674c1ff1554b560a71605e141a6
2016-12-18 22:43:29 +01:00
Stephan Bergmann
c826ddfc2c Check that VclPtr is only instantiated with appropriate types
...deriving from VclReferenceBase.  Complicated by the fact that the argument
type may be incomplete at the time of template instantiation.  So this approach
may be less precise than the change to loplugin:vclwidgets from
cbf5b21f2a65bbb342295200f6ad93a00f90733e "Catch some misuses of VclPtr
construction" when the argument type becomes complete later in the comilation
unit.  However, this approach would also catch the two misuses in UnoControls
found by cbf5b21f2a65bbb342295200f6ad93a00f90733e, so go with this approach for
now and revert the change to loplugin:vclwdigets.

Change-Id: I7888f23d2b9e2db81ae2ce4bf4c8277912317685
Reviewed-on: https://gerrit.libreoffice.org/31966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-14 09:34:01 +00:00
Stephan Bergmann
cbf5b21f2a Catch some misuses of VclPtr construction
...that go unnoticed due to the non-explicit VclPtr::oeprator reference_type *

Change-Id: Ia63edf8425d3ecb7c7f98eb56a710ac0cceccb67
2016-12-09 20:00:26 +01:00
Stephan Bergmann
9e258eca6d Replace calls to get(Qualified)NameAsString with stuff from check.hxx
Change-Id: I14e48ea5c59bdd12ad6484222b3e8733664e78c4
Reviewed-on: https://gerrit.libreoffice.org/31712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-07 07:11:32 +00:00
Noel Grandin
e6ffb539ee loplugin:vclwidgets check for assigning from VclPt<T> to T*
Inspired by a recent bug report where we were assigning the result
of VclPtr<T>::Create to a raw pointer.

As a consequence, we also need to change various methods that were
returning newly created Window subclasses via raw pointer, to
instead return those via VclPtr

Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b
Reviewed-on: https://gerrit.libreoffice.org/31318
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29 06:45:42 +00:00
Noel Grandin
78b4a1fb01 update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.

Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-11 06:55:41 +00:00
Stephan Bergmann
f25a15dc99 loplugin:vclwidgets: Adapt iterator hack to libc++
Change-Id: I1e4fbb06578b2b1d6de4b57507693b014d36cd3a
2016-10-31 21:01:18 +01: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
Stephan Bergmann
744c924754 Adapt to Clang 3.4 again
Change-Id: I33c1cee01593b06efca6e1aae283ce80d5cd77be
2016-07-11 18:09:55 +02:00
Noel Grandin
716844c6ab restore loplugin:vclwidget checking for calling clear() on VclPtr fields
Change-Id: I85eda1c33016c1461d897fc0a3b70457209a7405
Reviewed-on: https://gerrit.libreoffice.org/26806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-06 06:38:30 +00:00
Stephan Bergmann
9308f35318 Adapt to Clang 3.4 (in preparation of a buildbot on CentOS 7)
Change-Id: Ie2859f03b31c57deb7fd0deba3285f782e33b239
2016-06-28 16:26:33 +02:00
Noel Grandin
27fd3c4e66 update vclwidgets loplugin to handle VclReferenceBase
Change-Id: I447cdb8c65d880b3c5ff28b35cefdc56ff784852
2016-05-18 12:26:24 +02:00
Stephan Bergmann
01f3b95884 These version checks are about the Clang the plugins are built /against/
...not the (Clang) compiler they are being built /with/.  (Also simplifies the
checking #if code.)

Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
2016-02-26 14:34:29 +01:00
Stephan Bergmann
b0e427d8aa Remove apparently unnecessary checks
...they don't cause any change in behavior, likely they predated Noel's figuring
out the template part of containsWindowSubclass

Change-Id: I0d5b6bd7f228acef9a0ce1c85fe98fbab89bd7a8
2015-12-08 09:44:34 +01:00
Stephan Bergmann
2e43a10949 No, "rtl::Reference<VclStatusListener<Button>> mpStatusListener;" is fine
...as a member of ImplCommandButtonData (vcl/source/control/button.cxx), no need
to falsly warn "OutputDevice subclass 'rtl::Reference<VclStatusListener<Button>>'
declared as a pointer member, should be wrapped in VclPtr [loplugin:vclwidgets]"

Probably loplugin:vclwidgets should enable shouldVisitTemplateInstantiations()
and not try to second-guess whether an OutputDevice can be a template argument.

Change-Id: Ia8feb1b1d7504941c35dfbf0aa02dc6a7dd818a0
2015-12-07 17:12:39 +01: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
Stephan Bergmann
b16a337231 Improve warning messages
Change-Id: I75eb9f17a3dcc688314355fa957e3f34086b161a
2015-11-05 09:30:42 +01: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
Daniel Robertson
ef779d339e tdf#94389 compilerplugins: clang 3.7.0
Fix errors that occur in build with clang 3.7.0

Change-Id: I0e8743f2b6a288d10b4e78e884ce34cfca4dd77c
Reviewed-on: https://gerrit.libreoffice.org/18738
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-09-21 13:53:47 +00:00
Noel Grandin
3d5dc80b07 fix crash in refcounting plugin
introduced by commit c15b4cf39a74176cee64795129d76f411d2c0a69
"Adapt to current Clang trunk towards 3.7"

Change-Id: I00f58d3bc79e641df9bba4e9b1d5c8463b87dc42
2015-08-04 10:25:48 +02:00
Stephan Bergmann
c15b4cf39a Adapt to current Clang trunk towards 3.7
Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
2015-08-04 09:36:32 +02:00
Noel Grandin
9db80b1499 fix vclwidget plugin warning message
Change-Id: Iac6450ed3a7742022d97b0121165f992b483eea0
2015-06-15 14:10:22 +02:00
Noel Grandin
bf34b812a7 New VclPtr clang plugin to catch potential problems.
Change-Id: I2571c4384e4c2dbe411e171325e10d57a0afe5a0
Reviewed-on: https://gerrit.libreoffice.org/16235
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-06-12 16:22:52 +00:00
Noel Grandin
245142cef1 vclwidget plugin: check for memcpy of VclPtr
Change-Id: I873d3efbb7b78d0efe5d586b378d024ee22ac77e
2015-05-19 12:15:25 +02:00
Noel Grandin
274c836cf8 check for static fields that needs to be wrapped in VclPtr
Change-Id: I6135cfd9aa70f90d58150733b6b48525e5c347c8
2015-05-13 12:21:19 +02:00
Noel Grandin
08967d36ba workaround for clang3.2 in vclwidgets clang plugin
Change-Id: I7ac67dd14d14a93fe163febe0f18df56dd613376
2015-05-07 11:18:49 +02:00
Noel Grandin
4eeaaf84d4 fix comment
Change-Id: Ifa59bdc4bfd80fe3100ba5f1ac8119ad990e3936
2015-05-07 11:18:49 +02:00
Tor Lillqvist
1275a450c1 More of the same
Change-Id: I2e735a3534a7f374a550d5072359aca70494a547
2015-05-07 11:53:05 +03:00
Tor Lillqvist
8d7791858a It's its, not it's
Change-Id: Ic108625cdc8376095dfd19184ecad39bfeccd160
2015-05-07 11:44:15 +03:00
Stephan Bergmann
d879d5346b Downgrade for old Clang
Change-Id: Ia4c241040c52631df86c5bb7a95bca6af234251f
2015-05-05 14:16:08 +02:00
Stephan Bergmann
385a248513 Do not warn about Link<Window *>
Change-Id: Id26adce17a2479eead935958556012f13f2821b7
2015-04-30 16:59:09 +02:00
Stephan Bergmann
a8174d258d streamline containsWindowSubclass
Change-Id: I56d61b577df00855a49dd618e9dafcdb86cd7ca4
2015-04-30 16:59:08 +02:00
Stephan Bergmann
cd41fa4308 Work around FieldDecl::getParent raising assertion
...when inside an ObjCInterfaceDecl, cf. thread starting at
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-April/042629.html>
"FieldDecl::getParent() not working in Objective C code?"

Change-Id: Ifa9b4925979123c6b6fee1b46a1f57803207d3c8
2015-04-28 22:40:06 +02:00
Noel Grandin
e0686cb756 workaround ErrorContextImpl in vclwidget clang plugin
Change-Id: I6c0265f33a88169708d0812639169b665a95fc1f
2015-04-17 10:25:47 +02:00
Noel Grandin
58a43332b3 wrap more stuff in VclPtr
Change-Id: I2f0d8a4fe426d8ee1ac55a05ae8dd0b44f9aab2b
2015-04-10 13:01:47 +01:00
Noel Grandin
52789497db wrap more stuff in VclPtr
Change-Id: Ia742c47399231bc5914b6586132ad3daf694fdb0
2015-04-10 13:01:47 +01:00
Noel Grandin
395ae19356 vclptr: calling disposeAndClear on all the fields is not great
sometimes we need to call clear() instead, and there is no
automatic way of figuring this out

Conflicts:
	compilerplugins/clang/vclwidgets.cxx

Change-Id: Iad96342ce3fdb3fa2f548270392aa00e19fec599
2015-04-10 13:53:01 +02:00
Noel Grandin
bf739995fc make vclwidget clang plugin find OutputDevice
fields which need to be wrapped in VclPtr

Change-Id: I6e465c66c51018b3beffadb6c99d8a08f071331e
2015-04-10 12:03:29 +01:00
Noel Grandin
0556598b35 vclwidget: check for calling delete on subclasses of vcl::Window
Change-Id: I7fb7cf919e3f46dd03a18b1cb95fa881915f9642
2015-04-10 11:59:25 +01:00
Noel Grandin
6d0c89123f vclwidget: fix more places that should be wrapping in VclPtr
Change-Id: I31c9115662da2f81e1b22be91ee58e2862076b8e
2015-04-10 11:40:50 +01:00
Noel Grandin
e35bc27fdc vclwidget: make sure we have an explicit destructor
Change-Id: I50490ad8957e8069e72e855f0f5a3b694218fd6b
2015-04-10 11:33:58 +01:00
Noel Grandin
c72fac2696 vclwidget: convert lots more sites to use VclPtr
seems there was a lot of shared_ptr usage floating around...

Change-Id: Icd05243170eb8493709275fc36bf986fc194b781
2015-04-10 11:20:46 +01:00