175 Commits
Author SHA1 Message Date
Gabor Kelemen 2c0c0ff155 tdf#146619 Run IWYU on connectivity/
Note: the --ns mode gives a lot of false positives on cxx files,
the script needs improvements here

Change-Id: Ie9181da8a1b8525f6bb8d85c25ecefc4814b39d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189787
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-09-13 00:04:41 +02:00
Stephan Bergmann d0e6d192c2 These bogus -Wdangling-reference still hit with current GCC 16 trunk
Change-Id: I228e0b148d77b973afb4e35b8976438ba5a95967
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184517
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2025-04-23 19:02:52 +02:00
Stephan Bergmann 294b4cc545 These bogus -Wdangling-reference still hit with current GCC 15 trunk
Change-Id: Ice2be2156474cf486ad1c461d65e2711ebf43d2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173232
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-09-12 08:03:43 +02:00
Noel Grandin 0b8f585f8a use more officecfg in OSDBCDriverManager
Change-Id: I2b1758572a6436d829d547d60bca5fa2d1a3c98f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167641
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-15 10:05:45 +02:00
Noel Grandin 4d97239b7a loplugin:ostr in connectivity
Change-Id: Ice633719b05240ab5a052b62ca4eafe89f97e12f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167238
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-07 08:46:13 +02:00
Stephan Bergmann 6b7245f512 A number of bogus GCC 13 warnings still hit with recent GCC 14 trunk
Change-Id: I0ec7743cd79429591fcfc3eb9715ff36d06fc00b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-04 07:06:17 +02:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Caolán McNamara 0cfb4aa262 cid#1546354 COPY_INSTEAD_OF_MOVE
and

cid#1546319 COPY_INSTEAD_OF_MOVE
cid#1546286 COPY_INSTEAD_OF_MOVE
cid#1546283 COPY_INSTEAD_OF_MOVE
cid#1546191 COPY_INSTEAD_OF_MOVE
cid#1545953 COPY_INSTEAD_OF_MOVE
cid#1545874 COPY_INSTEAD_OF_MOVE
cid#1545857 COPY_INSTEAD_OF_MOVE
cid#1545781 COPY_INSTEAD_OF_MOVE
cid#1545765 COPY_INSTEAD_OF_MOVE
cid#1545546 COPY_INSTEAD_OF_MOVE
cid#1545338 COPY_INSTEAD_OF_MOVE
cid#1545190 COPY_INSTEAD_OF_MOVE
cid#1545272 COPY_INSTEAD_OF_MOVE
cid#1545242 COPY_INSTEAD_OF_MOVE
cid#1545229 COPY_INSTEAD_OF_MOVE

Change-Id: I88813d9dbd87ce10375db8198028f8b70e23f0fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162027
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-13 22:53:50 +01:00
Julien Nabet 1d11f80148 Replace useless throwNoSuchElementException function
by its straightforward and short content.

Change-Id: Ic847f12923e71addf00b7b16546c8168cf3952f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157552
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2023-10-04 13:44:32 +02:00
Stephan Bergmann 5377a98c2c Silence some false -Werror=dangling-reference
...seen at least with gcc-c++-13.0.1-0.7.fc38.x86_64,

> connectivity/source/manager/mdrivermanager.cxx: In lambda function:
> connectivity/source/manager/mdrivermanager.cxx:621:41: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
>   621 |                     const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess);
>       |                                         ^~~~~~~~~~~~~
> connectivity/source/manager/mdrivermanager.cxx:621:81: note: the temporary was destroyed at the end of the full expression ‘drivermanager::{anonymous}::EnsureDriver(this->drivermanager::OSDBCDriverManager::m_xContext).drivermanager::{anonymous}::EnsureDriver::operator()((* & driverAccess))’
>   621 |                     const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess);
>       |                                                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

and

