55 Commits

Author SHA1 Message Date
Noel Grandin
dba5dccfc5 loplugin:useuniqueptr in SwHTMLWriter
Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929
Reviewed-on: https://gerrit.libreoffice.org/57863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24 08:32:56 +02:00
Noel Grandin
a98d071d32 loplugin:useuniqueptr in HTMLTable
Change-Id: I46ece073659444e802bf480996a5797c9f1ec9e8
Reviewed-on: https://gerrit.libreoffice.org/57754
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20 15:24:27 +02:00
Noel Grandin
82a2a8f29e loplugin:useuniqueptr in XclObj
Change-Id: I2995dfe5fb39ae2e7f3c37992cb3e2147381784e
Reviewed-on: https://gerrit.libreoffice.org/57753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20 09:00:02 +02:00
Noel Grandin
8a939de0e1 loplugin:useuniqueptr in SwUndoTableMerge
Change-Id: I0c528c2b12d219f37a2c2fdf2211fce3c51ad9e4
Reviewed-on: https://gerrit.libreoffice.org/57688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19 08:13:50 +02:00
Noel Grandin
4c2d0b0d85 loplugin:useuniqueptr in ScTabView
Change-Id: Ic506f5d350abbbbb5912e3ebf753e02821c76841
Reviewed-on: https://gerrit.libreoffice.org/57523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17 14:03:19 +02:00
Noel Grandin
011c6c719f loplugin:useuniqueptr in SwHTMLWriter
Change-Id: I4802e6502addce96bff4831598e852e4fe673af4
Reviewed-on: https://gerrit.libreoffice.org/57521
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17 12:19:14 +02:00
Noel Grandin
e7a252166e loplugin:useuniqueptr in UndoTransliterate_Data
Change-Id: I1c6e865a6f59ce7f31c42d28b2b463a577b3cc28
Reviewed-on: https://gerrit.libreoffice.org/57421
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-16 08:38:38 +02:00
Noel Grandin
dbf8ad9bc3 loplugin:useuniqueptr in SbUnoStructRefObject
now that we have upgraded to VS2017, we can use std::unique_ptr in
std::map

Change-Id: Id01af07ccae7447405b8f0bc44b08043f453e54b
Reviewed-on: https://gerrit.libreoffice.org/57384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13 11:58:10 +02:00
Noel Grandin
c75f597722 loplugin:useuniqueptr in SwGrammarContact
Change-Id: I1e6a2ca8f00d6130cfa6d2c18139bf61ada10630
Reviewed-on: https://gerrit.libreoffice.org/57363
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13 08:40:54 +02:00
Michael Stahl
ff002524c1 compilerplugins: try to make these work with icecream
There are some problems here, this should fix one of them: the
getFilename function returns "<stdin>" for spelling locations, because
the input to clang is sort of preprocessed via -frewrite-includes if
icecream is used and the file is built on a remote host (whereas it's
apparently not preprocessed if the file is compiled locally by icecream).

Using getPresumedLoc() uses the #line directives in the preprocessed
input, which avoids the problem but is more expensive, so try to use it
only when necessary.

The getFileEntry(getMainFileID())->getName() pattern will also result
in "<stdin>", but fortunately icecream passes -main-file-name,
which oddly enough isn't used by the SourceManager's spelling locations,
but is available separately via CodeGenOptions.

This builds everything successfully with clang version 6.0.0:
ICECC_PREFERRED_HOST=myremote make check gb_SUPPRESS_TESTS=t

Change-Id: Ic121511683e5302d7b9d85186c8b9c4a5443fa1b
Reviewed-on: https://gerrit.libreoffice.org/54993
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-06 14:12:58 +02:00
Noel Grandin
38733c7daa loplugin:useuniqueptr in ScSimpleEditSourceHelper
Change-Id: Iebe62753d9e6f83f985e4c55fb938d5861613898
Reviewed-on: https://gerrit.libreoffice.org/56903
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-04 08:35:22 +02:00
Noel Grandin
35c165e46a loplugin:useuniqueptr in SwTextAPIObject
Change-Id: Ied235aefe2cc2ce5e88487503c17e1a54d25ac52
Reviewed-on: https://gerrit.libreoffice.org/56624
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29 08:40:31 +02:00
Noel Grandin
bf82016b20 loplugin:useuniqueptr in SwDoc
Change-Id: Ic895c7b79a25a0766cc6d352c5ed75873004fddb
Reviewed-on: https://gerrit.libreoffice.org/56496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27 08:34:48 +02:00
Noel Grandin
200ca38824 teach useuniqueptr loplugin about calling delete on a param
which is often a useful indicator that the callers can be made to use
std::unique_ptr

Change-Id: Idb1745d1f58dbcf389c9f60f1a5728d7d092ade5
Reviewed-on: https://gerrit.libreoffice.org/56238
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22 20:11:50 +02:00
Noel Grandin
f66510f1da loplugin:useuniqueptr in ODbTypeWizDialog
Change-Id: I4c364ddbad4881cc8a70a1827d7c51e7cc9313f1
Reviewed-on: https://gerrit.libreoffice.org/54850
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28 13:54:42 +02:00
Noel Grandin
0f30c9a1ef loplugin:useuniqueptr in GridWindow
Change-Id: I9fd6d8ac159994c894739afbb3dccb72576dccfb
Reviewed-on: https://gerrit.libreoffice.org/54844
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28 08:45:33 +02:00
Andrea Gelmini
2985319ebd Fix typos
Change-Id: Ibe94c7379a9389a0506c33666bf2bfb033f96f08
Reviewed-on: https://gerrit.libreoffice.org/54670
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-05-23 06:52:55 +02:00
Noel Grandin
516d593ce1 loplugin:useuniqueptr in SvxAutoCorrectLanguageLists
Change-Id: Ie433a336f9cd5133aefbe4ef88d214b5f5c63a0a
Reviewed-on: https://gerrit.libreoffice.org/54182
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-18 13:13:41 +02:00
Noel Grandin
19b4520fbf loplugin:useuniqueptr in SvxOutlinerForwarder
Change-Id: Ie861132b43b0a01ee8b4f3bc201bbf12f8af9f36
Reviewed-on: https://gerrit.libreoffice.org/54181
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-16 09:03:47 +02:00
Noel Grandin
5c3816cce5 loplugin:useuniqueptr in SfxTabDialog
Change-Id: I460bf5aac44e6fd08a5bd5ab8af217dedbcc3cf8
Reviewed-on: https://gerrit.libreoffice.org/54174
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-14 11:11:33 +02:00
Noel Grandin
ae680f7c7d make useuniqueptr loplugin check child compound statements
where the child compound statement is unconditional

Change-Id: I755e7ee9134bde81811a694d42a996d3eaae3fc2
Reviewed-on: https://gerrit.libreoffice.org/53763
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-03 08:25:43 +02:00
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