572 Commits

Author SHA1 Message Date
Jochen Nitschke
3f6643b927 default ctor is fine here
this was hiding a Wunused-variable warning

Change-Id: I32bd853846bc6f56c082541109eedfdab2402c3d
Reviewed-on: https://gerrit.libreoffice.org/33942
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06 04:38:01 +00:00
Julien Nabet
092adc4991 Typos
Change-Id: Ic54695e86b4b462419fa7d5ded7b1ddb19ee8ed5
Reviewed-on: https://gerrit.libreoffice.org/33904
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-03 21:55:50 +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
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
b4adb0c533 loplugin: unnecessary destructor forms..idlc
Change-Id: I765e0fa61f8134a60e5ea24452c6bbcb3fa8b054
Reviewed-on: https://gerrit.libreoffice.org/33492
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-25 05:20:06 +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
Stephan Bergmann
0e22ddad37 New loplugin:dynexcspec: Add @throws documentation, hwpfilter
Change-Id: I03131a228843e6848c0b2d2468d160ca0cdaf508
2017-01-19 18:03:19 +01:00
Noel Grandin
0bab51d8ad use rtl::Reference in HwpReader
instead of storing both a raw pointer and an uno::Reference

Change-Id: I02dd356d9693116f98ad2b96951570b3ba448b14
2017-01-18 14:22:26 +02:00
Michael Stahl
0cee740c95 replace #ifdef SOLARIS with #ifdef __sun
Check for a macro that is defined by the compiler, we don't really need
one defined by the build system.

Change-Id: Iccb8e3198396881395c97a6b81690ebe64b7e9d2
2017-01-17 16:38:33 +01:00
Noel Grandin
7a60e90ef0 new loplugin: useuniqueptr: helpcompiler..io
Change-Id: I6b394163c144e6b5540cb160abb613d56fe327de
Reviewed-on: https://gerrit.libreoffice.org/33165
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-17 08:34:42 +00:00
Noel Grandin
b936cf5838 use rtl::Reference in Formula
instead of storing both a raw pointer and a uno::Reference

Change-Id: I7f8baae687e528e89c7cdea1a92099ff4a759878
Reviewed-on: https://gerrit.libreoffice.org/33169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-17 06:42:27 +00:00
Stephan Bergmann
698bdcdb0c loplugin:externvar (clang-cl)
Change-Id: I29c40113f9248f9041dacc398416f39889f5ddf8
2017-01-11 13:42:41 +01:00
Stephan Bergmann
4f36a2fbe6 loplugin:externvar
Change-Id: Iedb9b26dbe33d447de309a763eaeeeb57d1fcdd1
2017-01-09 21:57:02 +01:00
Stephan Bergmann
e5cc002165 New loplugin:externvar: hwpfilter
Change-Id: I275d67b2878400cd0774f21b1a7489a0dd392e82
2017-01-09 15:43:18 +01:00
Noel Grandin
0a840edcc1 includes should be at the top of the file
not randomly scattered through the code

found with something like:
   git ls-files *.cpp | xargs grep -Pzl "(?s){.*#include"

Change-Id: I9c242fa4ef99e8677f2800d7ec9f16d16e488351
Reviewed-on: https://gerrit.libreoffice.org/30952
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-18 09:25:06 +00:00
Noel Grandin
7cca2c7fb3 new loplugin finalprotected
look for final classes, and make sure they don't have protected members

