Commit Graph

866 Commits

Author SHA1 Message Date
Stephan Bergmann
87c671d188 loplugin:includeform: xmlhelp
Change-Id: I0ae8533889742d314938b497d566a4bde722057a
2017-10-23 22:45:46 +02:00
Noel Grandin
87a9979c89 overload std::hash for OUString and OString
no need to explicitly specify it anymore

Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec
Reviewed-on: https://gerrit.libreoffice.org/43567
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23 08:15:35 +02:00
Noel Grandin
2c05d758b2 add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235
Reviewed-on: https://gerrit.libreoffice.org/43046
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-04 15:18:00 +02:00
Mike Kaganski
362a21d3a1 Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params
that are also dependent on UNICODE define, like
LoadCursor( nullptr, IDC_ARROW )
where IDC_ARROW is defined in MSVC headers synchronised with
LoadCursor definition.

We should always use Unicode API for any file paths operations,
because otherwise we will get "?" for any character in path that
is not in current non-unicode codepage, which will result in failed
file operations.

Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633
Reviewed-on: https://gerrit.libreoffice.org/42935
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30 11:23:41 +02:00
Noel Grandin
1ffba0e356 loplugin:flatten check for throw in then clause
also make the plugin ignore the case where we have var decl's in the
clause we want to flatten, which could lead to problematic extension of
variable lifetime

Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59
Reviewed-on: https://gerrit.libreoffice.org/42889
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-29 08:51:48 +02:00
Mike Kaganski
afeff9102c Use even more WIN32_LEAN_AND_MEAN
Change-Id: I538fe5b41156366e0e87b3a93e58a3947afd18f5
Reviewed-on: https://gerrit.libreoffice.org/42398
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18 01:13:30 +02:00
Noel Grandin
b0de7bc428 clang-tidy modernize-use-emplace in various
Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8
Reviewed-on: https://gerrit.libreoffice.org/41750
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14 11:51:44 +02:00
Noel Grandin
7aa7f4d9e4 loplugin:unnecessaryparen include c++ casts
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb
Reviewed-on: https://gerrit.libreoffice.org/41874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-04 10:52:41 +02:00
Noel Grandin
9881bea8d4 remove unnecessary use of OUString::getStr
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4
Reviewed-on: https://gerrit.libreoffice.org/38114
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17 11:55:13 +02:00
Noel Grandin
d347c24036 convert std::map::insert to std::map::emplace
which is considerably less verbose

Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b
Reviewed-on: https://gerrit.libreoffice.org/40978
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11 12:38:32 +02:00
Noel Grandin
b1a1baa66a loplugin:constparams in formula,xmlhelp
Change-Id: I1c987d991a5b292df327d1bb921099233b5531fe
Reviewed-on: https://gerrit.libreoffice.org/40584
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 12:09:24 +02:00
Noel Grandin
f74da1315a use more comphelper::InitAnyPropertySequence
Found with:
  git grep -n -A10 'Sequence.*Any' -- *.cxx | grep -B5 -w PropertyValueProvider
and:
  git grep -n 'Sequence.*Any.*( *&'

Change-Id: Icb18c98bdd3f8352817e443ff78de5df042859ad
Reviewed-on: https://gerrit.libreoffice.org/40389
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25 12:03:17 +02:00
Noel Grandin
c932e26138 loplugin:constparams in toolkit,ucb,xmlhelp
Change-Id: I2287bf468aae5008e25aa8b1bc0b63cff7bb1bf1
Reviewed-on: https://gerrit.libreoffice.org/40117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 11:13:05 +02:00
Noel Grandin
daf177f703 use more OUString::operator== in test..xmlsecurity
Change-Id: If5bdd1532be44a47ff7cc3b769be3ea585aea562
Reviewed-on: https://gerrit.libreoffice.org/39685
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-14 12:39:20 +02:00
Noel Grandin
65e4a776e8 simplify some OUString::copy calls
Change-Id: Ifa228ca02ea79a1309e1875414028aade7e5f12d
Reviewed-on: https://gerrit.libreoffice.org/39801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-11 13:55:30 +02:00
Stephan Bergmann
18f390b7a3 loplugin:casttovoid: xmlhelp
Change-Id: Ic23705873a428215ff993caf79021cbb1029c1a5
2017-07-02 22:27:12 +02:00
Stephan Bergmann
f393b34cd0 lang_ is unused
...ever since 8b8926aeba "Initial revison"

