Commit Graph
218 Commits
Author SHA1 Message Date
Mike Kaganski cbd2e455b6 Drop silencing clang-cl -Wextra-tokens in midl-generated code
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
2025-11-19 08:36:29 +01:00
Mike Kaganski 0918910058 A typo in variable name
Change-Id: I4aa4de8a1b43f5c848eea082ac17f9c02377a5f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193976
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-14 06:03:42 +01:00
Mike Kaganski f4dc928e04 Fix a comment
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
2025-11-12 10:08:13 +01:00
Xisco Fauli ddc29aedf9 fix warning C4101: 'ind': unreferenced local variable
after
commit e5ded88418
Author: Mike Kaganski <mike.kaganski@collabora.com>
Date:   Mon Nov 10 12:12:21 2025 +0500

    Fix registration of ActiveX component

Change-Id: Ic8e784e3a00fcefbd7a0db48f2d31f373543c5ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193733
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-10 13:26:22 +01:00
Mike Kaganski be3e2e667a Fix number of bytes read from a constant string
String length is 15 characters; 17 characters were read (one past
terminating null).

Change-Id: I052a48cbd5414f072adfdc27fe0583171f0f43a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193713
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-11-10 11:52:47 +01:00
Mike Kaganski e5ded88418 Fix registration of ActiveX component
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>
2025-11-10 10:57:14 +01:00
Mike Kaganski a255b04d8d Shorten some names ending with _ASCII
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
2025-09-20 19:35:12 +02:00
Mohamed Zaghloul a790b8f4d5 tdf#147021 Use std::size() instead of SAL_N_ELEMENTS()
Change-Id: I77f84819915497966aa725e35a416c0e7f5c72c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183185
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2025-03-27 12:06:41 +01:00
Mike Kaganski c31c20a065 Use IID_PPV_ARGS and CComPtr to simplify
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>
2025-01-19 13:21:42 +01:00
Hossein 7a643f40b4 Simplify condition in a loop over a single element
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>
2023-09-07 10:09:14 +02:00
Mike Kaganski 53a4b94d01 Use more *string_view
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>
2023-04-12 19:49:15 +02: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
PoonamShokeen 08a63a8854 tdf#145538 Use range based for loops
Change-Id: I144d020c6c57937caa800f019ab175597ed8ede4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137538
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-08-26 22:37:43 +02:00
Mike Kaganski c06e4fffd5 Drop obsolete code
Clang also defines _MSC_VER macro.

Change-Id: I7e483eb1811a3ce5c78a6721895026d004ca98fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138712
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-08-23 09:45:45 +02:00
Mike Kaganski a2c3ef6d81 Move BSTR wrapper to systools, and fix some wrong BSTR uses
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>
2022-03-22 22:23:56 +01:00
Mike Kaganski 9b85e4e326 Use GetModuleHandleExW instead of GetModuleHandleW
... 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>
2022-01-05 19:48:58 +01:00
Caolán McNamara 9e8789f218 remove use of non-existing slot:6661
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>
2021-12-10 10:03:02 +01:00
Noel Grandin a069fac4a0 loplugin:stringliteraldefine in comphelper
Change-Id: I60ccd6049db65fef2397798ab916b0d1e24c0fdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125531
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24 13:23:59 +01:00
Gabor Kelemen 2633d5f97f Recheck include/ with IWYU
See tdf#42949 for motivation

Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09 11:56:36 +02:00
Vincent LE GARREC 039e90ec01 tdf#124176 Use pragma once in extensions
Change-Id: I1a5ed69da20cef4428f5f61db5fb9411cff61dc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112048
Tested-by: Jenkins
Reviewed-by: John Turpish <jbt@gmx.us>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 10:48:06 +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
Stephan Bergmann 5a448a9203 The Windows oleauto.h SafeArray* functions use LONG for indexing
Change-Id: If973cc337e0674462cfe2a15e347881a861a761f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106697
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-26 17:01:08 +01:00
Philipp Hofer d0b3815392 tdf#123936 Formatting files in module extensions with clang-format
Change-Id: I6e86641bc93bf4b3941b01fbef69c1e7984aad3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105667
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2020-11-21 13:17:51 +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
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 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 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
Andrea Gelmini b8454c10bd Fix typo
Change-Id: I4452913a149211f4d1fea2d667aac890916d9e42
Reviewed-on: https://gerrit.libreoffice.org/72876
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-23 20:30:14 +02:00
Caolán McNamara 1156f981ac an is used before a vowel sound
not before vowels with a consonant sound so its a url not an url

Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2
Reviewed-on: https://gerrit.libreoffice.org/72062
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-10 10:01:13 +02:00
Samuel Mehrbrodt 25552011fc ActiveX: Use correct mimetypes
As registered at IANA: https://www.iana.org/assignments/media-types/media-types.xhtml