> vcl/source/window/layout.cxx: In function ‘array_type assembleGrid(const VclGrid&)’:
> vcl/source/window/layout.cxx:952:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
>   952 |             const GridEntry &rEntry = A[x][y];
>       |                              ^~~~~~
> vcl/source/window/layout.cxx:952:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; reference = boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>::operator[](((boost::detail::multi_array::sub_array<{anonymous}::GridEntry, 1>::index)y))’
>   952 |             const GridEntry &rEntry = A[x][y];
>       |                                             ^
> vcl/source/window/layout.cxx: In function ‘void calcMaxs(const array_type&, std::__debug::vector<VclGrid::Value>&, std::__debug::vector<VclGrid::Value>&)’:
> vcl/source/window/layout.cxx:1075:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
>  1075 |             const GridEntry &rEntry = A[x][y];
>       |                              ^~~~~~
> vcl/source/window/layout.cxx:1075:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) const [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; const_reference = boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::operator[](((boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::index)y))’
>  1075 |             const GridEntry &rEntry = A[x][y];
>       |                                             ^
> vcl/source/window/layout.cxx:1106:30: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
>  1106 |             const GridEntry &rEntry = A[x][y];
>       |                              ^~~~~~
> vcl/source/window/layout.cxx:1106:45: note: the temporary was destroyed at the end of the full expression ‘boost::multi_array_ref<T, NumDims>::operator[](index) const [with T = {anonymous}::GridEntry; long unsigned int NumDims = 2; const_reference = boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>; index = long int](((boost::multi_array_ref<{anonymous}::GridEntry, 2>::index)x)).boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::operator[](((boost::detail::multi_array::const_sub_array<{anonymous}::GridEntry, 1, const {anonymous}::GridEntry*>::index)y))’
>  1106 |             const GridEntry &rEntry = A[x][y];
>       |                                             ^

Change-Id: I498bb468ade52f83117c8cf57f8d64697978d9ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148921
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-15 19:57:23 +00:00
Stephan Bergmann effc64f238 Simplify AcceptsURL
Change-Id: I14cd7d6bce2d5d5160e21b4fd12dcb77572925b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148922
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-15 14:54:26 +00:00
Stephan Bergmann 91ba9654ba Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxx
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit.  (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx.  The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now.  Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)

Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18 17:10:19 +02:00
Noel Grandin 0f01b42e73 clang-tidy modernize-pass-by-value in connectivity
Change-Id: I1f1b609254c7f8cfba14c248167f81b51684d8e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135727
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-13 18:11:03 +02:00
Stephan Bergmann 1f110bf567 Just use Any ctor instead of makeAny in connectivity
Change-Id: I68e7354f094ee0e673d105dd8770a658810703d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133838
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 22:29:41 +02:00
Jan-Marek Glogowski fa5db38ae5 oss-fuzz: fix some compiler warnings
Some unused functions and variables and many missing
HAVE_FEATURE_NSS warnings, because the native-code.py
stubs were missing the config_crypto.h header.

Change-Id: I88ff7d8f96e7382027a21f205db982fd797bd6af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127392
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-25 17:04:13 +01:00
Julien Nabet 9466e895b3 Fix typos in mdrivermanager.cxx (connectivity)
Change-Id: Ib5c115faf0dcff61be806b538c4f93bc16b9928b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127230
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-12-21 16:07:23 +01:00
Noel Grandin 25298930bc loplugin:flatten in canvas..cui
Change-Id: I208767eaa60d913fe2882403f1f9351eb08256f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127224
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21 15:55:46 +01:00
Mike Kaganski 089dbfda13 Prepare for removal of non-const operator[] from Sequence in connectivity
Change-Id: If92f9af5e248f4b066359fe043adf221102e8561
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124353
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29 10:31:51 +02:00
Noel Grandin 7c3990c38d loplugin:moveparam in connectivity
Change-Id: Iaf3a64effb69fd82c6303d8fa75723ccc5ced543
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123183
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06 21:17:01 +02:00
Caolán McNamara 9c04a7692b some prerequisites to use dbase import with config unavailable
Change-Id: I0a7f32a69112d7ce9ffc39481154c9da346c8d24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122544
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-24 09:32:34 +02:00
Noel Grandin 1597cc5b3e convert #defines to OUStringLiteral
mostly by doing

$ git grep -l '#define.*\"' -- *.cxx
    | xargs perl -pi -e
's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 =
u\2;/g'

Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 14:43:58 +02:00
Vincent LE GARREC 6069a66690 tdf#124176 Use pragma once in connectivity
Change-Id: I4a57cd6dcbc180fe9a378d2713c687a66476ee79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111979
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 12:12:27 +01:00
Mike Kaganski 7921f47ec6 Drop 'static_cast<cppu::OWeakObject*>' syntactic noise
... a leftover from 96388e5e80.

Change-Id: I909a470612c421472d8bf94f80e3e94ecb51d6e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112257
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-10 16:23:14 +01:00
Noel 6ec7f2b22b loplugin:referencecasting in connectivity
Change-Id: I4b91c3e4a225323235ea37d77f0f96600bf412be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110969
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-17 11:41:55 +01:00
Noel d6d80c4e17 OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-01 09:28:52 +01:00
Gabor Kelemen 7bdbb50a50 tdf#42949 Fix new IWYU warnings in directories c*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Iac1e7802dbe1efa01c2befdd10406231788d4fc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105315
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-06 08:18:45 +01:00
Andrea Gelmini 269b8a086e Fix typos
Change-Id: Ia66e31a0ad71dde1a6c1caa911d6083e1fb9eb61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104538
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-10-21 20:37:07 +02:00
Stephan Bergmann d9ba652064 Use the new single-instance="true" attribute in connectivity
Change-Id: Ie49207b659214163f2f57051ac8f9de02fab36c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103735
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-01 09:45:22 +02:00
Miklos Vajna c10ea0e903 Remove some unused includes
Change-Id: Iea6b931b1f2328886354f70ad81a3e07367db717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100669
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-08-13 18:27:31 +02:00
Noel Grandin e01f3e8b49 connectivity/sdbc2: create instances with uno constructors
See tdf#74608 for motivation

Change-Id: I707b0e506aa152ec104e677dc09968c2dc1ac9fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98422
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-01 13:14:25 +02:00
nienzu c1e157b58f tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
Change-Id: Ic61c1d5829b510a71b8d444f29ffed36ee540ea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94717
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-06-05 11:34:10 +02:00
Noel Grandin 2d0bdcc586 loplugin:flatten connectivity
Change-Id: Ic1d9eb84b64ebde99e15704a10b27f21447df4d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-18 20:35:49 +02:00
Gabor Kelemen 1dd9200be9 tdf#42949 Fix IWYU warnings in connectivity/*/*cxx
Except for platform specific drivers/ado and drivers/macab dirs

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I24b741cded8995e29ac3d518aeaa0d60b3c55b56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86317
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-14 10:21:47 +01:00
Noel Grandin 386bb99bf6 sal_Char->char in connectivity
Change-Id: Ie32cbef9b03d69044c401f79bc737cde6dd0ed5d
Reviewed-on: https://gerrit.libreoffice.org/85396
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-18 20:38:03 +01:00
Gabor Kelemen b0c9e28591 tdf#42949 Fix IWYU warnings in connectivity/*/*hxx
Except for non Linux specific parts:
connectivity/source/drivers/macab/
connectivity/source/inc/ado/

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Iba6d0cd0effdac777be6fbc8f12f2e92cae47887
Reviewed-on: https://gerrit.libreoffice.org/84174
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-16 10:38:22 +01:00
Stephan Bergmann f853ec317f Extend loplugin:external to warn about classes
...following up on 314f15bff0 "Extend
loplugin:external to warn about enums".

Cases where free functions were moved into an unnamed namespace along with a
class, to not break ADL, are in:

  filter/source/svg/svgexport.cxx
  sc/source/filter/excel/xelink.cxx
  sc/source/filter/excel/xilink.cxx
  svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx

All other free functions mentioning moved classes appear to be harmless and not
give rise to (silent, even) ADL breakage.  (One remaining TODO in
compilerplugins/clang/external.cxx is that derived classes are not covered by
computeAffectedTypes, even though they could also be affected by ADL-breakage---
but don't seem to be in any acutal case across the code base.)

For friend declarations using elaborate type specifiers, like

  class C1 {};
  class C2 { friend class C1; };

* If C2 (but not C1) is moved into an unnamed namespace, the friend declaration
must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see
C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither
qualified nor a template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity has been
previously declared shall not consider any scopes outside the innermost
enclosing namespace.")

* If C1 (but not C2) is moved into an unnamed namespace, the friend declaration
must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882>
"elaborated-type-specifier friend not looked up in unnamed namespace".

Apart from that, to keep changes simple and mostly mechanical (which should help
avoid regressions), out-of-line definitions of class members have been left in
the enclosing (named) namespace.  But explicit specializations of class
templates had to be moved into the unnamed namespace to appease
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of
template from unnamed namespace using unqualified-id in enclosing namespace".

Also, accompanying declarations (of e.g. typedefs or static variables) that
could arguably be moved into the unnamed namespace too have been left alone.

And in some cases, mention of affected types in blacklists in other loplugins
needed to be adapted.

And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which
is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is
not moved into an unnamed namespace (because it is declared in
sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is.  GCC warns about
such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler
doesn’t give this warning for types defined in the main .C file, as those are
unlikely to have multiple definitions."
(<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>)  The
warned-about classes also don't have multiple definitions in the given test, so
disable the warning when including the .cxx.

Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4
Reviewed-on: https://gerrit.libreoffice.org/83239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-22 12:57:32 +01:00
Noel Grandin fe00a724a9 loplugin:sequenceloop in basic..cui
Change-Id: I15d825de3201808d188b461415f78a4d81b64127
Reviewed-on: https://gerrit.libreoffice.org/77494
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15 11:59:02 +02:00
Stephan Bergmann d4ef035e2d Improved loplugin:stringconstant (now that GCC 7 supports it): connectivity
Change-Id: I80dab66757b1f541d448a642a5ecddc876f55c7b
Reviewed-on: https://gerrit.libreoffice.org/76689
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31 13:00:14 +02:00
Arkadiy Illarionov 31f96c3e0d Simplify containers iterations in connectivity
Use range-based loop or replace with STL functions

Change-Id: I1f7c1ea19cdc8d450b7ed88a663ba9ccb3249304
Reviewed-on: https://gerrit.libreoffice.org/68974
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-09 18:31:12 +01:00
Noel Grandin 5fb66ae559 clang-tidy readability-simplify-boolean-expr
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64
Reviewed-on: https://gerrit.libreoffice.org/61902
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18 09:46:28 +02:00
Gabor Kelemen 8df9935dcb tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a
Reviewed-on: https://gerrit.libreoffice.org/60837
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-24 23:23:20 +02:00
Stephan Bergmann 206b5b2661 New loplugin:external
...warning about (for now only) functions and variables with external linkage
that likely don't need it.

The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

returns 1, both moving just the struct S2 into an nunnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    namespace { struct S2: S1 { int f() { return 1; } }; }
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

as well as moving just the function f overload into an unnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    namespace { int f(S2 s) { return s.f(); } }
  }
  int main() { return f(N::S2()); }

would each change the program to return 0 instead.

Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17 09:05:38 +02:00
Gabor Kelemen cc7280efdb tdf#42949 Fix IWYU warnings in include/cppuhelper/*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45
Reviewed-on: https://gerrit.libreoffice.org/59297
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-10 09:58:12 +02:00
Noel Grandin 4450b2a166 pass area param to DBG_UNHANDLED_EXCEPTION
and update sallogareas plugin to enforce this

Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a
Reviewed-on: https://gerrit.libreoffice.org/52249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-03 08:38:50 +02:00
Stephan Bergmann f8558f8446 More loplugin:cstylecast: connectivity
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: Idbefb16acae20ab137497e78c9bc5dc5634c07fe
2018-01-12 20:27:27 +01:00
Stephan Bergmann 6f4f5677ac No need to keep these whitelisted functions decorated with SAL_CALL
The only effect SAL_CALL effectively has on LO-internal code is to change non-
static member functions from __thiscall to __cdecl in MSVC (where all other
functions are __cdecl by default, anyway).  (For 3rd-party code, it could be
argued that SAL_CALL is useful on function declarations in the URE stable
interface other than non-static member functions, too, in case 3rd-party code
uses a compiler switch to change the default calling convention to something
other than __cdecl.  But loplugin:salcall exempts the URE stable interface,
anyway.)

One could argue that SAL_CALL, even if today it effectively only affects non-
static member functions in MSVC, could be extended in the future to affect more
functions on more platforms.  However, the current code would already not
support that.  For example, 3af500580b
"loplugin:salcall fix functions" changed FrameControl_createInstance in
UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even
though its address (in ctl_component_getFacrory, in the same file) is passed to
cppuhelper::createSingleFactory as an argument of type
cppu::ComponentInstantiation, which is a pointer to SAL_CALL function.

Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6
Reviewed-on: https://gerrit.libreoffice.org/46436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14 13:03:06 +01:00
Noel Grandin 3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
Noel Grandin ded02dafbc loplugin:finalclasses in connectivity
Change-Id: I0cd075efad83c0a8d6f05c91201a9aa86649590b
Reviewed-on: https://gerrit.libreoffice.org/44386
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-07 10:35:19 +01:00
Noel Grandin 2a612907ae loplugin:flatten in connectivity..desktop
Change-Id: Iff59d3049ba40b4338ef8eec67d08a96b0834d2b
Reviewed-on: https://gerrit.libreoffice.org/42578
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-21 15:41:50 +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