90 Commits

Author SHA1 Message Date
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
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
Stephan Bergmann
0680fc5195 New loplugin:conststringvar: helpcompiler
Change-Id: Iaf9cedae10b9bc04353d175778ff68cb38fdb409
2017-01-10 08:11:57 +01:00
Stephan Bergmann
a7d554f3b2 New loplugin:charrightshift
Change-Id: Ib645fb11004bc0fe05c9c416ae72b0ae56c23a15
2017-01-06 18:15:24 +01:00
Stephan Bergmann
d689ad29c2 New o3tl::runtimeToOUString to convert from C++ runtime NTBS to OUString
Change-Id: I613bb70b6828f615fd45af38b2d873ece55ace60
2016-11-23 23:11:02 +01:00
Noel Grandin
a7369d9899 loplugin:oncevar in helpcompiler..reportdesign
Change-Id: I2dc57931fb230953c285aeb18f57c0a41fedafcb
Reviewed-on: https://gerrit.libreoffice.org/30463
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-02 07:12:46 +00:00
Stephan Bergmann
f255c3e96e [API CHANGE] Remove HAVE_GCC_VISIBILITY_FEATURE, always true
* GCC documents -fvisibility at least as far back as the GCC 4.0 online
  documentation at
  <https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Code-Gen-Options.html>.

* For external code, odk/settings/settings.mk unconditionally set
  HAVE_GCC_VISIBILITY_FEATURE for all platforms other than Windows.

Make this a fatal configure error for now.  The check should be removed
completely after LO 5.3 branch-off.

Change-Id: I1de415b6ed1591e0a7b6640ece861b6f0ef74112
Reviewed-on: https://gerrit.libreoffice.org/29073
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-20 07:34:27 +00:00
Noel Grandin
a2b77b4368 loplugin:singlevalfields in basic..idl
Also fix obvious bug in the initialisation of the
connectivity::odbc::OConnection::m_bClosed field.
Probably closes some kind of connection leak there.

Change-Id: I04579cf91bcd6d6c51c697d83971da4142743a82
Reviewed-on: https://gerrit.libreoffice.org/28932
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-16 08:30:26 +00:00
Stephan Bergmann
2b4d13f135 Reduce scope of variable
Change-Id: Ib3669c8946b431b845bcb217e7cf4a5f7a89177f
2016-08-23 12:17:35 +02:00
Krishna Keshav
26d314d2e2 tdf#99589 tolower / toupper - dangerous to Turks ...
Used toAsciiUpperCase() from character.hxx

Change-Id: I79f4638866daf8952103c8a521db925150e8dcda
Reviewed-on: https://gerrit.libreoffice.org/24709
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-05-09 09:30:27 +00: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
Gurkaran
9e7447d39e tdf#84323: Make osl::Thread::wait more readable
It is to improve the readability of calls to osl::Thread::wait.

Change-Id: I025d89abf8e84ca73ba08f001be3f45b86c89957
Signed-off-by: Gurkaran <gurkran@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/23416
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-22 06:54:08 +00:00
Noel Grandin
f163745cca convert HighlighterLanguage to scoped enum
Change-Id: Ibf0871601e52ea4fa49e9622176431943c55abdd
2016-02-24 11:48:39 +02:00
Noel Grandin
a5e53f9ffd convert TokenTypes to scoped enum
Change-Id: I17c0a616dd6cf48a22896b6cd6b0df157d1f9a9f
2016-02-24 11:48:39 +02:00
Noel Grandin
2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +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
e5bb67f08d loplugin:unusedmethods unused return value in include/helpcompiler
Change-Id: Ieebbd896bf1ad66cd1950456ca1600f0dd8cda83
2016-01-12 11:47:52 +02:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Jan Holesovsky
d8c02ffd0f tdf#96042: Oops, fix a typo.
This fixes a regression from commit 4c4999d944bbf8a34f8a320b8de6f4a325bd5d97.

Change-Id: Ie8496392f4811cc1ff146d7a5c43988da0d539c2
2015-12-10 23:52:01 +01:00
Jan Holesovsky
4c4999d944 tdf#96042: 'std::string::find("something") == 0' means "startsWith()".
This should fix a regression from 3bdd176731c351638f541a37b94094124f3c9f52,
apparently the cppcheck's advice is misleading.

Change-Id: I427ecaa1eb3c9841cb6112997b9b51feda4583d0
2015-12-08 12:12:53 +01:00
Noel Grandin
ec3f724158 loplugin:unusedfields
Change-Id: Icac4ac1a2614e72bc9ff070819533e09eeb1a864
2015-11-30 10:34:38 +02:00
Noel Grandin
275ccca3d2 loplugin:unusedfields helpcompiler
Change-Id: I8a4feaea642cf781fde54e4afc5cd98e326f8db3
2015-11-20 15:07:05 +02:00
Noel Grandin
3bdd176731 cppcheck:stlIfStrFind
"Inefficient usage of string::find() in condition; string::compare() would be faster."