Change-Id: I6d66f2cd1f96e487562a1042583e08a5beefc262
Reviewed-on: https://gerrit.libreoffice.org/69125
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-13 07:34:18 +01:00
Samuel Mehrbrodt a5f64fff06 Fix typo in mimetype: msexcell -> msexcel
Change-Id: I2227f09ac03f79e424704e00bd072741b3b0eb0d
Reviewed-on: https://gerrit.libreoffice.org/69077
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-12 09:18:48 +01:00
Mike Kaganski aa4427f3f1 Let so_activex learn to work with Win32 errors and HRESULT properly
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>
2018-12-03 01:20:48 +01:00
Mike Kaganski 07a70e84f2 tdf#120703 (PVS): compare BSTR to wchar_t[] directly
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>
2018-10-20 09:24:13 +02:00
Mike Kaganski a3143aa0de tdf#120703 (PVS): properly handle BSTR; fix enum comparison
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>
2018-10-20 08:00:23 +02:00
Jan-Marek Glogowski c8481c8a43 Drop duplicate WINVER and _WIN32_WINNT defines
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>
2018-10-11 00:55:03 +02:00
Stephan Bergmann 928b1b04ad loplugin:external (clang-cl)
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>
2018-09-24 17:22:05 +02:00
Stephan Bergmann 6ad7a76d6f Looks like these functions can be static and not STDAPI
...as they appear to only be called from within this .cxx.  (And
<https://msdn.microsoft.com/library/ms686631(vs.85).aspx> documents that STDAPI
expands to a return type of HRESULT, among further decoration.)

Change-Id: I4994e6e6f8fe0466f9aa9b4c9cf2c20bd718fa05
Reviewed-on: https://gerrit.libreoffice.org/60925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24 11:44:12 +02:00
Mike Kaganski dc4dae1263 extensions: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I7bbb280810af51adc25595667f1c40aca0a8ae26
Reviewed-on: https://gerrit.libreoffice.org/48977
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-01 10:42:07 +01:00
Stephan Bergmann 9af8f190ed More loplugin:cstylecast on Windows
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>
2018-01-23 07:54:51 +01:00
Stephan Bergmann 2eb0cadf03 loplugin:unnecessaryparen (clang-cl)
Change-Id: I5452235287fd5986de25ee542edd57bf1abded52
Reviewed-on: https://gerrit.libreoffice.org/45338
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-27 21:06:21 +01:00
Mike Kaganski e3530d2c9d Make Windows error reporting more robust
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>
2017-11-04 15:24:32 +01:00
Stephan Bergmann ffa11622ea loplugin:includeform: extensions (Windows)
Change-Id: I6619004353fb7e94506e2a75c77b42156f0b6c6d
2017-10-27 19:28:51 +02:00
Mike Kaganski 362a21d3a1 Use explicit function names for fooA/fooW WinAPI; prefer fooW
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>
2017-09-30 11:23:41 +02:00
Mike Kaganski eef4c133e9 Windows: avoid dependence on UNICODE define; prefer W functions
Change-Id: I95b90128e93f0d88ed73601bcc5a7ca9279d4cf1
Reviewed-on: https://gerrit.libreoffice.org/42560
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22 20:53:30 +02:00
Stephan Bergmann 597191920a loplugin:constparams: extensions (clang-cl)
Change-Id: I1665228a622b18757951b725467933699f9871ae
2017-08-31 12:14:40 +02:00
Stephan Bergmann a100b31f0d loplugin:oncevar (clang-cl)
Change-Id: I36c97d99d268b0ebedfd0eebc4722cabc6e51220
2017-08-18 10:07:56 +02:00
Stephan Bergmann 9d04754308 loplugin:casttovoid (clang-cl): extensions
Change-Id: I91eeddd37a745592a9aa0f0827f65db257e1dfad
2017-07-05 10:11:32 +02:00
Jens Carl 998532d854 tdf#96505 Get rid of cargo cult "long" integer literals
Remove "long" integer literals in extensions/

Change-Id: I2eb5daa178ec9adcaddb999bad410aff0e94220c
Reviewed-on: https://gerrit.libreoffice.org/39149
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-04 12:25:23 +02:00
Andrea Gelmini 55cc79f33f Fix typos
Change-Id: Ic823a46019138b8bbcacd7b52b48d7d7ead2fde2
Reviewed-on: https://gerrit.libreoffice.org/35629
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 09:27:18 +00:00