Commit Graph

111 Commits

Author SHA1 Message Date
Noel Grandin
76badcaf7a loplugin:constparams in extensions,scripting,sdext
Change-Id: I3d47e144db17358bf6e2e5e3f4ad29de888c01b1
Reviewed-on: https://gerrit.libreoffice.org/40583
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 13:05:06 +02:00
Noel Grandin
c9253818ec loplugin:oncevar
extend oncevar to any POD type

Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 08:25:07 +02:00
Noel Grandin
f9b104abc1 simplify some OUString::concat usage
Change-Id: Ifa150dc9d694981ffe03c254ea8c3fd820c99795
Reviewed-on: https://gerrit.libreoffice.org/39812
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-11 21:42:16 +02:00
Noel Grandin
4b2262ab5b new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec
Reviewed-on: https://gerrit.libreoffice.org/39549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05 11:08:48 +02:00
Stephan Bergmann
f6abc3f97e loplugin:casttovoid: scripting
Change-Id: I9f77eca5a80ad4e9d3cee8f7400a245f5fa78bbb
2017-07-02 22:30:49 +02:00
Noel Grandin
2fb2d6efdb loplugin:oncevar in scaddins..sot
Change-Id: I657a131374b9f1153135e00ed429889518b91427
Reviewed-on: https://gerrit.libreoffice.org/39258
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 14:00:59 +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
Noel Grandin
8c8f2a5285 remove unnecessary explicit linefeeds from end of SAL and OSL log calls
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf
Reviewed-on: https://gerrit.libreoffice.org/36727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21 09:15:11 +02:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01: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
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Noel Grandin
bfde4866e0 convert DecodeMechanism to scoped enum
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05 12:49:02 +02:00
Noel Grandin
803215142e convert INetURLObject::EncodeMechanism to scoped enum
Change-Id: I50ea17c7779c7b5cacddf548f1773fd7d6c8bade
2016-12-05 12:49:02 +02:00
Noel Grandin
3941482735 loplugin:oncevar in sal..scripting
Change-Id: Id9ab12f3a61eb83a2288b2fd4d99ab77f5833e1b
Reviewed-on: https://gerrit.libreoffice.org/30461
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-01 12:34:51 +00:00
Stephan Bergmann
623c2f723b loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I678e89d9ff562446e7bbe8542a616c1b083dfcd1
2016-07-07 18:59:55 +02:00
Stephan Bergmann
4b9573ba66 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Ic3e7658ccfd23fa29af46eac971deac5a0373377
2016-04-20 17:25:49 +02:00
Noel Grandin
62633dfe02 clang-tidy performance-unnecessary-value-param in various
Change-Id: I7168d44dab8e6a8e37bb7920d744ff32f5e52907
Reviewed-on: https://gerrit.libreoffice.org/24019
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-14 11:37:19 +00:00
Noel Grandin
b8eb294651 loplugin:passstuffbyref in various
Change-Id: I80070c83204e531c2f599f8a56193d6ffe0e5022
2016-04-14 10:24:47 +02:00
Noel Grandin
8ca50d20c1 loplugin:constantparam in tools
Change-Id: I3774661799c074561c694515baba42a375d0a077
Reviewed-on: https://gerrit.libreoffice.org/23301
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-17 06:09:42 +00:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Noel Grandin
752cd07d08 InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25 08:52:03 +02:00
Noel Grandin
fe0e43a376 loplugin:unusedmethods unused return value in scripting
Change-Id: I9b203e255eddce59c37df1a94884e459df034459
2016-01-14 11:45:21 +02:00
Caolán McNamara
bea8a7ad63 cppcheck: noExplicitConstructor
Change-Id: Ib43e53d5b6c9c130adb765ac9b769f58060ac640
2015-12-29 19:46:23 +00:00
Noel Grandin
8ac44ca189 loplugin:unusedfields in scripting
Change-Id: Ida8fb31bd85f4807d74daab3d022d8e6340a774d
2015-12-22 09:53:26 +02:00
Noel Grandin
a508f639a0 mark UNO structs as SAL_WARN_UNUSED, where possible
Change-Id: Ie3de518f60c9f1313c68df54dbdc1fb2804f1f0d
2015-11-26 13:26:25 +02:00
Noel Grandin
8e234c5b7d use initialiser syntax for Sequence<OUString>
replaced using the script:

git grep -lP 'Sequence.*OUString.*\(1\)'
  | xargs perl -0777 -pi
    -e "s/Sequence< OUString > (\w+)\(1\);
.*\[0\] = (\S+);/Sequence< OUString > \1 { \2 };/g"

