Commit Graph
353 Commits
Author SHA1 Message Date
Gabor Kelemen a48bb5c25b Remove obsolete fw declarations from canvas/ codemaker/ configmgr/
found with bin/find-unneeded-includes --fwdecl

Change-Id: Ife87bf89617d97cee9dd1f25d6e912665e4c33a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183879
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-04-11 10:53:14 +02:00
Julien Nabet 068fef40d3 Related tdf#162279: rather use OSL_DEBUG_LEVEL instead of NDEBUG
Following Stephan's suggestion.

Change-Id: Iaeb7192129d83471aa0a32e7adb272a14e80ff71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179703
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-01-04 09:30:50 +01:00
Mike Kaganski 91b1153bb7 Move LIBO_USE_SOURCE_LOCATION to o3tl for possible reuse
Change-Id: I045fc1d86576f6017def01a14dd9a091ee35a544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179323
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-25 11:54:49 +01:00
Caolán McNamara b289d5f5cb cid#1608561 Overflowed constant
Change-Id: I3115263da1c76f635d544e41c3cf96e068b34324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173543
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-17 17:18:34 +02:00
Mike Kaganski d29d6b49c4 Avoid slicing in operator==
Change-Id: I6f0f1b67dee717d9fa16f4ae9e7b6441d7c5002b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172197
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-22 14:39:05 +02:00
Julien Nabet 572011827a tdf#162279: Base Forms: details of the warning only on debug mode
As Mike noticed, the pb is more general than just Base forms.
So here's the general fix suggested by Mike (thank you for the help!)

Change-Id: Ic57039c9c37f26d2ea2d0e0bda89f277ba7044cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171337
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-08-01 11:44:08 +02:00
Caolán McNamara b671bb2ea7 WaE: C6011 Dereferencing NULL pointer warnings
convert OSL_ASSERT to assert

Change-Id: I047b5987734c14e05c9be89db297749c36a0a26f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166922
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-30 14:48:15 +02:00
Noel Grandin 59ad8d6d15 loplugin:ostr in codemaker,unoidl
Change-Id: I75f5531023f31da029491ce4a078005eebbfe59e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166738
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-04-26 19:44:07 +02:00
Noel Grandin e8b9bcf021 map SAL_DLLPUBLIC_RTTI to visibility:default for gcc
Because I want to make more symbols private, but that runs into a
problem with the special symbol "typeinfo for Foo" which is required for
dynamic_cast.

For clang, we can use SAL_DLLPUBLIC_RTTI to make just that magic
"typeinfo for Foo" symbol visible.

But for gcc, we are left with no option but to make the whole class
visible via <MODULE>_DLLPUBLIC.
(I have a feature request logged against gcc to support something like
that at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113958)

But I also don't want to use <MODULE>_DLLPUBLIC, since that blocks
progress of reducing symbol visibility for platforms other than gcc.

So map SAL_DLLPUBLIC_RTTI to visiblity:default for gcc, which means that
only gcc suffers the negative affects of not having that annotation.

However, that runs into the problem that gcc does not like
visibility:default in a couple of places, so I have to introduce some
extra preprocessor stuff.

Change-Id: Ib4fc5c1d2a1f8cf87d5159a4b5684137ec061605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164356
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-05 14:39:06 +01:00
Stephan Bergmann b2ade3e63e Extract embindmaker from cppumaker into its own tool
...that directly generates one large .cxx

Change-Id: I046539b83f8fde5eda7168c93a8b819137399665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162343
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-21 15:51:39 +01:00
Stephan Bergmann 56ceb5db4e cppumaker: Work around problematic constant named "auto"
...which had been added all the way back in 2002 with
6cd0bbd8ce "adding new file to HEAD" to constants
group css.drawing.CaptionEscapeDirection, which has meanwhile been published, so
no chance of cleaning that up.

But cppumaker already has a mechanism to work around problematic UNOIDL
identifiers, but which was only used for "new-style" entities when they got
introduced, mainly to avoid compatibility issues when retroactively changing the
code generated for existing entities.