Change-Id: I1fa810659bba02b61a5160dbfd8e24185ec9abf4
Reviewed-on: https://gerrit.libreoffice.org/30895
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-16 09:10:16 +00:00
Noel Grandin
1ba4bb6397 loplugin:countusersofdefaultparams in editeng..rsc
Change-Id: I8a8d13faf228cbc934ae21d6763d92d370eb42ec
2016-11-11 12:12:22 +02:00
Noel Grandin
1a743fd8a2 loplugin:expandablemethods in hwpfilter..linguistic
Change-Id: I62ae20ab4a47b3b7e2b0d503cedcad3319cc9c85
Reviewed-on: https://gerrit.libreoffice.org/30683
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 08:41:38 +00:00
Noel Grandin
990102be61 loplugin:unnecessaryvirtual in hwpfilter..rsc
Change-Id: I2e9df8223d503b813b4c458747e8c44bb8ef8868
Reviewed-on: https://gerrit.libreoffice.org/30661
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 06:10:25 +00:00
Noel Grandin
877774c057 loplugin:expandablemethodds in hwpfilter..linguistic
Change-Id: If20fd4a6cf8a8e005804dbb7caf41cce73d587a5
Reviewed-on: https://gerrit.libreoffice.org/30016
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19 08:07:18 +00:00
Stephan Bergmann
a217e0d012 clang-cl loplugin: hwpfilter
Change-Id: I63677cea6ee2cec0589bd853ca9b135931df63d4
Reviewed-on: https://gerrit.libreoffice.org/29863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16 14:19:09 +00:00
Jochen Nitschke
6adebd2b2b remove define 'local'
Change-Id: I7b8ff60a25a5b835b7a2893befeb82b424bbcd2c
Reviewed-on: https://gerrit.libreoffice.org/29354
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-09-28 16:53:57 +00:00
Stephan Bergmann
b755094c83 No need for an abstaract HIODev::close
...that was only called from dtors anyway, where its virtual-ness doesn't
actually help (and would trigger loplugin:fragiledestructor if that were
enabled)

Change-Id: I477a22f2cadd1124b7106c5338e525629968a284
2016-09-16 09:13:53 +02:00
Michael Stahl
b647996a9b replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.

Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15 12:01:11 +02:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Noel Grandin
dbe0b5aa9d loplugin:countusersofdefaultparams in framework..lotuswordpro
Change-Id: I9833d85eb6543e996b0f357657c53b1c076ecde4
Reviewed-on: https://gerrit.libreoffice.org/27898
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-05 11:51:28 +00:00
Stephan Bergmann
2cdc693c56 Remove __cplusplus-checks from apparently-C++-only files
Change-Id: I87e9ce45cf945e75e8140a9d4608da8abcddada6
Reviewed-on: https://gerrit.libreoffice.org/27187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-13 14:54:14 +00:00
Stephan Bergmann
f541b99855 loplugin:nullptr: Better heuristic to determine code shared between C and C++
Change-Id: I51e1c5fa4639e51fac90f92adf3d87d12960d589
2016-07-11 14:32:07 +02:00
Stephan Bergmann
a2b2b7b07e loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: Ic7827a5bb9afe04e76336e98e66483eabcaa9dde
2016-07-07 18:59:55 +02:00
Noel Grandin
42486dde49 move #includes to top of file
instead of being randomly embedded somewhere deep inside the CXX code.

Found with:
  git grep -nP '^#include' -- *.cxx | sort -g -k 2 -t :

Change-Id: I9ee432d3b665ecb6ec600bd51cc4b735a1b1127a
Reviewed-on: https://gerrit.libreoffice.org/26764
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-29 14:49:19 +00:00
Noel Grandin
6247ff3fed loplugin:singlevalfields in hwpfilter
Change-Id: I53adaca40f0cce6c155f3e35e92809dc6b2a4ab9
2016-06-24 11:41:00 +02:00
Stephan Bergmann
1f1f26bf0f loplugin:implicitboolconversion
Change-Id: I21aeb9504be38e4a6b55892730131a878234ced3
2016-06-23 13:08:11 +02:00
Gökhan Gurbetoğlu
9b9e5cfd2f tdf#99589 - tolower / toupper - dangerous to Turks ...
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683
Reviewed-on: https://gerrit.libreoffice.org/26537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-23 09:59:49 +00:00
Gleb Mishchenko
a97b392879 tdf#94698 cleanup Makefiles. Get rid of udkapi and offapi
This patch changes occurences in makefiles
from
$(eval $(call gb_CppunitTest_use_api,comphelper_test_config, \
	udkapi \
	offapi \
))

