34 Commits

Author SHA1 Message Date
Noel Grandin
a369e6bbd5 loplugin:useuniqueptr look for DELETEZ expressions
can't believe I've been missing these

Change-Id: If39827e1583cbcedfd5061a5059d6df53be0f9c8
Reviewed-on: https://gerrit.libreoffice.org/53598
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-29 17:03:18 +02:00
Noel Grandin
7e937a1384 loplugin:useuniqueptr in Inflater,Deflater
Change-Id: I55833664a6e76d781908b8f1f721dd9a4946e35f
Reviewed-on: https://gerrit.libreoffice.org/53224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-23 08:14:07 +02:00
Noel Grandin
d911b3d37d loplugin:useuniqueptr in OStorePageBIOS
update the plugin to check all methods for deleting fields.

Also remove the dead checks for new failing here, can never have worked,
because it is not calling the std::nothrow variant.

Change-Id: I139410e42f83ae2db0cd38ceee81c8b4c310268c
Reviewed-on: https://gerrit.libreoffice.org/52881
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16 08:21:36 +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
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
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
23e9b12944 loplugin:useuniqueptr in i18npool
Change-Id: Iff39b9298bfad474c5c011b6355b8ebf5be06318
Reviewed-on: https://gerrit.libreoffice.org/49091
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02 11:12:15 +01:00
Noel Grandin
1d98683296 teach useuniqueptr loplugin about while loops
and reduce code duplication

Change-Id: I292d7515b15fce4cf1714c3b11b947493706bc3c
Reviewed-on: https://gerrit.libreoffice.org/49090
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02 07:38:57 +01:00
Noel Grandin
084571ee6c loplugin:useuniqueptr in ModelData_Impl
Change-Id: I66866ed1698fafe59ba31f99df09fb792da410e3
Reviewed-on: https://gerrit.libreoffice.org/48702
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-29 07:17:24 +01:00
Noel Grandin
a9286f445d loplugin:useuniqueptr in PPDParser
Change-Id: Iafd63c276d430ea2a08286921f593bc56587e71c
2018-01-17 10:16:35 +02:00
Noel Grandin
2e97530102 loplugin:useuniqueptr expand search for ranged-loop-delete
Change-Id: I78955f4db9b4da2858dfb25e69a5502eb0280418
2018-01-17 10:16:35 +02:00
Noel Grandin
397d5cbc3c loplugin:useuniqueptr in Cursor
Change-Id: I5de300709409311b7a1d451ee1d314596cf2e879
Reviewed-on: https://gerrit.libreoffice.org/47836
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15 07:28:35 +01:00
Noel Grandin
22bba5f377 teach useuniqueptr loplugin about "if(field != null) delete field"
Change-Id: I938deef90c8d6ceb0e72ab3f6ee2cbddc6f72b8d
Reviewed-on: https://gerrit.libreoffice.org/47730
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12 07:02:29 +01:00
Noel Grandin
e57a036939 loplugin:useuniqueptr in tools,stoc,unotools
Change-Id: Ia72b65577143623cedc7a40bc34f7fb897add097
Reviewed-on: https://gerrit.libreoffice.org/47726
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-11 12:47:37 +01:00
Noel Grandin
96d9bd2262 loplugin:useuniqueptr in l10ntools
update plugin to find all places where we are unconditionally deleting
stuff in a destructor

Change-Id: Ia0fedc2420c7717ed2bdd8d3bb00262d2a63e0bc
Reviewed-on: https://gerrit.libreoffice.org/47724
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-11 07:36:26 +01:00
Noel Grandin
21e85d591f re-enable loplugin:useuniqueptr
Change-Id: Ic1a7e5bd3a8002ac996a6af1d1d9a439d4153b0b
Reviewed-on: https://gerrit.libreoffice.org/44864
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-20 08:03:42 +01:00
Stephan Bergmann
b35bb38f18 Clean away temporarily added using declarations
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-11-07 11:50:47 +01:00
Stephan Bergmann
b4c9c0d137 More clang::*Type vs. llvm::*Type ambiguities
Change-Id: I21133976793ab018c633dda077029666308526db
2017-09-11 10:48:12 +02:00
Noel Grandin
80dd56035e fix ScJumpMatrixToken memory handling
ScJumpMatrixToken unconditionally deletes the ScJumpMatrix pointer it
receives. But it's copy constructor also just copies that pointer,
meaning that we could end up freeing that pointer twice.

