Commit Graph
479 Commits
Author SHA1 Message Date
David Rosenfeld 4fec122182 tdf#145614: Convert #define to enum class
Change-Id: Ic1147219d09c064817e273309f106d9c091caee4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202945
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-04-04 17:38:37 +02:00
Mike Kaganski 3a54d9870f Simplify use of COMReference a bit
1. Avoid explicitly specifying COM_QUERY in calls to QueryInterface
   (it is implied from the name).
2. Drop redundant ctor and set() that duplicate QueryInterface.
3. Allow ThrowIfFailed without a message.

Change-Id: I75b545e534efb7e57da131dfd40a2a49d204efac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198033
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-01-24 13:36:50 +01:00
varshneydevansh 2a20616d09 Move Windows error helpers to comphelper namespace
Previously, WindowsErrorString and WindowsErrorStringFromHRESULT were
defined in an anonymous namespace in windowserrorstring.hxx, which:
1. Made them unavailable to other translation units
2. Violate ODR by creating separate copies in each TU
3. Require workarounds to access them

Changes:
- Move functions to proper comphelper namespace
- Keep implementations inline as they're simple utilities
- Preserve all existing functionality
- Update all call sites to use comphelper:: prefix

This change enables proper use of these utilities across LibreOffice
while maintaining current behavior and performance characteristics.

Introduced in this commit:

    commit 94cdcaa4d8
    Author: Tor Lillqvist <tml@collabora.com>
    Date:   Thu Aug 13 13:22:28 2015 +0300

        Add a globally usable WindowsErrorString function

Change-Id: I34df1c2b1f30c6204f107ca4792131d692203880
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183332
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-03-26 15:11:33 +01:00
Mike Kaganski 47efcbdcb4 Simplify a bit
Change-Id: Ibb0165d0ce1ec1159a7d5446f746c4cdfcd0d748
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168916
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-06-16 08:59:33 +02:00
Mike Kaganski 52a2c19fc4 Remove some unneeded casts
This also changes the API used in WriteLibraryToRegistry.

Change-Id: Iba4c20567275a64684be8695c771e4c5535956ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168912
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-06-16 06:32:50 +02:00
Mike Kaganski 7b2c82ff14 tdf#161585: fix DllRegisterServer implementation
The buffer was prepared with a wrong length (one too few spaces); thus,
the resulting registry key path was wrong, and opening it failed.

While at it, use a normal WinAPI to stringify GUIDs, and simplify code.

Change-Id: I9a51a5aa70791106055c615fd15a32e5e07847a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168903
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-06-15 15:31:10 +02:00
AmandaQuaresmaCoutinho ccebd10bc4 tdf#148251 Use std::swap instead of using temporary values
Change-Id: I7629d86b8f85a493bd3ad6b9c465a81c746b1dab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165802
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-04-08 20:45:39 +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
Stephan Bergmann c0e516609b loplugin:stringstatic, lopluign:ostr (clang-cl)
Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08 18:58:40 +01:00
Noel Grandin 87db52ab1e Revert "use more Reference::query instead of UNO_QUERY_THROW"
This reverts commit 7fc6063914.

sberg noticed that there is a difference now:

there's a subtle difference now, in that if  y  was null originally, it would have thrown a (caught) exception, whereas now it will crash in the  y.query<X>()  call.

Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-25 14:15:56 +02:00
Noel Grandin 7fc6063914 use more Reference::query instead of UNO_QUERY_THROW
since querying with exceptions is consideably more expensive

Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18 11:03:02 +02:00
Mike Kaganski da685e0029 Use getXWeak in embedserv
Change-Id: If50010a2b2ba18623bcf7c049e8f31091a9a46a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150847
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-28 10:03:59 +02:00
Uday Sharma 0d8d0fb893 tdf#143148: Use pragma once instead of include guards
Change-Id: I6898acbf7c6c9de45bbfa6a32202acf302f92caa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146822
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-03-16 09:25:32 +00:00
Stephan Bergmann 4521cb0c40 Drop redundant -Wnon-virtual-dtor
Inspired by
<https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607102.html> "[PATCH]
doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor", drop explicitly
enabling -Wnon-virtual-dtor in favor of -Wdelete-non-virtual-dtor, which is
already enabled by -Wall.

(-Wdelete-non-virtual-dtor first appeared in Clang 3.0,
<https://github.com/llvm/llvm-project/commit/8bd428574c717e68a8274739d2ba0f6dc16fd0fb>
"Add new warning that warns when invoking 'delete' on a polymorphic, non-final,
class without a virtual destructor", and GCC 4.7,
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=014ab419efc12a59efebd2720d79e1c055675c85>
"invoke.texi: Document -Wdelete-non-virtual-dtor. [...]")

