249 Commits
Author SHA1 Message Date
Gabor Kelemen fd2e467ba3 tdf#146619 Run IWYU in fw decl mode on include/[a-c]*
After recent commit 851fb75779
recheck these directories in include/ again
to test drive the new --headersfwd mode of bin/find-unneeded-includes

Change-Id: I0ede437c4f9958cd98210ed1760a5b98ea8bd1ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192377
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2025-11-08 09:37:19 +01:00
prrvchr b1528cf4d1 tdf#166139 uno-skeletonmaker need to register all service names in passive registration
Change-Id: I5bb176035d09de91459e86e83ec41c772d3ec019
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184126
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-04-14 12:38:04 +02:00
prrvchr ed90785aad tdf#165617 remove unused import from uno-skeletonmaker
Change-Id: Ica9a8078cd85b224ea50fab878cbe339668e0604
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182596
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2025-03-06 19:57:04 +01:00
prrvchr f78397068f tdf#165580 uno-skeletonmaker provide passive registration
Change-Id: Ic347a68eb1a13923493d6efe6d911e7e705145a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182436
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-03-06 11:59:07 +01:00
Caolán McNamara 08964038e1 cid#1607989 Overflowed constant
and

cid#1607976 Overflowed constant
cid#1607855 Overflowed constant
cid#1607731 Overflowed constant

Change-Id: I18e8ffb8a9b5a55e0ecb71862549a94ff5c2fc1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173781
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-23 09:32:54 +02:00
Caolán McNamara 490e64cdc8 cid#1607175 Overflowed constant
and

cid#1606656 Overflowed constant

Change-Id: I278d3745ca5d22defde8ab268e644e9ee312a3cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173751
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-22 20:10:23 +02:00
Caolán McNamara b35a1ee2aa cid#1607362 Overflowed constant
and

cid#1607419 Overflowed constant
cid#1608605 Overflowed constant

Change-Id: Ia63cc771021d8a8031c62582a2fa6a68dc214f08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173614
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-09-18 18:03:24 +02:00
Gabor Kelemen e1a351ca19 Remove now unneeded osl/diagnose.h
followup to commit 57c228803e

Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2024-07-20 10:20:31 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Stephan Bergmann fdc1a42db0 Don't use boost in code generated by uno-skeletonmaker
This had originally used a non-standard std::hash_map in
db4b02eea5 "INTEGRATION: CWS jsc3 (1.4.2); FILE
MERGED", then switched to boost::unordered_map in
639825975e "move sdk repo to boost unordered
containters".  (And Executable_uno-skeletonmaker doesn't need boost during the
build at all, so clean that up here, too.)

Change-Id: I80661d70a54ec5d69b8f124c12d5cb0d6f369887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161147
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-22 11:17:45 +01:00
Stephan Bergmann a0d6538341 Extended loplugin:ostr: unodevtools
Change-Id: If72d80bd748186b974b37d58aa1469af1ffdb34d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159667
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-19 17:29:19 +01:00
Stephan Bergmann 449c9a9322 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: unodevtools
Change-Id: I21dd038249b506ecc58a7002fd3dcd4366176b52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158248
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 17:56:41 +02:00
Noel Grandin 0193b284e8 new loplugin:constexprliteral
OUStringLiteral should be declared constexpr, to enforce
that it is initialised at compile-time and not runtime.

This seems to make a different at least on Visual Studio

Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26 13:12:31 +02:00
Mike Kaganski c9d3abf80e Revert "Use getXWeak in unodevtools"
This reverts commit 35eb21d563.

Reason for revert: this is not a LIBO_INTERNAL_ONLY code.

Change-Id: Idd7a6664c89eca1a5bcfe800cf4fb4a9576722d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152323
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-30 13:56:49 +02:00
Mike Kaganski 35eb21d563 Use getXWeak in unodevtools
Change-Id: I71c8c7f26dac1ce97f29818c73f3268d948d57a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150881
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-27 12:44:52 +02:00
Noel Grandin db7f33af14 loplugin:stringadd in various
when applying my upcoming patch to also consider O[U]StringBuffer