Change-Id: I90403b1d05eff6499c10be33068e5fd4fed30b62
Reviewed-on: https://gerrit.libreoffice.org/19966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 06:46:07 +00:00
Stephan Bergmann
2df257e95e loplugin:nullptr (automatic rewrite)
Change-Id: I6e34abccb0bda1c76e30ab973b8fd827d6c99c72
2015-11-10 10:31:27 +01:00
Caolán McNamara
f3c77010ce coverity#1338271 Uncaught exception
Change-Id: Ib2b7617f9862b904bd3d5939800244c541eba8a5
2015-11-06 12:16:01 +00:00
Caolán McNamara
95965034e3 coverity#1338258 Uncaught exception
Change-Id: I61032db81c012f2120bdd971111155d660eef5b4
2015-11-06 12:15:56 +00:00
Caolán McNamara
78f042b9ab coverity#1338235 Uncaught exception
Change-Id: I66bd63a75e9d75cb5d87be5e4573aec891994588
2015-11-06 09:21:59 +00:00
Andrea Gelmini
a50539e2aa Fix typos
Change-Id: Iab78219aff60a7a45a319a96f326e27a6e8e25b8
Reviewed-on: https://gerrit.libreoffice.org/18953
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Oliver Specht <oliver.specht@cib.de>
2015-09-30 12:41:09 +00:00
Caolán McNamara
f7ef1cbb83 boost->std
Change-Id: I5079e03f70370ed83a1158b2e278f48642108f08
Reviewed-on: https://gerrit.libreoffice.org/18692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-19 08:02:51 +00:00
Caolán McNamara
5c2498545d coverity#1309070 Uncaught exception
Change-Id: I33eca20633236ab98df0eabdec4e3761d544167d
2015-07-02 11:39:33 +01:00
Caolán McNamara
7ed80b1969 coverity#1308500 Uncaught exception
Change-Id: I38d6c03ee380ba6b3055e000f905a4cc568d5ab6
2015-06-28 13:23:00 +01:00
Takeshi Abe
0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
Noel Grandin
4729774b24 remove unnecessary check for null when calling delete
Idea originally from caolan.
Found using the following command:
find . -name *.cxx | xargs /opt/local/bin/grep -zlP '(?m)if\s*\(\s*\w+\s*\)\s*delete\s+\w+\;'

Change-Id: I3338f4e22193a6dfd6219c8c75835224a3392763
2015-06-15 14:46:41 +02:00
Andrea Gelmini
1f408db497 Fix typos
Change-Id: Ifaa52b49b717d893846fc1e7ae4ac50735f824ac
Reviewed-on: https://gerrit.libreoffice.org/16260
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2015-06-13 14:51:15 +00:00
Stephan Bergmann
9a1909a5d0 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: Idca144969e2b978fee8cd5b0868fcf418b193967
2015-06-08 16:25:33 +02:00
Noel Grandin
49ea2258d4 loplugin:loopvartoosmall
Change-Id: I5518e40a30bdad53470cc52b59eff04ab6d873d4
2015-05-29 08:48:41 +02:00
Noel Grandin
e0b2e6e3f7 loplugin:loopvartoosmall
Change-Id: Icbe68b31d4ab04ca3cd9f572e3598413946a75c7
2015-05-29 08:48:41 +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
Caolán McNamara
d22519f62b V801: Decreased performance
Change-Id: Id8cd45d2844c121f63684734ab3546c24a1aab32
2015-03-09 22:04:31 +00:00
Julien Nabet
f00fce5b06 Typo: containted->contained
Change-Id: I678c35ca2007169a38529b36fd31367bac4ed481
2015-02-21 14:45:36 +01:00
Julien Nabet
b98ac70724 Typo: trough->through
Change-Id: I5af784709df88492695d1ac9c9a5b020e909f362
2015-02-21 14:45:36 +01:00
Caolán McNamara
cc464d1a94 Resolves: fdo#88970 fix Incorrect Extended-tips with dodgy ahelp tags
ahelp puts the tip on the previous bookmarks with hid branches
but has a scattergun effect if those previous bookmarks have
nothing to do with the current element being described.

So take the hid attribute of the ahelp and if its hid="." use
the current set of bookmarks as the context otherwise believe
it and apply the tip just to the stated hid

Change-Id: I00648daadf5673e1abc96f222a4526959f1f7d7a
2015-02-02 15:01:43 +00:00
Andras Timar
186508874e replace '\n' to space in extended help text
Change-Id: Ida354ee41b4158716ab39a92f009fa7c9a2ce21f
Reviewed-on: https://gerrit.libreoffice.org/13919
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2015-01-22 17:24:33 +00:00
Stephan Bergmann
b7c27fef4e Some more loplugin:cstylecast: helpcompiler
Change-Id: I9e094356601cf156537f75d0629fd214710d80e8
2015-01-20 09:06:48 +01:00
Łukasz Hryniuk
9fd89a5952 fdo#39440 reduce scope of local variables
Beside scope changes, it fixes lack of initialization in a few places.

Change-Id: Ia09fdb9845d8ac17256330a5ec5168401c84f0f2
Reviewed-on: https://gerrit.libreoffice.org/13755
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-07 06:47:04 +00:00
Stephan Bergmann
9720e8e5ef Some loplugin:revisibility clean-up
Stumbled across such redundant visibility re-specifications when looking at the
odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in
cppu/source/cppu/cppu_opt.cxx and used in inline code in
include/com/sun/star/uno/Reference.hxx with only a declaration lacking
CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows.

However, this plugin is probably not worth it being run all the time, so
committing it to compilerplugins/clang/store/.

Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2015-01-05 13:10:48 +01:00
Caolán McNamara
fd1372ba8b boost::unordered_map->std::unordered_map
you can get debug stl this way

Change-Id: Ia70a3e7c7c452390e8bee34975d296c9318e4a19
2015-01-02 16:14:36 +00:00
Michael Weghorn
28d9983e2c indent try-block, remove obsolete comment
indent block one level deeper than block in
which it is contained

Change-Id: Ibefd1a87c25100001f842f42f053d9e68feba8a6
Reviewed-on: https://gerrit.libreoffice.org/13498
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-17 07:32:11 +00:00
Caolán McNamara
d03d1ad55e coverity#704150 Resource leak in object
and

coverity#704151 Resource leak in object
coverity#704152 Resource leak in object

Change-Id: I68c455adc25375b8027236fd44d99a397e372994
2014-12-15 09:33:09 +00:00