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>
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>
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>
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>
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,
<8bd428574c>
"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>
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
<c9e46219f3>
"[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>
...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>
...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>
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>
...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>
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>
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>
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>
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>
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>
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>
...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>