Change-Id: I8cf6a47ad357ddc73e2c430d966be72d5efd1485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149767
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-30 20:03:41 +00:00
Stephan Bergmann 5dfa9433d2 Fix typo
...which was pointed out in
<https://lists.freedesktop.org/archives/libreoffice/2023-January/089867.html>
"Re: Question re the uno-skeletonmaker'-t' CLI qualifier"

Change-Id: I5f03de657bc93dace104bdd307e8f6938742b61b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146126
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-25 14:45:00 +00:00
Noel Grandin 7e3c2e46c6 use more string_view in unodevtools
Change-Id: I60e090381e6e56d531b9727604b4755b96c608c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28 11:45:30 +02:00
Noel Grandin 33bd16b344 loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr()

Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-17 10:27:33 +02:00
Gabor Kelemen 2b44f94908 Recheck modules [uU]* with IWYU
See tdf#42949 for motivation

Change-Id: If710445176681de8e0a0b6c65f58ecaca19dbccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132768
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-12 15:20:47 +02:00
Stephan Bergmann b01e0483ee Extend loplugin:stringview to O[U]StringBuffer::toString
Change-Id: I7ad212dfff8b34d05e3b45107a1ef033a4efc454
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129651
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-08 09:09:32 +01:00
Stephan Bergmann 743e6aa211 Extend loplugin:stringviewparam to starts/endsWith: unodevtools
Change-Id: I89e559d3956bb0b4b59314d55a3ca57d087b8146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122471
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-22 19:59:35 +02:00
Stephan Bergmann a19062084b -Werror,-Wunused-but-set-variable (Clang 13 trunk)
> unodevtools/source/skeletonmaker/skeletoncommon.cxx(47,13): error: variable 'shortfilename' set but not used [-Werror,-Wunused-but-set-variable]
>     OString shortfilename(filename);
>             ^

Change-Id: I18510a5c2d2ceca4eab3ef93c0a32a1bffafac6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116661
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-03 15:16:27 +02:00
Mike Kaganski a0656ec6fc const OUString -> const OUStringLiteral
Mostly automated rewrite

Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-25 10:06:26 +01:00
Vincent LE GARREC 1c0c2bb792 tdf#124176 Use pragma once in u*
ucb, uno*, uui

Change-Id: Ic4b6d541eb0df8bf7bceddf178ebb5177ad2b87b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112046
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 10:54:09 +01:00
Stephan Bergmann 042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
Stephan Bergmann 35e471bb4d Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY.  These had been missed by
1b43cceaea "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).

This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).

The improvement to loplugin:stringadd became necessary to fix

> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.

Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11 21:25:10 +01:00
Noel 8332d6d820 loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30 12:32:14 +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 Grandin cc1e6ee2dd disable O(U)String::concat for internal code
in favour of the more widely used, and better optimised, operator+

Change-Id: I6a1b37e0f3d253af1f7a0892443f59b620efea63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11 06:33:40 +01:00
Andrea Gelmini b683bbb14e Fix typo in code
Change-Id: I186af7793c235cdd42c815049ee74543b705ffe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101206
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-23 15:37:13 +02:00
Andrea Gelmini 3c6e41f806 Fix typos
Change-Id: Iaf1d4aed07d1e6fcfe2392fb65cbd2fa196bcc1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101099
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-21 12:38:30 +02:00
Andrea Gelmini a7e0e800c5 Fix typos
Change-Id: I85a91d24943430b42217ac91611f182059d8ec69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100919
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-18 20:09:04 +02:00
Stephan Bergmann eaf5551862 Silence GCC 11 trunk -Werror=nonnull involving dynamic_cast
...where the compiler now warns that the implicit this pointer argument could be
null in a member function call made via a dynamic_cast-converted pointer (and
where the code apparently relies on the dynamic_cast not to fail)