But for C++ keywords, the generated code was always broken, so no harm in fixing
it, so introduce an additional IdentifierTranslateMode::KeywordsOnly and use
that at least for constants, to address the immediate issue.

(And with that, a hack can be removed from gb_UnoApiEmbindTarget__add_embind.)

Change-Id: I5cf62fd8b3b298dff2ec28452fb97b424a4ba473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162305
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-19 13:44:01 +01:00
Stephan Bergmann 2bc1c113a4 Clean up generated embind code a bit
For one, no need to wrap in #ifdef EMSCRIPTEN code that is only ever fed into
emcc anyway.  For another, better use fully qualified names throughout generated
code, to avoid unexpected collisions.

Change-Id: I939728c7e0601e5fb3f3634bbd62f35042d91105
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162266
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-19 08:12:18 +01:00
Noel Grandin 6583f5d6b2 loplugin:unnecessaryvirtual
Change-Id: I14ee125874b6f0f1ff5406a3eafea0b19df1a7f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162082
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-15 13:56:05 +01:00
Caolán McNamara 12b96aca86 cid#1546503 Using invalid iterator
and

cid#1546284 Using invalid iterator
cid#1546275 Using invalid iterator
cid#1546049 Using invalid iterator
cid#1545929 Using invalid iterator
cid#1545870 Using invalid iterator
cid#1545668 Using invalid iterator
cid#1545420 Using invalid iterator

Change-Id: I3ad3000631b4be5917b9c5f49f21b8cc003a309c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159056
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07 18:22:46 +01:00
Julien Nabet 67c2a47861 cid#1545597 Using invalid iterator
and :

cid#1545537 Using invalid iterator
cid#1545508 Using invalid iterator
cid#1545494 Using invalid iterator
cid#1545478 Using invalid iterator
cid#1545427 Using invalid iterator
cid#1545420 Using invalid iterator
cid#1545400 Using invalid iterator
cid#1545300 Using invalid iterator
cid#1545258 Using invalid iterator
cid#1545257 Using invalid iterator
cid#1545200 Using invalid iterator
cid#1545183 Using invalid iterator

Change-Id: Ibf3a41902f34286967195c5c3b22e337a4b06809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160322
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04 22:10:20 +01:00
Stephan Bergmann 99b9bc7659 Extended loplugin:ostr: codemaker
Change-Id: I7a8eddee0ecf7ab38cc356c157e9832b715da4c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159724
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 09:16:38 +01:00
Stephan Bergmann 27e7a61992 Follow-up on "Make sure __cpp_lib_source_location is consistently defined"
(113e064117).  Mike pointed out that I forgot to
fix the generated code and that
"https://en.cppreference.com/w/cpp/compiler_support/20 lists <version> as
supported since gcc libstdc++ 9, and README.md requires libstdc++ 8.5."

Change-Id: Ic7477e39e334735c4a563195fee335a599a0ef79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157933
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-13 16:46:07 +02:00
Noel Grandin 9c5f597fc8 use std::source_location instead of std::experimental::source_location
https://en.cppreference.com/w/cpp/compiler_support says that this is
supported in

  GCC >= 11
  CLANG >= 16
  Visual Studio >= VS 2019 16.10

And our Visual Studio baseline is now 2019.

We still need to make the ifdef conditional check clang, because
__has_include will happily return true even if the current clang
does not support the necessary builtins.

Change-Id: I5f2743e204b8ed22d4651053f3ae579a4a192a45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157515
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-12 20:59:45 +02:00
Sarper Akdemir da38a44b28 WASM: Embind: get rid of redundant EMSCRIPTEN conditional
As suggested by Stephan Bergmann in
https://gerrit.libreoffice.org/c/core/+/156273/comments/4087f8b8_8ab9a1bc

It appears whole thing was redundant since the template specialization of
emscripten::internal::raw_destructor in
codemaker/source/cppumaker/cpputype.cxx:1228.

