204 Commits
Author SHA1 Message Date
Andrea Gelmini d9f09e6433 Fix typos
Change-Id: Ia95cc8146f669d7f1ac8834d871427bb57485ef3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209895
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 11:59:56 +02:00
Noel Grandin 68ba1c02ac no need to subclass std::unordered_map here
Change-Id: Ib7be7dac8f394a35eed7212c6fbad3cefa39eaa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185399
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-05-16 13:38:01 +02:00
Noel Grandin ed0b12f4ea no need to take a copy of the getProcessComponentContext return value
we can just take a "const &".

(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)

Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-11-08 15:23:52 +01:00
Mike Kaganski 7a7b1f9cbd Simplify a bit
Change-Id: I224602738ce41529cc5eca681f09db31241a5cac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175385
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-22 06:43:53 +02:00
Noel Grandin 44bb2c8287 loplugin:unusedfields
Change-Id: If05b87f1e6c19b15b03b2695921a582e078d0f1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175011
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-16 15:51:52 +02:00
Noel Grandin ca8c59c7e6 use more concrete UNO type in framework
Change-Id: I3ee54f3967339ab52c04f48a047bc29fc5161680
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173159
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-11 16:14:54 +02:00
Noel Grandin 4f5f24a4a3 loplugin:ostr in framework
Change-Id: I2fdc32aa5de6a1315fe69997f9b531259aa78605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167339
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-08 17:18:51 +02:00
Noel Grandin 091c671832 replace createFromAscii with OUString literals in framework
Change-Id: I5209ab1b869492234946f8471a30c70121824198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167010
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-02 17:51:30 +02:00
Gabor Kelemen 7c18a0bb37 tdf#146619 Drop unused 'using namespace' in: framework/
Change-Id: I03d2d3d07d0d71800df624510b5e20bd5e0588e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165531
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-01 11:46:16 +02:00
Stephan Bergmann 64c47c92d0 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: framework
Change-Id: I0f17c569eddcdc30bfca4cdcd25cb05cf783ec23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158200
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 07:06:17 +02:00
Stephan Bergmann b946842a74 Clean up the remaining uses of OUStringConstExpr, and drop it
Change-Id: I30b2ac77b58e2ae1d1e997a0c830c513542b973d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158101
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-18 11:26:44 +02:00
Noel Grandin 601db233f5 remove dodgy code in OReadToolBoxDocumentHandler
comparing hashcodes without doing an actual comparison
is not safe.
Code was like this since
    commit 6845330a22
    Author: Carsten Driesner <cd@openoffice.org>
    Date:   Wed Oct 17 09:57:37 2001 +0000
    #87255# support toolbar item style and help id

Change-Id: Ie49647da257e6199d9502c916da2dd3d39d52377
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-28 08:24:45 +02:00
Noel Grandin 08495e24e8 OUString::intern is a relic
and a pessimisation. Remove usage thereof.

Change-Id: I98f6197aa375349b909a7ef1403ec06ca37890d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150269
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-12 12:17:49 +02:00
Mike Kaganski f2f008c52a Merge SvXMLAttributeList to comphelper::AttributeList
And simplify the latter, to always use "CDATA" type (as the former did).
"CDATA" was used in all cases but one, where an empty string was used.

Change-Id: I1b3bfae40e29628e4094d9a6e58a69a66865874c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145526
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-15 12:32:29 +00:00
Noel Grandin c60ad041e8 clang-tidy modernize-pass-by-value in framework
Change-Id: I024653154c51389bb27f3e94b422ff7fc1c9b46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135296
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02 12:12:15 +02:00
Stephan Bergmann c1c5ac1165 Drop unnecessary cast to int
...when iterating over the enumerators of enum StatusBar_XML_Entry resp. enum
ToolBox_XML_Entry

Change-Id: I11904e941e98e0ffb96cf1ba4e61c91382944813
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134169
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-11 16:18:44 +02:00
Stephan Bergmann 6b6df07d2f Just use Any ctor instead of makeAny in framework
Change-Id: I9f4990cf58cc794408dd70cd7fbfb2a8effa138c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133806
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 11:58:23 +02:00
Gabor Kelemen e3206e6740 Recheck modules [e-f]* with IWYU
See tdf#42949 for motivation