Dropping the explicit setting of -Wnon-virtual-dtor (and nowhere setting it
implicitly via -Weffc++) means we can get rid of lots of places that either set
-Wno-non-virtual-dtor or use some pragma to ignore -Wnon-virtual-dtor.

(In various places across extensions/source/activex/ and winaccessibility/, the
commits f26996bd33 "Silence
-Werror,-Wnon-virtual-dtor in generated so_activex.h (clang-cl)" and
c6086ca653 "Silence -Werror,-Wnon-virtual-dtor in
generated UAccCOM.h (clang-cl)" had singled out some includes to wrap them in
pragmas.  Now that those pragmas are gone again, move those includes back to
where they had been prior to being singled out.  And the -Wno-non-virtual-dtor
in external/firebird/macos-arm64.patch.0 appeared first in
ccd0e5f445 "Make firebird build for macOS on
arm64", which, though it doesn't state it explicitly, apparently created that
patch's builds/posix/prefix.darwin_arm64 as a copy of firebird's already
existing builds/posix/prefix.* files, which routinely include that warning
option too, so keep it there too even if it is probably irrelevant throughout.)

Change-Id: I7e4fa9f2c07e267b2ed15607905027f6b78142f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143182
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-24 10:38:28 +01:00
sahilbutoal08 ac90933dde tdf#143148 Use of #pragma once instead of include guards.
Change-Id: I975ad0a41dbcf39121b266e99b466193386d6b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142046
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2022-11-02 18:44:39 +01:00
insanetree 07b6e34397 tdf#147021: SAL_N_ELEMENTS changed to std::size
Change-Id: I5633e4bb3658864abde49df1c65b93a2b4592631
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141437
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
2022-10-29 20:14:06 +02:00
Mohsen Rahimi 63ef38cf81 tdf#143148 embedserv: Use pragma once instead of include guards
Change-Id: I5a96d63657cdbaf0c161f742307a1e7a09945dbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136949
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-10 14:25:57 +02:00
Diane Leigh 243ffb1604 tdf#143148 Use pragma once in embedserv and helpcompiler
Change-Id: I006bbcea9ea69ffcf7c789691583430c9154af2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136058
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-06-18 15:43:00 +02:00
Stephan Bergmann 562499b75a Just use Any ctor instead of makeAny in embedserv
Change-Id: I2e5f94454a9e5d157cec1f883546655e8c11bd1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133818
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 14:38:29 +02:00
Mike Kaganski eb31b387ac Use GetModuleHandleExW instead of GetModuleHandleW
... following commit d75bf2c770
    Date:	Wed Jan 05 13:20:09 2022 +0300
    tdf#146554: use GetModuleHandleExW instead of GetModuleHandleW

Change-Id: I37c989de37c28123ca692145a429b6ba03202f99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128002
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-05 16:20:36 +01:00
Stephan Bergmann cd057f55ba Silence loplugin:fakebool for BOOL GetMessageW even harder
8f22ce5ea3 "loplugin:fakebool (clang-cl)" had
tried to use auto to silence the warning about GetMessageW's misused BOOL return
type (where GetMessageW encodes more than just true vs. false), but that no
longer works after Clang 14 trunk
<https://github.com/llvm/llvm-project/commit/c9e46219f38da5c3fbfe41012173dc893516826e>
"[clang] retain type sugar in auto / template argument deduction", so just use
int here as the type for which BOOL is a typedef according to
<https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/9d81be47-232e-42cf-8f0d-7a3b29bf2eb2>
"BOOL".

Change-Id: Ie703676e858dba915de5c4496c02db82a2735e29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127298
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-22 13:33:46 +01:00
Mike Kaganski 6108a4413a Value is never nullptr - no need to use pointer and check
Change-Id: Ia3eac25536a16a756486fffe75735d94e2987177
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127088
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18 22:38:01 +01:00
Mike Kaganski 6689f49b27 Drop ComSmart and use sal::systools::COMReference
Change-Id: Ib4f5d160b66c01caa507f536fb487bc5ee527815
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127045
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18 21:23:42 +01:00
Mike Kaganski 0fb0a1e159 Drop unused CSGuard
Change-Id: Ic822345127569a5e08b3dfe80f8e80f2ea49d613
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126985
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18 16:16:58 +01:00
Mike Kaganski 6e37b34087 Move ULONGGuard where it's used
Change-Id: I2b440da8cb9b8cc48904f94af0e7468f620dfb21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127047
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18 13:15:33 +01:00
Mike Kaganski b33564f3a3 Drop unused WriteDebugInfo declaration
Change-Id: I53a6b51fdb1c1d801974da56813b8842384a1c2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126986
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18 12:00:34 +01:00
Noel Grandin 68723d543d use OMultiTypeInterfaceContainerHelperVar3 in embedserv
Change-Id: Iafb936ae3ba23c0c16c2da8538f8da29688df692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126346
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-04 13:31:23 +01:00
Mike Kaganski 7b8f630db3 Use o3tl::convert
Change-Id: I78db3001d602ec1a0847785b3c127b9d345f5af7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125173
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-13 23:38:37 +01:00
Mike Kaganski 52f6aa4bf1 Prepare for removal of non-const operator[] from Sequence in embedserv
Change-Id: Iaed5b6db7b31eadcb5f94d444ba183e943141421
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124362
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 00:30:25 +02:00
Stephan Bergmann a5cea74034 Fix misuses of NULL across Windows-only code
...which defines NULL as a plain 0 integer literal instead of the GNU __null
extension, so clang-cl's -Wnull-conversion cannot kick in.  These findings are
from an experimental build done with clang-cl and a modified