to
$(eval $(call gb_CppunitTest_use_sdk_api,comphelper_test_config))

(corrected instead of abandon, jani)

Change-Id: Ic96ec65d82d7452e288f05a8b6d576ef543b068e
Reviewed-on: https://gerrit.libreoffice.org/23426
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-06-09 09:47:11 +00:00
Caolán McNamara
8f6ce60fdb cppcheck: noExplicitConstructor
Change-Id: I2bd2fd9c5768128130659213305b7da04686125a
Reviewed-on: https://gerrit.libreoffice.org/26000
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-07 08:16:20 +00:00
Michael Stahl
62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Noel Grandin
f3c1d240bd loplugin:constantparams
Change-Id: Ib162ba9297b9d900ea42c7e5216e152d3e58a361
Reviewed-on: https://gerrit.libreoffice.org/25769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 09:08:42 +00:00
Noel Grandin
8a2149c105 clang-tidy misc-assign-operator-signature
Change-Id: I2953a88d9e2f5923732865ef17615d5928ac5f5f
Reviewed-on: https://gerrit.libreoffice.org/25154
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-20 07:55:30 +00:00
Jochen Nitschke
32180be989 remove leftover comment
of commit 2c8fe2e737b84ecd3dbac36a4fe6bd061bbd3bae

Change-Id: Ic3847bf36666de598f79d19c1b28ff0f8a4881f0
Reviewed-on: https://gerrit.libreoffice.org/25123
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-05-19 06:08:11 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Stephan Bergmann
b994589cec Add SAL_FALLTHROUGH, where apparently appropriate
Change-Id: I41dec58c163bdd33b71b3519fa0fd6eca72faae6
2016-05-10 17:01:40 +02:00
Stephan Bergmann
b6ecea71be Add SAL_FALLTHROUGH to what looks like flex-generated code
Change-Id: Icd980dbbdc8b55d76b7f8abe4dd1a9d7e475143d
2016-05-10 16:58:44 +02:00
Stephan Bergmann
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough.  (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)

Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently.  (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.)  C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.

Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10 16:42:16 +02:00
Stephan Bergmann
0f3ac23d73 Insert explicit "break" when falling through to empty next case
...which itself only contains a "break" (or nothing at all at the end of the
"switch"), as otherwise Clang -Wimplicit-fallthrough would warn about these.

Change-Id: I25c1cf2ca74dfeba7ca0385ca8f1c1bf30bbf91b
2016-05-10 14:57:26 +02:00
Noel Grandin
91adb929d7 clang-tidy modernize-loop-convert in h-l/*
Change-Id: I843528327b25d18476f8959cabba16371213a48a
Reviewed-on: https://gerrit.libreoffice.org/24460
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-28 09:31:29 +00:00
Noel Grandin
e8fd5a07ec update loplugin stylepolice to check local pointers vars
are actually pointer vars.

Also convert from regex to normal code, so we can enable this
plugin all the time.

Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Reviewed-on: https://gerrit.libreoffice.org/24391
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26 10:55:58 +00:00
Stephan Bergmann
07b4791dc8 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Icfa6686ee96e4c9ddf23abc3ece6beae6521473a
2016-04-20 17:25:42 +02:00
Stephan Bergmann
e474c8b86a Get rid of odd _HCHAR_, _UTYPE_, _ZZRECT_ guards
Change-Id: Ic44d1c751319897c55fdd03c912cd670624f928f
2016-04-12 15:50:21 +02:00
Stephan Bergmann
6254b1f70e Get rid of _DATECODE_WEEK_DEFINES_
Change-Id: I1b50fadd64df0a18339410068696a836850e9248
2016-04-12 15:50:21 +02:00
Noel Grandin
6439005484 use SAL_N_ELEMENTS more widely
found using
   git grep -n 'sizeof.*/.*sizeof.*[0]'

Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
2016-03-31 11:30:36 +02:00