Change-Id: I49a3ce10dee4b03f99156f5b641f69448e1d5617
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128479
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-17 01:33:35 +01:00
Noel Grandin a67b622ce5 OReadStatusBarDocumentHandler doesnt need SolarMutex
it is only ever used from a single thread. This was there
since the beginning.

Change-Id: Ib001db94c7a5b2520d9a6435e21c27dca60d1dd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128271
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-11 13:21:01 +01:00
Noel Grandin 72493fe922 OWriteToolBoxDocumentHandler doesnt need SolarMutex
it is only ever used from a single thread. This was there
since the beginning.

Change-Id: I580cf86457b2983cd7729bce32cbc0ccca601005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-11 12:55:57 +01:00
Noel Grandin a4d4286a6a introduce OUStringConstExpr
so we can declare compile-time constant arrays and structs
containing OUStringLiteral

Change-Id: I51fd743f2e461a36bb4a0a17c6ff107f86096895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125045
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-12 18:37:38 +01:00
Mike Kaganski f662ba9536 Prepare for removal of non-const operator[] from Sequence in framework
Change-Id: Ied2683a0b8a1bab1a7594da1e9bdbd3cb753552c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124370
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 10:31:26 +02:00
Stephan Bergmann 504d2209e4 Remove some "Attention" comments of little value
...and rather add sal/config.h includes, while at it

Change-Id: I0ea917b101d89f16228bea6b3102b630c8202e07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122369
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-21 08:24:19 +02:00
Noel Grandin 8a54339fc8 loplugin:referencecasting look through more clang Types
Note that because of where the fix resides, loplugin:redundantcast
also notices a few more things.

Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-23 15:25:26 +02:00
Noel Grandin ae29e471ca 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: I63a4b050f220f0a61749892cd47fb91813f7d088
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119844
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 12:57:28 +02:00
Noel Grandin 46ce0d28b4 loplugin:stringliteralvar look for assignments
to O[U]String from char array literals, we can convert the char literals
to O[U]StringLiteral and avoid a runtime allocation

Change-Id: I15d8dddb2cd428b90740e39f20daf98e0941aa6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-15 13:54:53 +02:00
Noel 897970cd0b loplugin:refcounting in framework
Change-Id: I2d7d14fe0335689e4a338c70587bf33137ed1ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111279
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-21 16:11:48 +01:00
Noel 7767ff7b52 loplugin:referencecasting in editeng..framework
Change-Id: Ia3375011ecd0a65afed0f131f477fc1542603fde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16 07:52:37 +01:00
Caolán McNamara ac396f2f6b fix coverity parse errors
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-09 13:01:49 +01:00
Stephan Bergmann a3d0091d18 New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.

(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)

Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26 14:51:15 +01:00
Philipp Hofer 49494bb703 tdf#123936 Formatting files in module framework with clang-format
Change-Id: I8210a1d4bb51519f59265f370f5e8bab8a3c4179
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105674
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-13 15:18:12 +01:00
Gabor Kelemen a5389cb5dd tdf#42949 Fix new IWYU warnings in directories [e-f]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I963aa5fb892a0be36212fd0587b69f217f017947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105469
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-11-12 10:53:07 +01:00
Noel 93c64a61f2 loplugin:stringview
Add new methods "subView" to O(U)String to return substring views
of the underlying data.

Add a clang plugin to warn when replacing existing calls to copy()
would be better to use subView().

Change-Id: I03a5732431ce60808946f2ce2c923b22845689ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105420
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11 11:58:37 +01:00
Noel 87c90cec38 fix some *printf which are using "%l" ie. long specifiers
which are not portable between Linux and Windows because long
is not portable.

In preparation for converting long -> tools::Long

