The following commits introduced these:
77a39107b1 (Silence clang-cl -Wextra-tokens
in midl-generated code, 2015-11-28);
5ccdc4187b (Silence clang-cl -Wextra-tokens
in midl-generated code, 2015-11-30);
34604446fc (Various clang-cl/loplugin
warnings, 2017-03-14).
The problem was, that some versions of midl compiler generated an invalid
code like "#endif !_MIDL_USE_GUIDDEF_", which caused warnings in gcc and
clang (see e.g. https://stackoverflow.com/q/29153518/1397376).
I see that as of VS 2022, this problem is not reproducible, so let's drop
these.
Change-Id: Icce797ae6fa8b1aca17ca0b5051e2af606126bf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194010
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
The file was renamed (and there's no need to repeat its name here).
The build process had changed; just drop that part.
Change-Id: I3393af32164261376c7b247a3b88327f612ea97c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193836
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
It had three separate arrays, together constituting a mapping. In
commit ed00d0ddd6 (create a master
document template type, 2014-09-11), they got desynchronized by a
mistake (a MIME type was added for text global templates, but no
corresponding entries were added to extensions and modes).
This change makes them a single array, and clarifies what "mode"
bits meant. Which groups get (un)registered was not changed.
Change-Id: I1896bc2901cbcc5825beaa49313a45f374bad7d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193712
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Whatever that was intended to mean: if that meant that the constants
were encoded that way, these are UTF-16 already; is that meant that
they only contained characters in that range, that is unimportant.
Change-Id: I5463f1fca0d552a93d3c9d487ed9912c9e1a989e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191240
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
IID_PPV_ARGS allows to avoid reinterpret_casts (and also explicit
auto-deducible IIDs). Also, there always was a mismatch between the
type of mWebBrowser2 (which is IWebBrowser2) and the queried IID in
CSOActiveX::SetClientSite (which was IID_IWebBrowser, instead of
the correct IID_IWebBrowser2). Looks like in practice it wasn't a
problem, but now it's consistent.
Use of CComPtr in CSOActiveX::Load allows to release the pointer
correctly (previously, the call to Release was missing).
Change-Id: I29d672052780a36465f6143106c22fa2c90dab5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180448
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
The loop was over an array which has only one element, so the
condition should also work directly with its only element.
Change-Id: I5b87cf03d90e9da67ac3ff72b593be0ff5fa322c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129677
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
OUString::equalsIgnoreAsciiCaseAscii and compareToIgnoreAsciiCaseAscii
taking string_view are added as overloads, rather than replacements to
the variants taking const char*, because the latter have benefit when
the passed C-style string's length is unknown, because these variants
don't pre-calculate the length.
Change-Id: I2def689d7b7784212dc6cd6b8ae9ab1d42604079
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150272
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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>
BSTR is documented [1] to be prefixed by a 32-bit integer specifying
its length *in bytes* (not characters), so passing wchar_t* as BSTR
is wrong, and the length member of rtl_uString can't substitute the
proper BSTR length, since rtl_uString::length specifies length in
characters. Any code taking BSTR and using SysStringLen to get its
length would only get half of the passed OUString data.
In dbaccess/source/ui/dlg/adodatalinks.cxx, the abovementioned
error was implemented. OTOH, OLEVariant::getByteSequence() in
connectivity/source/drivers/ado/Aolevariant.cxx passed BSTR from
tagVARIANT to ctor of OLEString, which resulted in the BSTR being
freed in both dtors of OLEString and OLEVariant (the latter calls
VariantClear, which itself clears string when vtfield is VT_BSTR).
[1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/bstr
Change-Id: Iedbd62b20133644258af3660616add7b63cac258
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131950
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
... and find directory cearching for path separator.
Also drop obsolete code related to Windows XP and mingw.
Change-Id: Ib48cfeea8a2ae01d3f8b37728ce1e8ca4aa73b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128017
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
seeing as this call does nothing since ~2006
see:
commit 01552f1e77
Author: Stephan Bergmann <sbergman@redhat.com>
Date: Fri Oct 17 16:58:26 2014 +0200
SID_TOGGLE_MENUBAR (aka slot:6661, .uno:MenuBarVisible) is dead
...since introduction of XLayoutManager's private:resource/menubar/menubar in
3fb2acf5b7 "INTEGRATION: CWS layoutmanager
(1.52.10); FILE MERGED" etc. and final removal of SID_TOGGLE_MENUBAR bits in
f605b16e39 "INTEGRATION: CWS sfxcleanup (1.119.8);
FILE MERGED" etc.
What still needs fixing are
extensions/source/activex/SOActiveX.cxx
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
odk/examples/OLE/activex/SOActiveX.cpp
in a similar way as e.g. 0273d3d81d "INTEGRATION:
CWS jl18 (1.6.8); FILE MERGED."
these uses remain outstanding:
odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
odk/examples/OLE/activex/SOActiveX.cpp
Change-Id: Iad43b5adc6ae24e6d794ebef10ed7df476b4e5dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Previous code made ~no sense from error handling PoV. Closing registry
keys could be skipped because of prior errors; booleans were cast to
HRESULT to be checked later using SUCCEEDED macro.
Change-Id: I0735ab7e2f3b29682ab19adb0e96a581e997b8b5
Reviewed-on: https://gerrit.libreoffice.org/64425
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
V505 The 'alloca' function is used inside the loop. This can quickly overflow
stack.
Change-Id: I57773664000df0f5329f957674661a2313205223
Reviewed-on: https://gerrit.libreoffice.org/62038
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
V505 The 'alloca' function is used inside the loop. This can quickly overflow
stack.
V745 A 'wchar_t *' type string is incorrectly converted to 'BSTR' type string.
Consider using 'SysAllocString' function.
V768 The variable 'mnVersion' is of enum type. It is odd that it is used as a
variable of a Boolean-type.
Change-Id: If7533483a53467b6901d1f39411a634d77bbd840
Reviewed-on: https://gerrit.libreoffice.org/62033
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Just keep the definition of _WIN32_WINNT in windows.mk, which
claims it automatically derivates WINVER in some sdk header.
Change-Id: I0a83e91ffdc9e0fc847433a92a45424fbfcb189c
Reviewed-on: https://gerrit.libreoffice.org/61631
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Including:
* expanding STDAPI to its definition (as per
<https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add
__declspec(dllexport) into its middle, in
extensions/source/activex/so_activex.cxx; as discussed in the comments at
<https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in
setup_native, use __declspec(dllexport)", having a function both listed in a
.def file EXPORTS and marking it dllexport is OK, and the latter helps the
heuristics of loplugin:external; however, the relevant functions in
extensions/source/activex/so_activex.cxx probably don't even need to be
exported in the first place?
* follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx
Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191
Reviewed-on: https://gerrit.libreoffice.org/60938
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427cad "Enable loplugin:cstylecast for some
more cases" and a409d32e7f "More
loplugin:cstylecast"
Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862
Reviewed-on: https://gerrit.libreoffice.org/48317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
https://msdn.microsoft.com/en-us/library/ms679351 describes that
"it is unsafe to take an arbitrary system error code returned from an API
and use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS"
Previously in case when an error string would contain inserts, function
returned error, so the error message wasn't shown (at least it didn't
crash, thanks to nullptr as the function's last argument).
As the function may fail, we now pre-nullify the buffer pointer to avoid
dereferencing uninitialized pointer later (though at least for some
Windows versions, the function nullifies the pointer in case of
FORMAT_MESSAGE_ALLOCATE_BUFFER, but there's no explicit guarantee of this).
Also release of allocated buffer is changed to recommended use of
HeapFree.
The code that doesn't make use of OUString is left directly calling
FormatMessage, to avoid introducing new dependencies. Where it makes
sense, we now use WindowsErrorString from <comphelper/windowserrorstring.hxx>
Change-Id: I834c08eb6d92987e7d3d01e2c36ec55e42aea848
Reviewed-on: https://gerrit.libreoffice.org/44206
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
We should only use generic foo function name when it takes params
that are also dependent on UNICODE define, like
LoadCursor( nullptr, IDC_ARROW )
where IDC_ARROW is defined in MSVC headers synchronised with
LoadCursor definition.
We should always use Unicode API for any file paths operations,
because otherwise we will get "?" for any character in path that
is not in current non-unicode codepage, which will result in failed
file operations.
Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633
Reviewed-on: https://gerrit.libreoffice.org/42935
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>