Change-Id: I23688a91562051a8eed11fc2a85599545c285c34
Reviewed-on: https://gerrit.libreoffice.org/19967
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 10:13:08 +00:00
Stephan Bergmann
65464ed098 loplugin:nullptr (automatic rewrite)
Change-Id: I9b7d8de65780325175d24965057596b88d3c0f05
2015-11-10 10:31:37 +01:00
Stephan Bergmann
801b914324 loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: If0f1446a25f423b8cbfe6346f7a691f4f2618ad0
2015-11-06 09:36:56 +01:00
Noel Grandin
0eb9f56db5 use uno::Reference::set method instead of assignment
Change-Id: I2b592fd3327f4bbe4685e84711dc9d6f19222a97
2015-11-05 07:41:29 +02:00
Noel Grandin
d95a27f944 com::sun::star->css in scaddins,sccomp,scripting
Change-Id: Id9167341940bac65f055e1e33ff0670f6fa0f6c4
Reviewed-on: https://gerrit.libreoffice.org/19629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-28 06:31:27 +00:00
Caolán McNamara
7462cfde6d coverity#1308579 Uncaught exception
Change-Id: I6bd1f9cdf69865972de9c22106a95e1ebf9a74f7
2015-06-29 09:43:34 +01:00
Caolán McNamara
9202cab167 coverity#1308598 Uncaught exception
Change-Id: Id65e076641506e128c27cec4f50bc677e808fa95
2015-06-29 09:43:31 +01:00
Caolán McNamara
6f823d85f7 coverity#1308548 Uncaught exception
Change-Id: I62d538799a814346df4de00dc232a04376e77ad7
2015-06-28 20:52:35 +01:00
Caolán McNamara
a4fdbaf546 coverity#1308512 Uncaught exception
Change-Id: Iacdf2e25fb041ec7e2bae8a505604ef538ee9dac
2015-06-28 17:55:48 +01:00
Noel Grandin
4ea281a3cc cppcheck:redundantAssignment
Change-Id: I1167d0ce6b6f6e48309d0551c1d2a283d79546a7
2015-06-15 13:34:14 +02:00
Stephan Bergmann
4446cdf20b loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I14d1c6f703c83bc4a0259ce68e93a315bbfdde4e
2015-06-08 16:27:44 +02:00
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
Stephan Bergmann
3099c70b11 Fix various XServiceInfo implementations
...to match what is recorded in the .component files

Change-Id: Ie548cd37872d3b8540222201afaac73040e65c8f
2015-03-17 12:25:11 +01:00
Julien Nabet
7da92fdcb0 cppcheck: Possible inefficient checking for <var> emptiness
Change-Id: I6ca0e477a4429e762c48c721951b9876db3a5c6c
2015-01-04 19:11:13 +01:00
Michael Weghorn
17fc7aa3b8 fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.

Change-Id: I390607e002e93cf7a6babc26d9be084d9f185058
2014-12-21 20:18:17 +01:00
Noel Grandin
705c48d32e fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.

Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-11-05 08:44:19 +02:00
Norbert Thiebaud
39c8834d21 coverity#1209004 Unchecked return value
Change-Id: I8749a5d6f176406e181312d94a1e643974d87617
2014-10-05 13:26:10 -05:00
Caolán McNamara
d375986dae coverity#707084 Uncaught exception
Change-Id: I89459f7a77fcb5785cfb2e8288326fce65202d9c
2014-09-02 15:36:28 +01:00
Stephan Bergmann
70946992d4 Fix some *_component_getFactory function types
Change-Id: I912f9d1454c049419e9ead6f0ff8d7fa7d8cd6c5
2014-08-28 16:11:33 +02:00
Noel Grandin
533c6cb6ba fixes for up-casting to Reference<XInterface>
Fix regressions introduced with
6a043e9c0a "Use the new type-checking
Reference constructor to reduce code noise"

Change-Id: I85662856f21c810a7db497fe3b0e116f075b1687
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-06-25 17:10:43 +02:00
Julien Nabet
d59da701c6 Related fdo#58774 Alternative dialog Find & Replace for Writer
After having installed the extension from http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer/releases/1.4
I had a crash, extract of bt:
5  0x00002aaad3ee13df in rtl::OUString::copy (this=0x7fffffff2510, beginIndex=147, count=-15) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:1481
6  0x00002aaad3edc10e in stringresource::StringResourcePersistenceImpl::implScanLocaleNames (this=0x8e2bba0, aContentSeq=uno::Sequence of length 24 = {...})
    at /home/julien/compile-libreoffice/libreoffice/scripting/source/stringresource/stringresource.cxx:1728

So add a quick check to be sure iDot > iSlash

Change-Id: I944a852d6cc9a35c451985ac96032f0d848136e8
2014-06-21 22:33:17 +02:00
Noel Grandin
db246b491c scripting: remove SAL_THROW macro
Change-Id: I535a57d043ac51926ae6f640d721d0dd1571c3fa
2014-06-05 08:17:52 +02:00
Noel Grandin
e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Noel Grandin
b2096deaff various loplugin:passsequencebyref
Change-Id: Id1045a7f66b4fa10b6491587ba07246a31ceba72
2014-05-14 16:54:27 +02:00
Noel Grandin
2ff8ae7c9e scripting: sal_Bool->bool
Change-Id: I1550c49cce2ad64f9d62b06ec20512a750f83b84
2014-04-24 10:53:16 +02:00