Change-Id: I8bf1aa1570946ca887a6c83dd5f99c024d437336
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104374
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-16 11:12:31 +02:00
Noel Grandin db37d8b625 loplugin:singlevalfields
Change-Id: Ib3c8dc4e98ca46026ec9a8171bae4066bcec7b22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102176
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-07 22:15:23 +02:00
Stephan Bergmann ae662de2f1 Upcoming improved loplugin:staticanonymous -> redundantstatic: framework
Change-Id: I71eaaa7cbc1c38e541291d48eb5f05157fd4c8c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97563
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01 09:48:21 +02:00
Noel Grandin 89340fcb65 use for-range on Sequence in f*
Change-Id: I820255001c1b96d1f4b76a203f3c0f76fa09fe66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-21 08:48:26 +02:00
Noel Grandin ff25a4a6f4 loplugin:flatten in framework
Change-Id: I2a74a7543b5edd853396efa31a3e2568e6607778
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91848
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-08 11:01:31 +02:00
Noel Grandin 0d43023ed4 move some headers inside framework
Change-Id: Ia005938c6a3a954eba910981dde5010a1f977fca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88201
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-08 07:41:31 +01:00
andreas kainz a22de0aacc tdf#130096 Wrap Sidebar update use common .uno commands and layout
Change-Id: Ie8185169582616179fd96850283836f4e3d60ad1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87309
Tested-by: Jenkins
Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2020-01-24 22:20:17 +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
Gabor Kelemen 0f25e181c1 tdf#42949 Fix IWYU warnings in framework/*/*cxx
Also drop the now unused framework/inc/general.h

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

Change-Id: I8e19036a507dbdcd178835b6ac4182719d27a654
Reviewed-on: https://gerrit.libreoffice.org/82744
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-20 10:47:20 +01:00
Gabor Kelemen e4bf92ae34 tdf#42949 Fix IWYU warnings in framework/*/*hxx
Also drop unused framework/inc/fwkdllapi.h

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

Change-Id: I9e79266f273b778f4a8bd3330b1b0353a2e01a61
Reviewed-on: https://gerrit.libreoffice.org/81927
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-11 09:48:23 +01:00
Noel Grandin ab285c743a loplugin:stringadd
tweak the plugin to be more permissive, then validate by hand
afterwards

Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654
Reviewed-on: https://gerrit.libreoffice.org/81942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03 17:11:14 +01:00
Stephan Bergmann d526bd7dd5 Fix StringAdd::isCompileTimeConstant
...to find StringLiteral on the RHS of +=.  Which revealed that the
VisitCompoundStmt/checkForCompoundAssign logic needed to be fixed, too, so that

  s += side_effect();
  s += "literal";
  s += side_effect();

only gets combined to

  s += side_effect() + "literal";
  s += side_effect();

and not all the way to

  s += side_effect() + "literal" + side_effect();

Change-Id: I432e3458b933a7d0ad6141c747b675cc8b0f0ba4
Reviewed-on: https://gerrit.libreoffice.org/81804
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-31 09:14:39 +01:00
Noel Grandin 3ee177a14d loplugin:stringadd look through a couple more known-good methods
Change-Id: Ifbdb3e41eae665f7dcaf5301aaba2b6e4662cf48
Reviewed-on: https://gerrit.libreoffice.org/80855
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-16 07:57:45 +02:00
Noel Grandin 9b3643820b loplugin:stringadd in extensions..framework
Change-Id: I0a0788cdbde292cae582982b0000ee6d5a2056d7
Reviewed-on: https://gerrit.libreoffice.org/79888
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01 08:26:43 +02:00
Jens Carl 1fcbab24c6 Revert "Fix typo"
Revent commit 693e8d1eb2

Change-Id: I87618aad941d92aca2801e1c2b7dfcdbdc007474
Reviewed-on: https://gerrit.libreoffice.org/74408
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-20 08:45:03 +02:00
Andrea Gelmini 693e8d1eb2 Fix typo
Change-Id: I64022d6d94560d695271393b27e3b008755bd7a6
Reviewed-on: https://gerrit.libreoffice.org/74315
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-19 08:09:11 +02:00
Noel Grandin bf9f0b2973 loplugin:sequentialassign in framework
Change-Id: I98da731a0f6b72ea0cb890dae2f25992c75a0984
Reviewed-on: https://gerrit.libreoffice.org/70701
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13 14:47:12 +02:00