ScJumpMatrix has no copy constructor, so I just managed it via
shared_ptr.

Change-Id: I9cf13312afb4f2869fdc878e5f34060614e31842
Reviewed-on: https://gerrit.libreoffice.org/41728
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-30 13:23:15 +02:00
Noel Grandin
c66568d6b0 loplugin:useuniqueptr, look for containers..
that can use std::unique_ptr, and apply it in i18npool

Change-Id: Ib410abaf73d5f392c7a7a9a322872b08c948f9e9
Reviewed-on: https://gerrit.libreoffice.org/41438
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-23 18:35:00 +02:00
Noel Grandin
db3860062e extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17 07:23:22 +02:00
Noel Grandin
8e39ef6692 extend loplugin useuniqueptr to POD types
Change-Id: I6ff24f048bd8f75bf87a78b718f37b57855d4781
Reviewed-on: https://gerrit.libreoffice.org/39932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-14 10:13:46 +02:00
Noel Grandin
51a50cc95a improve useuniqueptr loplugin to find arrays
Change-Id: I81e9d0cd4f430b11d20037054055683240792240
Reviewed-on: https://gerrit.libreoffice.org/39825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13 11:56:05 +02:00
Noel Grandin
d1e47b1428 enhance useuniqueptr loplugin
teach it to look for the following sequence in a destructor:
    delete m_pfoo;
    m_pfoo = nullptr;

Change-Id: Icd6271a63a024e32b53cc9e599f8f59952160380
Reviewed-on: https://gerrit.libreoffice.org/37900
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-23 09:31:20 +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
Noel Grandin
5e7583fe86 loplugin:useuniqueptr
ignore SAL_LOG type stuff in the destructor

Change-Id: If014382ca0c96edd3f2b325a28451d83b3d1f278
Reviewed-on: https://gerrit.libreoffice.org/37539
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-15 08:45:17 +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
6925007c2a Simplify jfw_findAllJREs
...dropping remaining uses of CJavaInfo

Change-Id: I76afd5af927233712181f58b14fe6f4c1a9c15c2
2017-04-13 17:32:43 +02:00
Stephan Bergmann
24ccdd63b7 loplugin:useuniquptr: Remove no longer needed blacklist entries
Change-Id: Ib372d93c5a6e7550ad0d3dc1017fe49d9059146c
2017-04-12 10:55:45 +02:00
Stephan Bergmann
fb2cd383f7 Look through ExprWithCleanups etc.
Change-Id: I5c8af20a71eca245c4b2a0061dc0612a4770c8ff
2017-04-06 15:20:15 +02:00
Noel Grandin
aa09b0c27a loplugin:useuniqueptr extend to catch more localvar cases
i.e. where the code looks like
{
    foo * p = new foo;
    ...
    delete p;
    return ...;
}

Change-Id: Id5f2e55d0363fc62c72535a23faeaaf1f0ac6aee
Reviewed-on: https://gerrit.libreoffice.org/36190
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 09:22:46 +00:00
Noel Grandin
2489000d3f loplugin:useuniqueptr extend to check local vars
just the simple and obvious case for now, of a local var being allocated
and deleted inside a single local block, and the delete happening at the
end of the block

Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625
Reviewed-on: https://gerrit.libreoffice.org/33749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:15:22 +00:00
Noel Grandin
98e4013c22 new loplugin useuniqueptr
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f
Reviewed-on: https://gerrit.libreoffice.org/33339
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-23 06:59:17 +00:00