Change-Id: Ice5655cfa8981cb6a97aeb710ab779b2be3f3c96
2017-06-30 16:38:20 +02:00
Noel Grandin
bdabb4c07d loplugin:oncevar in writerfilter..xmlhelp
Change-Id: I1319494e16586f7e0b5149faecd3d1c36e336b1b
Reviewed-on: https://gerrit.libreoffice.org/39343
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28 12:37:31 +02:00
Noel Grandin
513ac8eb79 loplugin:useuniqueptr in various
extending it to find places we can use std::unique_ptr on arrays

Change-Id: I9feb1d12d738d6931e752ecb6dd51cbc1540c81b
Reviewed-on: https://gerrit.libreoffice.org/39255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-27 08:42:36 +02:00
Noel Grandin
3f3181522b s/catched/caught
Change-Id: I7ea6977a9749e86f8058b78cdb91cd2c62da8264
Reviewed-on: https://gerrit.libreoffice.org/39164
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 08:59:38 +02:00
Julien Nabet
097de810da Typo: existance->existance
Change-Id: If6927f3b9e983d41ec957997a26d235b8be378a5
Reviewed-on: https://gerrit.libreoffice.org/38934
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-18 23:16:13 +02:00
Jochen Nitschke
a5dba7dbec remove unused osl/mutex.hxx includes
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb
Reviewed-on: https://gerrit.libreoffice.org/38905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-18 13:38:25 +02:00
Jochen Nitschke
d69795b9c9 use local statics in getTypes functions
... instead of double checked locking patterns.