Change-Id: I79482f4a853b6b47c5f9dd099a4e8377a19f7b0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99219
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-23 07:53:20 +02:00
Stephan Bergmann f0835dca43 Upcoming improved loplugin:staticanonymous -> redundantstatic: unodevtools
Change-Id: I6768925fd5fb00cd4805b00cebaa0c37656591f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97728
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-02 13:16:27 +02:00
Noel Grandin de61e14d0b compact namespace in ucb..uui
Change-Id: I644d5e418028b4b4e66cf67b20a1155a689acab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93906
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10 18:28:34 +02:00
Noel Grandin c82efb610b clang-tidy modernize-concat-nested-namespace
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31 18:36:09 +01:00
Noel Grandin 56063d3062 sal_Char->char in unoxml
Change-Id: Ie14ea8349e5dc698a11b3447429b3ca7cbab9bb3
Reviewed-on: https://gerrit.libreoffice.org/85774
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-24 17:28:50 +01:00
Noel Grandin 231e16d909 loplugin:redundantpointerops simplify *p.get()
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85
Reviewed-on: https://gerrit.libreoffice.org/80382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08 08:26:23 +02:00
Andrea Gelmini ea279143ab Fix typos
Change-Id: I151508c5d0b5d010f55d2324d36659ab5715a70c
Reviewed-on: https://gerrit.libreoffice.org/77274
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-12 11:31:51 +02:00
Andrea Gelmini e6c036915b Fix typos
Change-Id: Ie63c7b2d8bf9579b7b41d7bae515818c8d5706dc
Reviewed-on: https://gerrit.libreoffice.org/77217
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-09 18:02:08 +02:00
Caolán McNamara fbc038cc4f an uno -> a uno
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d
Reviewed-on: https://gerrit.libreoffice.org/72105
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-10 14:50:59 +02:00
Mike Kaganski 65261babf4 tdf#120703 PVS: fix cleanup checks
pofs is guaranteed to be non-nullptr after getOutputStream, so no need
to check that. is_open() only matters to decide if close() is needed.

V595 The 'pofs' pointer was utilized before it was verified against nullptr.
     Check lines: 1033, 1057.
     Check lines: 1194, 1220.

Change-Id: I2dd22d29c465889269f2496f0964bee030cb5964
Reviewed-on: https://gerrit.libreoffice.org/71456
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-28 13:15:39 +02:00
Noel Grandin 1a5b12aa5d optimise find/insert pattern
if we're doing a find/insert on a set or a map, it is better to just do
a conditional insert/emplace operation than triggering two lookups.

Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d
Reviewed-on: https://gerrit.libreoffice.org/70937
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19 13:19:31 +02:00
Mike Kaganski dacde2c039 Revert "Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead"
This reverts commit 84662e9030.

Change-Id: I1cc98d3201390609ae3615baa8e92c926cdcde9a
Reviewed-on: https://gerrit.libreoffice.org/70294
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-05 16:13:14 +02:00
Mike Kaganski 7327260de3 tdf#120703: partially revert commit 85456fae54
... to take into account possible differences of results of dynamic_cast
vs static_cast; the change casts dynamically, as before the commit, and
only adds asserts on the result of the cast.

Thanks to sberg for pointing my mistake out!

Change-Id: Ib77d443e5a858e744f369f58542de603f948fd1c
Reviewed-on: https://gerrit.libreoffice.org/70274
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-05 08:33:33 +02:00
Mike Kaganski 84662e9030 Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead
These helpers are used in code generator code; so any invalid UTF-8
or UTF-16 in the conversion is programmer's error which needs fixing.
Thus, the behavior of toUtf8/fromUtf8 which asserts the validity is
fine here.

Change-Id: I3004e233c9de59f8e348455f1f04d23e8c51ed3d
Reviewed-on: https://gerrit.libreoffice.org/70249
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-04 20:36:11 +02:00
Mike Kaganski 85456fae54 tdf#120703 PVS: Silence V522 warnings
V522 There might be dereferencing of a potential null pointer.

Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48
Reviewed-on: https://gerrit.libreoffice.org/70017
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-01 00:49:12 +02:00
Matteo Casalin 7fa1e75eb4 Take advantage of known index to avoid an OUString copy
Change-Id: I3cf7a10f5d27ddc626adea07697aa65e01f6f978
Reviewed-on: https://gerrit.libreoffice.org/66942
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-27 16:03:44 +01:00
Matteo Casalin be3cb2cb8d Use optimized OUString concatenation
Change-Id: I8314d0e6a6ac922a88ff891af2f1071e7b5692e6
Reviewed-on: https://gerrit.libreoffice.org/66943
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-01-27 11:41:14 +01:00