Likely this bit causes memory leaks when the API is used and it is a
temporary workaround.

Change-Id: Ifb015754f16ddff1065b3285268acf8a339f975b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157234
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-26 08:51:50 +02:00
Stephan Bergmann 414316a04f Drop some newly obsolete __clang_major__ version checks
...after 6ef2d358ac "Adapt Clang and GCC minimum
version checks"

Change-Id: Ib25fbb76211d1bda1d230de771f207960e645421
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157204
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-24 17:32:22 +02:00
Sarper Akdemir 841f898574 JavaScript uno bindings for WASM with Embind - first cut
A rough implementation of uno bindings for LOWA using embind.

Adds new parameter '-W' to cppumaker to generate _embind.cxx
files alongside .hdl & .hpp.

For usage examples see static/README.wasm.md

Change-Id: Iee5d05e37bfba8e101c08212b15c05f7f2fa6c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156273
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-18 19:59:57 +02:00
Stephan Bergmann 9111536f1b Introduce css.reflection.Dump singleton
...and revert e1c6f36d8b "Add a to_string()
function to the code generated for UNO IDL constant groups".  (But keep the
constants groups the latter had added to cppu/qa/cppumaker/types.idl, and use
them in the newly added CppunitTest_stoc_dump, for better or worse.)

Change-Id: I56e9eaeb1e45b83a72a25eceef13e719dc6f3a1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149281
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Jenkins
2023-03-22 08:46:35 +00:00
Tor Lillqvist e1c6f36d8b Add a to_string() function to the code generated for UNO IDL constant groups
If the inpt matches one of the constants exactly, the result is the
name of that constant. If the input matches some combination of
constant values that are single bits, the result is the sequence of
the names of those constants joined with plus signs.

For instance, if the IDL has:

constants Constants {
    const byte BIT0 = 1;
    const byte BIT1 = 2;
    const byte BIT2 = 4;
    const byte BIT3 = 8;
}

The result of Constants::to_string(5) is "BIT0+BIT2", and the result
of Constants::to_string(17) is "17".

I am sure there are corner cases that aren't handled as would be
intuitive, especially with types that include unsigned values.
Correspondingly, the semantics of the generated to_string() functions
is not formally defined.

Also add a unit test for the new functionality.

Change-Id: I14aa826d0989ac6dfe97dd5c09119b1601c65643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148995
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-03-17 11:46:36 +00:00
Stephan Bergmann c08e5db055 Make check for complete type more explicit
When 485c9d4f0e "Clarify the use of
untools::WeakReference" introduced cppu::detail::isUnoInterfaceType and its use
in the requires-clause of unotools::WeakReference::get, its commit message
argued that while isUnoInterfaceType only works if the given type is complete,
that would already be taken care of via the use of std::is_convertible_v in the
implementation of unotools::WeakReference::get.  But while std::is_convertible_v
nominally requires its argument types to be complete (unless they are void, or
arrays of unknown bound), typical implementations like recent libc++ or
libstdc++ do not seem to enforce that (and just return false in such a case).

So better make isUnoInterfaceType explicitly require that the given type is
complete.  Which turned up one case where it isn't at the point where
unotools::WeakReference<SdrTextObj>::get is called.  (And while the resulting
call to dynamic_cast<SdrTextObj*>(...) in the implementation of that function
would cause an error when SdrTextObj is not complete, compilers happened to
instantiate that template specialization only at the end of the TU, by which
time SdrTextObj happened to be a complete type in the TUs including that
sd/source/ui/inc/futext.hxx.  So all happened to work out OK.)

Change-Id: I704b8b437fa836e290245d1727e4d356128ef63c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143667
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-05 21:59:45 +00:00
Stephan Bergmann 485c9d4f0e Clarify the use of untools::WeakReference
...which had been introduced in 78040af9ac
"loplugin:refcounting in sc" as a variation on css::uno::WeakReference from
include/cppuhelper/weakref.hxx, but without giving much of a rationale.

