Commit Graph
519 Commits
Author SHA1 Message Date
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
Stephan Bergmann db3a61cd95 Generally determine Rdb content from gb_*_set_componentfile calls
...instead of by listing the content somewhat redundantly in the Rdb_*.mk
files, to avoid duplication of logic for components that are only built
conditionally (and thus should only be included conditionally in the
corresponding Rdb).  To achieve that, add an "rdb" parameter to
gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros
that internally call gb_ComponentTarget_ComponentTarget), which is used to make
the appropriate gb_Rdb_add_component call internally from within
gb_ComponentTarget_ComponentTarget.  (As a special case,
gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that
has already been done by the corresponding gb_Library_set_componentfile call, so
allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to
support that special case.)

Most Rdb_*.mk files are thus mostly empty now.  One exception is
i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as
needed during the build in CustomTarget_i18npool/localedata.

1c9a40299d "gbuild: create services.rdb from built
components" had already tried to do something similar (in addition to other
things) under a new --enable-services-rdb-from-build option.  However, that
approach had four drawbacks that this approach here addresses (and which thus
partly reverts 1c9a40299d):

1  Rdb_services shall not contain the component files of all libraries that are
built.  While that commit filtered out the component files that go into
Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files
that go into others like Rdb_postgresql-sdbc
(connectivity/Rdb_postgresql-sdbc.mk).

2  The code added by that commit to Makefile.gbuild codified the knowledge that
there is an Rdb_services, which is brittle.

