Commit Graph

1440 Commits

Author SHA1 Message Date
Mike Kaganski
58edf89898 d46f659c75 follow-up: simplify checks
Change-Id: Ib95e7c562741f76a742cd31aa033956a0f0a3c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124169
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 23:09:34 +02:00
Mike Kaganski
370c9d725a d46f659c75 follow-up: add unit test
Change-Id: I34be2bc813bf0d62cac935a84c6371cd64ee68f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124168
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 21:37:09 +02:00
Mike Kaganski
d46f659c75 Make sure that self-assign test checks types
This may be important with static empty sequence cppu::g_emptySeq, that is
common for sequences of different types.

The changes in sd/qa/unit/data/xml/*.xml fix places where anys with empty
Sequence<OUString> used to wrongly take 'if(aAny >>= aPropSeq)' branch in
dumpPropertyValueAsElement (drawinglayer/source/dumper/XShapeDumper.cxx).

Change-Id: I5b0544ca94b30437c01dd46f376408f91510bcb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124167
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 07:19:40 +02:00
Stephan Bergmann
4f5b3e4bd5 In O[U]StringBuffer, make string_view params replacements for OUString ones
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads.  That
way, loplugin:bufferadd and loplugin:stringviewparam found many further
opportunities for simplification (all addressed here).  Some notes:

* There is no longer an implicit conversion from O[U]String to O[U]StringBuffer
(as that goes via user-defined conversions through string_view now), which was
most noticeable in copy initializations like

  OStringBuffer buf = someStr;

that had to be changed to direct initialization,

  OStringBuffer buf(someStr);

But then again, it wasn't too many places that were affected and I think we can
live with that.

* I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to
get them in line with their counterparts taking O[U]String.

* I added an OUStringBuffer::lastIndexOf string_view overload that was missing
(relative to OUStringBuffer::indexOf).

* loplugin:stringconstant needed some addition to keep the
compilerplugins/clang/test/stringconstant.cxx checks related to
OStringBuffer::append and OStringBuffer::insert working.

* loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related
code that had been introduced in 1250aecd71
"loplugin:stringviewparam extend to new.."

Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-11 14:22:22 +02:00
Stephan Bergmann
ad1557f5d7 A more lightweight O[U]StringConcatenation
...compared to a full-blown O[U]String, for temporary objects holding an
O[U]StringConcat result that can then be used as a std::[u16]string_view.

It's instructive to see how some invocations of operator ==, operator !=, and
O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit
materialization of an O[U]String temporary, and how that expensive operation has
now been made explicit with the explicit O[U]StringConcatenation ctor.

(The additional operator == and operator != overloads are necessary because the
overloads taking two std::[u16]string_view parameters wouldn't even be found
here with ADL.  And the OUString-related ones would cause ambiguities in at
least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with
RTL_STRING_UNITTEST, so have simply been disabled for that special test-code
case.)

Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-03 19:50:44 +02:00
Julien Nabet
db12f7a63c drop 'using namespace std' in cppu
Change-Id: I1c9e6d27e47e25bc5c96ceac8d72c7c112c73d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123019
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-03 19:27:23 +02:00
Luboš Luňák
c7c9f3f57a use clang-cl's -Zc:dllexportInlines- for clang-cl builds
This is clang-cl's equivalent of -fvisibility-inlines-hidden,
and it seems to be also sort of the equivalent of MSVC's
-Zc:inline. So it saves build time and disk space.

Clang docs say that this is binary compatible in only one
direction, so our public C++ code shouldn't be using this,
as external C++ code could try to use exported inlines
that are no longer there.

Change-Id: Ie6217808f8ee4a15344183abfc65038e1558d1b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122352
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-20 22:50:59 +02:00
Noel Grandin
9f46bcac09 clang:optin.performance.Padding in cppu
Excessive padding in 'struct cppu::IdContainer' (11 padding bytes, where
3 is optimal).
Excessive padding in 'struct (anonymous namespace)::ObjectEntry' (11
padding bytes, where 3 is optimal).

Change-Id: I39216b9927abeb8ec61ab590dc25bc203a112028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121921
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-10 21:19:48 +02:00
Stephan Bergmann
a36d1308f9 Elide class makeOIdPart
...which is no longer needed since 00f257a7ef
"rtl::Static -> thread-safe static local"

Change-Id: Ie78154c5d8b6ad8278405d1ce56c76997e0478d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121347
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-31 09:16:54 +02:00
Noel Grandin
00f257a7ef rtl::Static -> thread-safe static local
Change-Id: Iac0501e6aa35cc3d8e62f6b6e68b76cf70233aae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120459
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-15 19:17:01 +02:00
Caolán McNamara
413b80ed1a return a reference instead of a pointer
and remove redundant nullptr OSL_ENSURE check

Change-Id: I19e202c3786386ed6f094504a0e1eb6928aa423a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120105
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-06 12:14:58 +02:00
Caolán McNamara
373da7a009 cid#1489779 Uninitialized pointer field
Change-Id: I3a9405ff1ed161a02b590d2ac996d88b5fb1978d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120099
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-06 10:54:46 +02:00
Noel Grandin
5b6f8991d8 osl_createThreadKey->thread_local in IdContainer
Change-Id: I5989610bd49597259d387b81dd7e8c63738255a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120000
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-04 16:06:07 +02:00
Noel Grandin
05ab38359a Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26

Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03 12:20:53 +02:00
Noel Grandin
4408001f5c osl::Mutex->std::mutex in MappingsData
Change-Id: I12f46a5468e7d7dde9bfde977adf4ea13eb89ae3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119138
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-19 08:54:19 +02:00
Noel Grandin
d67cf46ba8 remove unnecessary rtl::Static
no need to delay-init something we always need, and laying
out a std::unordered_map is something we can normally do at
link time anyway.

Change-Id: Ide791d20394580bca615aa3ad564c154037e0816
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119137
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-19 08:53:46 +02:00
Noel Grandin
6db41dd264 osl::Mutex->std::mutex in EnvStack
Change-Id: I1339a362046c96d9056f70cd687d023a055b4cf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-18 20:46:27 +02:00
Arnaud Versini
bd4ee5ea9b cppu : use std::mutex in DisposedCallerAdmin
Change-Id: I3db567a9aed42167ea24eebcf673f19106595f83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117948
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2021-07-17 19:02:18 +02:00
Noel Grandin
bfc1600c6a loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28 10:47:34 +02:00
Christophe JAILLET
6317f8cc83 Re-add a removed mutex
In commit b33fbd55d6, many getMutex() have been replaced by an equivalent
maMutex.
Only in place, the use of a mutex have been simply removed.

Restore it as done in all the other places

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Change-Id: Id85e74e166ec57dd37f8913f8ecf19e2b6465f8f
---
This patch is completely speculative. The removal of this mutex was maybe
done on purpose.
This only looks spurious to me.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117402
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-18 11:03:47 +02:00
Stephan Bergmann
b33fbd55d6 Elide trivial TypeDescriptor_Init_Impl::getMutex
...after 859978445d "flatten
TypeDescriptor_Init_Impl data-structure"

Change-Id: I6a7484dbbb93e7097edfb01db4f41d37fc4dc4b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-14 17:08:54 +02:00
Noel Grandin
0e81b8ecbb Revert "no need to init this on-demand"
This reverts commit c71520d7e7.

Reason for revert: to fix AddressSanitizer: initialization-order-fiasco

Change-Id: I637dfdca4fc51415000f31e658d79a4ec8c17677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117117
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-14 15:33:05 +02:00
Noel Grandin
c71520d7e7 no need to init this on-demand
we ~always need it

Change-Id: I94ea47ed75478ecc7c78e89c0209a22d21be2b1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117133
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-14 11:54:23 +02:00
Noel Grandin
859978445d flatten TypeDescriptor_Init_Impl data-structure
avoid unnecessary pointer-chasing for something we are going
to use ~always

Change-Id: I9e1ae0c5b1754fca2e7e1c26441c598dd0eea5dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117111
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-14 10:53:42 +02:00
Stephan Bergmann
10d29c390d throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02 17:02:28 +02:00
Hossein
ea5641baee Updated README.md files to represent current code / use Markdown format
Previously, all of the README files have been renamed to README.md
and now, the contents of these files were changed to use Markdown
format. Other than format inconsistency, some README.md files lacked
information about modules, or were out of date. By using LibreOffice
/ OpenOffice wiki and other documentation websites, these files were
updated. Now every README.md file has a title, and some description.
The top-level README.md file is changed to add links to the modules.
The result of processing the Markdown format README.md files can be
seen at: https://docs.libreoffice.org/

Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-07 17:47:16 +02:00
Arnaud Versini
550a47f117 cppu : use std::mutex in threadpool
Change-Id: I559a2c533accfe95740c29d726833d0bbab210fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112460
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-06 10:22:34 +02:00
Hossein
c16158772d Using .md extension/Markdown syntax for modules README
Renaming all README files for all top level modules to README.md,
applying no content change at this stage to be able to track history
of the files. These files should be edited to use correct Markdown
syntax later.

Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-24 11:46:14 +01:00
Stephan Bergmann
896800a709 sal_Unicode is always char16_t in LIBO_INTERNAL_ONLY code now
...since 9ac98e6e34 "Finally switch MSVC to
sal_Unicode = char16_t, too"

Change-Id: I0df169307618aba3f609400312737c6e1e1d3aaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110581
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-08 15:59:10 +01:00
Stephan Bergmann
6b00d0576a Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)
...by re-enabling the code temporarily #if'ed-out in
a528392e71 "Fixed/improved
loplugin:cppunitassertequals" (and which then triggers lots of other
lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings).

For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it
was more straightforward to rewrite them with an explicit call to operator ==
(which silences loplugin:cppunitassertequal) than to adapt them to
CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types.

In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been
implemented trivially for now, but might want to combine that with the
DEBUG_PIVOT_TABLE-only ScDPItemData::Dump.

Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-08 09:15:01 +01:00
Stephan Bergmann
56cada403f Revert "Don't use global mutex here for local mutex initialization"
This reverts commit 0752de6850, as it causes
initialization-order-fiasco, e.g. when building Gallery_backgrounds:

> ==913067==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x7fee04a01ba0 at pc 0x7fee0467257e bp 0x7ffd678aaa30 sp 0x7ffd678aaa28
> READ of size 8 at 0x7fee04a01ba0 thread T0
>  #0 in osl::Mutex::acquire() at include/osl/mutex.hxx:57:37 (instdir/program/libuno_cppu.so.3 +0x32957d)
>  #1 in osl::Guard<osl::Mutex>::Guard(osl::Mutex&) at include/osl/mutex.hxx:138:17 (instdir/program/libuno_cppu.so.3 +0x316a4e)
>  #2 in typelib_typedescriptionreference_new at cppu/source/typelib/typelib.cxx:2130:16 (instdir/program/libuno_cppu.so.3 +0x3e2d9a)
>  #3 in typelib_static_type_getByTypeClass at cppu/source/typelib/static_types.cxx:266:17 (instdir/program/libuno_cppu.so.3 +0x3c04af)
>  #4 in cppu::detail::getTypeFromTypeClass(_typelib_TypeClass) at include/cppu/unotype.hxx:110:9 (instdir/program/libxolo.so +0x2e87e61)
>  #5 in cppu::detail::cppu_detail_getUnoType(signed char const*) at include/cppu/unotype.hxx:136:12 (instdir/program/libxolo.so +0x2e902dd)
>  #6 in cppu::UnoType<signed char>::get() at include/cppu/unotype.hxx:296:16 (instdir/program/libxolo.so +0x2e90278)
>  #7 in com::sun::uno::Type const& cppu::getTypeFavourUnsigned<signed char>(signed char const*) at include/cppu/unotype.hxx:321:12 (instdir/program/libxolo.so +0x2e90218)
>  #8 in com::sun::uno::Type const& cppu::getTypeFavourUnsigned<signed char>(com::sun::uno::Sequence<signed char> const*) at include/com/sun/star/uno/Sequence.hxx:292:14 (instdir/program/libxolo.so +0x2e9001a)
>  #9 in com::sun::uno::Sequence<signed char>::Sequence() at include/com/sun/star/uno/Sequence.hxx:59:26 (instdir/program/libxolo.so +0x2e8ff58)
>  #10 in __cxx_global_var_init at xmloff/source/core/fasttokenhandler.cxx:35:48 (instdir/program/libxolo.so +0x3455d3f)
>  #11 in _GLOBAL__sub_I_fasttokenhandler.cxx at xmloff/source/core/fasttokenhandler.cxx (instdir/program/libxolo.so +0x3455da4)
>  #12 in call_init.part.0 at <null> (/lib64/ld-linux-x86-64.so.2 +0x108dd)
>  #13 in _dl_init at <null> (/lib64/ld-linux-x86-64.so.2 +0x109c7)
>  #14  at <null> (/lib64/ld-linux-x86-64.so.2 +0x10c9)
>
> 0x7fee04a01ba0 is located 0 bytes inside of global variable '(anonymous namespace)::s_Mutex' defined in 'cppu/source/typelib/typelib.cxx:286:12' (0x7fee04a01ba0) of size 8
>   registered at:
>  #0 in __asan_register_globals at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:360:3 (instdir/program/gengal.bin +0x28698d)
>  #1 in asan.module_ctor at <null> (instdir/program/libuno_cppu.so.3 +0x42649b)

Change-Id: Iab673f048bfb76165de2c47c2db63e339069fd17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110228
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-01 22:09:30 +01:00
Mike Kaganski
0752de6850 Don't use global mutex here for local mutex initialization
Change-Id: I06b0856ac5559aca472daf241771a2ef57b44912
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110147
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-31 08:43:21 +01:00
Mike Kaganski
ef6a57ed4e Don't use global mutex here for static initialization
Change-Id: I3fa0cd7e31a8c89b5fb1eba7b36636e02a785df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110140
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-30 22:14:36 +01:00
Mike Kaganski
ff1e65afdc Simplify the ctor
Change-Id: Iad9b007f8a67353343813a44f46a8a0b88b555fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110136
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-29 21:44:14 +01:00
Noel
1250aecd71 loplugin:stringviewparam extend to new..
O[U]StringBuffer methods

Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-29 09:25:12 +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
bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Philipp Hofer
fddcbd5d28 tdf#123936 Formatting files in module cppu with clang-format
Change-Id: I98281fce06c2a8c094db9e80c1f6bdf35ce70ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105657
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-13 15:14:36 +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
Stephan Bergmann
2d111470f5 Reinstate o3tl/cppunittraitshelper.hxx uses for C++20
...introduced with 5d8f0fad50 "Adapt
CPPUNIT_ASSERT to C++20 deleted ostream << for sal_Unicode (aka char16_t)" (see
there for details) but erroneously removed with
7bdbb50a50 "tdf#42949 Fix new IWYU warnings in
directories c*"

Change-Id: I32880a719525915f397fc65979265b67189ec604
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105397
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-06 15:29:22 +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
Caolán McNamara
92906c1161 cid#1448292 coverity has difficulty with css::uno::Sequence
current attempt isn't working, try a different approach to
silence these warnings

Change-Id: I0cc97df0897abc665dfbb683d7aa0df55f8affb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103387
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-25 15:16:06 +02:00
George Bateman
08cc983e26 tdf#124176 Use #pragma once in cppu, cppuhelper
This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.

Change-Id: I0b7c5bec8e56bd21e719c8889fe263e377f3b8ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102547
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-13 15:28:21 +02:00
Stephan Bergmann
3d0aca29e3 Remove dead comment
...which had been dead ever since b525a3115f
"initial import" and whose removal has already been suggested in
04bb20f5ad "Fix typo"

Change-Id: I57d1e284e9c38836dca620fd3d0058fc5c6f098e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100854
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-17 13:36:08 +02:00
Andrea Gelmini
04bb20f5ad Fix typo
bDesctructorCalled doesn't exist in the code anymore.
I guess we can delete the comment.

Change-Id: I551efe2298422e5139f1dd07a6b3bf4728763026
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100774
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-15 19:08:27 +02:00
Stephan Bergmann
41723365f6 Avoid warnings about unused Char4
Change-Id: Ibcb256552ee03b14a76463be3d9b7ce53213fa7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100124
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-05 08:07:41 +02:00
Noel Grandin
e54777276d loplugin:flatten in configmgr..i18nutil
Change-Id: Idaeed33df4f1dd1b2acbdaf8a895c5d56c3ca14c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99980
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03 11:12:07 +02:00
Thorsten Behrens
c5b985bc9b replace usage of blacklist with excludelist for IWYU
Background and motivation:
  https://tools.ietf.org/html/draft-knodel-terminology-02

Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10 02:03:40 +02:00
Stephan Bergmann
cf1d55096a Upcoming improved loplugin:staticanonymous -> redundantstatic: cppu
Change-Id: Iac1bd5cb1ff1a1786471b2d8b8a3c500a2e15c5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01 08:11:32 +02:00