> --- a/clang/lib/Headers/stddef.h
> +++ b/clang/lib/Headers/stddef.h
> @@ -83,6 +83,10 @@ typedef __WCHAR_TYPE__ wchar_t;
>  #  if !defined(__MINGW32__) && !defined(_MSC_VER)
>  #    define NULL __null
>  #  else
> -#    define NULL 0
> +#    if __cplusplus >= 201103L
> +#      define NULL nullptr
> +#    else
> +#      define NULL 0
> +#    endif
>  #  endif
>  #else
>  #  define NULL ((void*)0)

However, that build also ran into lots of places where 3rd-party code in
external/ and Windows system headers caused issues when NULL is nullptr (which
I worked around with various hacky patches for that build), so this is
unfortunately not something that can easily be enabled generally.

Change-Id: I10674464498a9bc63578d9e6cc32ddde23ab4f30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124419
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-29 13:26:12 +02:00
Stephan Bergmann 4e60d1a4c9 Extended loplugin:referencecasting/redundantcast (clang-cl): embedserv
Change-Id: I342859fbeaffee5d396cbb6ae3e5db41f5cdbb79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122886
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-30 15:27:52 +02:00
Noel Grandin 9104017e1b create comphelper:OMultiTypeInterfaceContainerHelperVar2 and use it
based on OInterfaceContainerHelper2 which is considerably
faster than the original OInterfaceContainerHelper

Change-Id: Ia8cdbc5ef877a7af3d9193e1bb2faf1595c15470
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120165
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-08 17:04:03 +02:00
Stephan Bergmann 3c5ac66e21 -Werror,-Wunused-but-set-parameter (clang-cl 13 trunk)
...ever since a934115b3e "Initial revision"

Change-Id: I8935da3ee1c78fcbe5e4858ab009ef4a387b594d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117884
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-25 21:12:22 +02:00
Stephan Bergmann a17c4ef42c -Werror,-Wunused-but-set-variable (clang-cl 13 trunk)
...ever since the code's introduction in
862cac51f8 "INTEGRATION: CWS rcregression01"

Change-Id: I0d7bd81cebc975b8f6054318e4f5a74f508f988f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117880
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-25 16:54:54 +02:00
Stephan Bergmann 68b1c5544c -Werror,-Wunused-but-set-variable (clang-cl 13 trunk)
...ever since the code's introduction in
c765b48589 "CWS-TOOLING: integrate CWS
buildid301_DEV300"

Change-Id: I9e5ad6b8e682d50ba02b08ffcc52292f749ad27a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117882
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-06-25 16:52:17 +02:00
Stephan Bergmann bbcf235753 loplugin:refcounting (clang-cl)
Change-Id: I91189ebd902b70e2fbe42fe8cc09b8677af1a5fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112194
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-09 14:23:45 +01:00
Stephan Bergmann 8f22ce5ea3 loplugin:fakebool (clang-cl)
But GetMessageW encodes more than true vs. false in its BOOL return value, so
silence the unhelpful loplugin with auto.

Change-Id: I77d053b760e93f918367532c63a6dfe963faa12d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110645
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-09 19:41:51 +01:00
Stephan Bergmann 4440be60e4 Silence -Werror,-Wunused-variable (clang-cl)
Change-Id: Ic023076a8673144cb2cf4e5a36d44d592900682e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110642
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-09 17:50:56 +01:00
Mike Kaganski 52e6dea522 Drop FAR/NEAR from 16-bit WinAPI times
Change-Id: Idf71c662138c281333a83cc76a9d75cbf086f362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110236
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-01 07:47:11 +01:00
Mike Kaganski 53584695ca Simplify thread apartment initialization
This also fixes a regression from commit
4342e22060,
which had made o2u_attachCurrentThread a no-op.
From 2006, this initialization had never been executed.
Is it unnecessary after all?