3  The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge
(for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle.

4  Introducing an --enable-services-rdb-from-build option needlessly provided
two different ways how the content of Rdb_services is assembled.

The changes done here would leave --enable-services-rdb-from-build as a
misnomer, as it no longer controls how Rdb_services is assembled.  I thus
renamed it to --enable-customtarget-components, as that is apparently what it
still does now.

Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-10 08:14:24 +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
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
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 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
Noel Grandin 1553d3787c use for-range on Sequence in d*
and fix bug in GenericClipboard::initialize, where it was looping through
the arguments, but always reading the first one.
I'm guessing it was never an issue because it is always called with
only one argument

Change-Id: I8f72b6bce8c77a69c7d75115e34630e2c308261e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94553
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-20 12:11:11 +02:00
Noel Grandin aa3e3efbfe compact namespace in editeng..extensions
Change-Id: Ie93ac69592c3625b8e2e5db3619ce24597a07a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93722
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08 21:15:41 +02:00
Stephan Bergmann e333b4fdc3 -Werror,-Wpointer-to-int-cast (LLVM 10 trunk clang-cl)
The receiving end, VCLXToolkit::createSystemChild in
toolkit/source/awt/vclxtoolkit.cxx, already extracts a sal_Int64 from the Any.

Change-Id: I758345281a9aafa4eaa27dd31e47e43981df205a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90826
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-20 20:48:03 +01:00
Noel Grandin a56955a4b3 sal_Char->char in editeng..eventattacher
Change-Id: Ia9c736042a07a17377db6d88c5bcd2b468e98777
Reviewed-on: https://gerrit.libreoffice.org/85471
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-19 08:12:46 +01:00
Stephan Bergmann 55e596956e loplugin:external (clang-cl)
...plus loplugin:consttobool and loplugin:fakebool fallout

Change-Id: Ie3d8121815c080b13bea6d9deca1eb138ca56138
Reviewed-on: https://gerrit.libreoffice.org/84515
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05 13:31:39 +01:00
Stephan Bergmann 9f90050aa1 loplugin:consttobool (clang-cl)
Change-Id: I81fea38cd737a8be74e6ece333ca37cc434a1c33
Reviewed-on: https://gerrit.libreoffice.org/83765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-26 16:45:19 +01:00
Julien Nabet 0be61adb07 cppcheck: performing init in init list (dbaccess/desktop/dtrans/e.)
Change-Id: I7909df04a550a4fa843a70d20b5192231c3f175e
Reviewed-on: https://gerrit.libreoffice.org/83600
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-24 14:14:20 +01:00
Stephan Bergmann 5a11fe87a6 loplugin:fakebool (clang-cl)
...plus follow-up loplugin:implicitboolconversion and loplugin:redundantcast

Change-Id: I9fc9c5cb46fbb50da87ff80af64cb0dfda3e5f90
Reviewed-on: https://gerrit.libreoffice.org/83207
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19 21:34:30 +01:00
Stephan Bergmann 5413dcbc6c loplugin:fakebool (clang-cl)
"conversion from 'ATOM' (aka 'unsigned short') to 'BOOL' (aka 'int')"; if the
BOOL return value of winwrap::HatchWindowRegister hasn't been used in bad ways
in the past, this should have been safe in the past, converting from smaller
ATOM to larger BOOL

Change-Id: I836aee56384a01ef0d959ecc5dbebc923acb642b
Reviewed-on: https://gerrit.libreoffice.org/83209
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-19 18:28:55 +01:00
Stephan Bergmann 48ab06d962 Avoid C++20 comparison operator overloading ambiguities (clang-cl -std=c++2a)
The main problem was the non-explicit inprocserv::ComSmart<T>::operator T*()
that caused ambiguities between inprocserv::ComSmart<T>::operator ==(const T*)
and the built-in operator == taking two (cv-qualified) T*.

Many uses of that non-explicit conversion operator could be covered by an
explicit bool conversion operator, but some needed the introduction of a get()
function.

Also, one of the operator == was used by the C++20 overload resolution in a way
that it now needs to return bool.  (And the other functions returning BOOL could
be cleaned up, too.)

Change-Id: I8065f0955a60207c2bd6d8e583d13bc15f324f38
Reviewed-on: https://gerrit.libreoffice.org/82273
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-08 15:39:15 +01:00
Mike Kaganski d51db77c8d Remove some memset calls
Replace them with default initialization or calloc

Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 09:53:42 +02:00
Stephan Bergmann 38ee6b2ad5 -Werror,-Wmicrosoft-exception-spec (clang-cl)
No idea why that started to show up now, but
C:/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/um/combaseapi.h
contains

> #define STDMETHOD(method)        virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE method

while
C:/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/um/winnt.h
contains

> #define STDMETHODIMP            HRESULT STDMETHODCALLTYPE

which caused failures like

> [build CXX] embedserv/source/inprocserv/dllentry.cxx
> embedserv/source/inprocserv/dllentry.cxx(261,40): error: 'QueryInterface' is missing exception specification '__attribute__((nothrow))' [-Werror,-Wmicrosoft-exception-spec]
> STDMETHODIMP InprocEmbedProvider_Impl::QueryInterface( REFIID riid, void ** ppv )
>                                        ^
> embedserv/source/inprocserv/dllentry.cxx(143,15): note: previous declaration is here
>     STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObj) override;
>               ^

Change-Id: I0fe3554c2da4089bf0f883e1132d6f2ee95ae2c3
Reviewed-on: https://gerrit.libreoffice.org/79970
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-02 08:18:57 +02:00
Stephan Bergmann ff06316fe2 loplugin:unnecessaryparen (clang-cl)
Change-Id: Ief84a2e87bd8bb3cbdb753fdb5bec6e57cf38116
Reviewed-on: https://gerrit.libreoffice.org/79939
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01 18:56:31 +02:00
Stephan Bergmann a2ab2b31b8 loplugin:referencecasting (clang-cl)
Change-Id: Ie534212b09b92a02b377d0bb348e11c96bf61786
Reviewed-on: https://gerrit.libreoffice.org/79934
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01 18:56:06 +02:00
Stephan Bergmann e7a1b285df loplugin:indentation (clang-cl)
Change-Id: I19750bd9ac4c77c88097210626fd0c3dfa510a7a
Reviewed-on: https://gerrit.libreoffice.org/79928
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01 16:02:31 +02:00
Stephan Bergmann 664de5a816 loplugin:stringconstant (clang-cl)
Change-Id: Id1a82cea4444255fdb693e126b7571a406094624
Reviewed-on: https://gerrit.libreoffice.org/79916
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01 13:19:04 +02:00