And, at least for --with-latest-c++ builds using a capable C++20 compiler,
ensure that the given interface_type is such that the static_cast and
dynamic_cast in the implementation of unotools::WeakReference::get are actually
sound:  If interface_type could be a UNO interface type, that would imply that
the xInterface obtained from the underlying WeakReferenceHelper::get() could be
a proxy from the C++ UNO bridge, which could (a) be a proxy for only a subtype
of interface_type (e.g., just for XInterface), so that the static_cast would be
broken, and (b) be a proxy for which the vtable's RTTI slot is not set up (see
e.g. the ENABLE_RUNTIME_OPTIMIZATIONS code in
bridges::cpp_uno::shared::VtableFactory::initializeBlock in
bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx), so that the dynamic_cast
could crash.  (These issues can even happen when the given interface_type is a
C++ implementation class type, but the given object has been bridged over some
C++ to C++ UNO ("purpose") bridge, but lets leave it at that...)

This required adding some cppu::detail::isUnoInterfaceType predicate to the
include files generated by cppumaker, which can be useful in other places too.
(For the call to isUnoInterfaceType in the requires-clause of
unotools::WeakReference<interface_type>::get to give the correct answer, it is
important that interface_type is a complete type---i.e., the corresponding
codemaker-generated .hpp having been included if interface_type actually were a
UNO include type.  But that is already nicely required by the call to
std::is_convertible_v in the implementation of that function, anyway.)

Change-Id: Ia5efd70085d2d6d45fa0995d00dc8def564bbe5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143601
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-03 07:09:38 +00:00
Noel Grandin 225328b1e3 clang-tidy modernize-pass-by-value in codemaker
Change-Id: I2bd9c4c8ced5f0edb9dbf560fe0ed126b9233c26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134519
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18 14:08:28 +02:00
Noel Grandin fa88fd0fc8 Revert "use more string_view in codemaker"
This reverts commit 9463550eab.

Reason for revert: The codemaker::UnoType::decompose was previously mostly returning the same OString it receives, so this change is likely a pessimisation

Change-Id: Ie1b41889d0a6af9247b8683075d4edd1163fecc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133492
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29 11:12:54 +02:00
Noel Grandin 9463550eab use more string_view in codemaker
Change-Id: If311f5600bd61387cc709065978306c21360dea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133509
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27 16:45:41 +02:00
Noel Grandin 2bf5658247 add a more complete o3tl::getToken
so we avoid OUString copying (mostly when doing stuff like parsing
numbers of out of strings)

Change-Id: I4ef6ac23671c0b40807a22158e655e92dfad4af6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-09 09:08:56 +02:00
Noel Grandin 1927b51993 loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind

Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 13:31:19 +02:00
VaibhavMalik4187 8b327cd86d tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I4f5258ca5b37e9b1b4237c5d29e4a9e5362fa855
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129116
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2022-02-06 21:38:32 +01:00
Stephan Bergmann 162017cd9a Improve DBG_UNHANDLED_EXCEPTION output a bit
For example, in de3898aecb "Add missing test
dependency" it would have output

> warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: "URL at svx/source/unodraw/unoshape.cxx:1600"

rather than

> warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: com.sun.star.beans.UnknownPropertyException message: URL svx/source/unodraw/unoshape.cxx:1600

making it slightly clearer that what follows "URL" is not the value of that URL
but rather the source location where the exception was thrown.

Change-Id: Ia3abd232fce3d95a8b66ff4ed5bab2fcc248df2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128788
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-23 09:50:33 +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 da51433652 Prepare for removal of non-const operator[] from Sequence in codemaker
Change-Id: I058cf9ff4f7ce3f49f1dc3abb6b02268d208b225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124350
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29 10:31:18 +02:00
Arnaud Versini 3721f4a00e codemaker : remove useless includes
Change-Id: Idaac78579d7845a1908bc3c02ff917432ca6a7d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117513
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2021-06-26 16:44:33 +02:00
Stephan Bergmann 6a113a4f14 throw() -> noexcept, part 1/3: Manual scaffolding
The legacy `throw()` dynamic exception specification is gone for good from C++20
(even if compilers typically still accept it, but e.g. Clang has
-Wdeprecated-dynamic-exception-spec to at least warn about it).