Change-Id: I2ff942a913fa844f5e4627ba23ca34d1b864846b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110217
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-31 22:22:03 +01:00
Jan-Marek Glogowski d249bd5a3d WIN handle GetMessageW return values
GetMessageW returns a BOOL with three defined return values; a
bit unexpected (-1 = error, 0 = WM_QUIT, * = dispatch message).
So this tries to handle the non-dispatch results in some way.

It's not clear for me, if there is some sensible way to "recover"
from an error, but from all I've read it doesn't look like it.
"Recover" means in this case, that the last call failed but next
call may still succeed without changing the parameters.

Change-Id: Ib1f366c7ce8b48158d1935938b49d8da991b30e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110043
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-01-28 17:08:47 +01:00
Stephan Bergmann 1b131be9e5 Simplify some string construction
(motivated by clang-cl loplugin:stringliteralvar)

Change-Id: Iab08e6128a52710fd7d41f0731ac044c00e7d454
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109173
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-12 21:08:39 +01:00
Noel Grandin 46c5de8328 make *String(string_view) constructors explicit
to make it more obvious when we are constructing heap OUStrings
code and potentially inadvertently throwing away performance.

And fix a handful of places so revealed.

Change-Id: I0cf390f78026f8a670aaab53424cd31510633051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-19 17:53:06 +01:00
Philipp Hofer 5035f265cd tdf#123936 Formatting files in module embedserv with clang-format
Change-Id: I475628cbec4c22a4b5ec535991d4f68154e3919e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105665
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-13 15:15:46 +01:00
Stephan Bergmann c4cec8647f clang-cl: Adapt Windows-specific code to extended loplugin:cstylecast
...after 1ebeacb20a "Extend loplugin:cstylecast to
certain function-style casts"

Change-Id: I99bd383f5b3bee861d442d2e1be6ecd356b78315
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104523
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-19 22:01:31 +02:00
Stephan Bergmann c927aab29e Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicit
...and in turn add OUString::operator = and OUString::operator +=
overloads that take a std::u16string_view.  Without making the ctors explicit,
the operator overloads would have caused ambiguities when called with raw
sal_Unicode pointers/non-const arrays, as those can convert to both OUString and
to std::u16string_view.

But the std::u16string_view operator overloads will generally be useful when
changing OUStringLiteral similarly to 4b9e440c51
"Turn OStringLiteral into a consteval'ed, static-refcound rtl_String", at which
point many existing uses of OUStringLiteral will be replaced with uses of
std::u16string_view.

Implementing this change turned up a need for an operator = overload for
OUStringNumber, which has thus been added.  No such need turned up for a
corresponding operator += overload, but which can easily be added when the need
arises.

It also revealed that the operator == overloads between an OUString and a raw
sal_Unicode pointer/non-const array were implemented rather inefficiently,
creating a temporary OUString from the raw argument.  Those have been improved.

Preceding commits have already taken care of many dubious or simply unnecessary
implicit uses of the now-explicit OUString ctors.  This commit makes explicit
the few remaining reasonable uses.  (And in some cases needed to change variable
initialization syntax from using parentheses to using curly braces, to avoid the
most vexing parse issue.  And needed to explicitly add OUString ctors from
char16 const[2] string literal lvalues in a conditional expression in
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx that are only necessary
because MSVC apparently still insists on doing array-to-pointer decay there.)

All of this only affects LIBO_INTERNAL_ONLY.

Change-Id: I7ce31162e9be1c3ff3c0bd184a34b535ec56be9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102098
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-07 19:19:14 +02:00
Stephan Bergmann 13ae66c0eb loplugin:stringstatic (clang-cl)
Change-Id: I024c7437e876459e22a6f541405b87ac13e7dc99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101135
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-21 11:05:28 +02:00
Stephan Bergmann ef0815d8e1 loplugin:elidestringvar (clang-cl)
...plus ensuing loplugin:unnecessaryparen in vcl/source/treelist/transfer.cxx

Change-Id: I1abf2e0c589c2c124399c1337f5dd703ee7d04a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100094
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04 21:38:25 +02:00
Noel Grandin c0929d4b55 embedserv: create instances with uno constructors
See tdf#74608 for motivation

Change-Id: I5f912ee625a37f64f9d9c35ccb13f995a56685c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-07 17:44:43 +02:00
Noel Grandin b33ff1a083 use for-range on Sequence in e*
Change-Id: I77dc12356ee45b1dee9acaf8a73dea81588822d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94554
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-20 21:31:13 +02:00