Change-Id: I1b86ce723ff22dd357b3ed69a52757b085472424
Reviewed-on: https://gerrit.libreoffice.org/38906
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17 13:28:18 +02:00
Noel Grandin
83f9325f0d loplugin:unusedfields xmlhelp..xmlsecurity
Change-Id: I7e680e1913c787ce0adad5be1f84668d57ad00b3
Reviewed-on: https://gerrit.libreoffice.org/38821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16 08:24:49 +02:00
Jochen Nitschke
febbad7263 cleanup unused css/frame/* includes
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65
Reviewed-on: https://gerrit.libreoffice.org/38633
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12 13:05:38 +02:00
Noel Grandin
88ff39aee5 use OStringBuffer instead of manual buffer management
Change-Id: Iba155637cbbdfc5d6b3a427372695d4d03319621
Reviewed-on: https://gerrit.libreoffice.org/38297
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-01 12:56:05 +02:00
Noel Grandin
2ccde70d60 teach redundantcast plugin about functional casts
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30 08:50:31 +02:00
Jochen Nitschke
a0b93fe081 cleanup unused css/script/ includes
but keep exception includes in headers for now

Change-Id: I826828675a2d14b906e57068cbced2e790e12bce
Reviewed-on: https://gerrit.libreoffice.org/37846
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20 10:23:38 +02:00
Noel Grandin
389da66dfc remove unused uno::Reference vars
found by temporarily marking Reference as SAL_WARN_UNUSED.

Change-Id: I18809b62654467f890016adcc92576980ced393b
Reviewed-on: https://gerrit.libreoffice.org/37511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12 09:56:01 +02:00
Jochen Nitschke
959496794c cleanup osl/diagnose.h includes
with command
> git grep -l osl/diagnose.h *.cxx |
  xargs grep -L -w 'OSL_\w*' |
  xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d'

headers need more work

Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab
Reviewed-on: https://gerrit.libreoffice.org/37350
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-09 15:41:46 +02:00
Noel Grandin
185ed3ddb8 teach loplugin:constantparam about simple constructor calls
Change-Id: I7d2a28ab5951fbdb5a427c84e9ac4c1e32ecf9f9
Reviewed-on: https://gerrit.libreoffice.org/37280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08 08:29:03 +02:00
Jochen Nitschke
5aa54f1744 break circular include
of include/vcl/window.hxx and include/vcl/vclevent.hxx

Change-Id: Iacb3cc942693a732de5899af26e08e0977a83102
Reviewed-on: https://gerrit.libreoffice.org/37338
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-05-07 14:37:42 +02:00
Chris Sherlock
97eb00c75e revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
Chris Sherlock
6fa4b7e0cc tdf#43157: convert xmlhelp codebase away from OSL_ASSERT to assert
Change-Id: I84fc0f1a39a47e357e8132b92665ea18501df92e
2017-05-07 09:26:19 +10:00
Stephan Bergmann
b2d465b2b6 loplugin:salunicodeliteral: xmlhelp
Change-Id: I126b08c3725b325fff84421b0b93e72cb3938b84
2017-04-28 18:26:53 +02:00
Noel Grandin
9348b322a5 clang-tidy readability-simplify-boolean-expr
Change-Id: Iea7ab64683f0b29794d50d774cc482b54a00e70a
Reviewed-on: https://gerrit.libreoffice.org/36450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28 11:23:34 +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
198c41c4fe new loplugin unoany
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89
Reviewed-on: https://gerrit.libreoffice.org/34714
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28 10:17:47 +00:00
Caolán McNamara
9bc5d4cdf0 re org things a little to quieten coverity warnings
Change-Id: I3bf0840f6428ee8cefd424a486cc2f5fcfda290f
2017-02-25 14:59:07 +00:00
Stephan Bergmann
4f502dd570 loplugin:subtlezeroinit: xmlhelp
Change-Id: I8c95b651bf0d764ca33908f9f52c9043abdd62ca
2017-02-21 07:34:55 +01: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
88dde756eb Revert "cancelCommandExecution - no need to pass exception by Any"
This reverts commit 4739b31daf.

Apparently, passing a param of type css::uno::Exception to Any
will record precisely a css::uno::Exception in that Any, losing
any subtype information, which this commit changed.
2017-02-01 15:20:53 +02:00
Noel Grandin
4739b31daf cancelCommandExecution - no need to pass exception by Any
all the call sites are passing an uno::Exception subtype

Change-Id: I6de1f00810e063e75ef620314561d7e2d6445ada
Reviewed-on: https://gerrit.libreoffice.org/33657
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:17:56 +00:00
Noel Grandin
1c3e84d819 teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
   Foo(OUString("xxx"), 1)

Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31 08:56:20 +00:00
Noel Grandin
4142e0a0c0 loplugin: unnecessary destructor writerfilter..xmloff
Change-Id: I511822dc874101ed3b9850b015b746a86d26c3b5
Reviewed-on: https://gerrit.libreoffice.org/33578
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27 06:51:11 +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
Stephan Bergmann
660ec54429 New loplugin:dynexcspec: Add @throws documentation, xmlhelp
Change-Id: I8e3514d36efd8e346985eac31ad5bdf202a30586
2017-01-19 18:03:08 +01:00
Noel Grandin
968f6a7f02 new loplugin: useuniqueptr: unotools..xmlscript
Change-Id: I6966d44cff644112dd837adfe7d9c4f459457271
Reviewed-on: https://gerrit.libreoffice.org/33298
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19 11:28:41 +00:00
Stephan Bergmann
6627b78882 New loplugin:externvar: xmlhelp
Change-Id: Ib531fe3b420e8c8fbec5daddf112f0d33440d463
2017-01-09 15:39:33 +01:00
Noel Grandin
401d07f31f loplugin:datamembershadow
Change-Id: I0206905ce95467a560f8ed24db4403df07d3680e
2016-11-17 11:19:55 +02:00