Introduce SAL_NOEXCEPT for use in URE interface include files.  (For both the
existing SAL_THROW_EXTERN_C and the new SAL_NOEXCEPT, base usage of `noexept`
not on LIBO_INTERNAL_ONLY, but on the actual compiler C++ version, so that e.g.
building CppunitTest_cppu_any-external, which uses
gb_CppunitTest_set_external_code but not gb_CXX03FLAGS, will not potentially
complain about those macros expanding to the legacy `throw()`, like when
building with Clang -Wdeprecated-dynamic-exception-spec manually enabled.)

Change-Id: I7e5c7f8d5f0fd622cfc9987d656b1f68541375aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114908
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-30 22:46:39 +02:00
Caolán McNamara b550d72293 cid#1473812 Untrusted value as argument
Change-Id: I95877c014d16426622e7114384c8e189c140943c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114836
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-29 12:17:00 +02:00
Noel Grandin 7049328fb2 loplugin:stringadd replace OUStringLiteral temporaries with OUString::Concat
Change-Id: I656f06a74d9f0180ae460264563d6a935c7d2c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114377
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-21 13:15:32 +02: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
Philipp Hofer a079d78439 tdf#123936 Formatting files in module codemaker with clang-format
Change-Id: Icd006d12942489a10fc2b3b801233c9527284721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105652
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-13 15:13:38 +01:00
George Bateman ce73b526c4 tdf#124176 Use #pragma once in codemaker
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: I421f0594d5f4389f7800a5bd0e339edde5627bb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100182
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-04 11:13:46 +02:00
Stephan Bergmann 809ddff82d Fix the Clang check for using <experimental/source_location>
(see the <https://gerrit.libreoffice.org/c/core/+/93868/19#
message-77dcd3b30c4ae3919354f84b46b27d934164a938> comment to "use
std::experimental::source_location in uno::Exception")

Change-Id: I5d682dcf97be59f1798c5c08ad13025dfee0dd4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94495
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-19 17:05:09 +02:00
Noel Grandin 1d0bc21397 use std::experimental::source_location in uno::Exception
Clang and gcc have moved this out of experimental and into std::source_location,
but only in their very latest releases.

Change-Id: I9d9d9155788ee4240455ac4628b298dface4ad24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93868
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-18 08:35:44 +02:00
Noel Grandin 6751a89552 compact namespace in canvas..cui
Change-Id: I7bd0c2a55b936896fcfe7e1a374871008a18618f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93706
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08 12:40:03 +02:00
Noel Grandin ed0097845a loplugin:flatten in codemaker
Change-Id: I973ecef5df990511a41e422b73ed2314434f2871
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92479
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-18 21:46:13 +02:00
Noel Grandin 8dbe8eac89 clang-tidy modernize-concat-nested-namespace in codemaker..configmgr
Change-Id: I48452480fae169e11d60b125bbd0226b6a35a25c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86800
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15 06:58:20 +01:00
Noel Grandin bc539bd3c0 loplugin:stringadd improve detection
if one side of the expression is a compile-time-constant, we don't need
to worry about side-effects on the other side

Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b
Reviewed-on: https://gerrit.libreoffice.org/81589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-28 12:07:54 +01:00
Noel Grandin c68be56c29 size some stringbuffer to prevent re-alloc
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9
Reviewed-on: https://gerrit.libreoffice.org/81278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23 08:55:00 +02:00
Noel Grandin 0f874472c6 size some stringbuffer to prevent re-alloc
found by the simple expidient of putting asserts in
the resize routine. Where an explicit const size is used,
I started with 32 and kept doubling until that site
did not need resizing anymore.

Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4
Reviewed-on: https://gerrit.libreoffice.org/81138
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21 08:36:01 +02:00