summaryrefslogtreecommitdiff
path: root/embedserv
AgeCommit message (Collapse)AuthorFilesLines
2020-11-13tdf#123936 Formatting files in module embedserv with clang-formatPhilipp Hofer5-43/+35
Change-Id: I475628cbec4c22a4b5ec535991d4f68154e3919e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105665 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-10-19clang-cl: Adapt Windows-specific code to extended loplugin:cstylecastStephan Bergmann1-3/+3
...after 1ebeacb20ad0165e399629fcfd7795ad0da3edf8 "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-09-07Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicitStephan Bergmann1-2/+2
...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 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "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-08-21loplugin:stringstatic (clang-cl)Stephan Bergmann1-14/+14
Change-Id: I024c7437e876459e22a6f541405b87ac13e7dc99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101135 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-04loplugin:elidestringvar (clang-cl)Stephan Bergmann1-3/+1
...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-07-07embedserv: create instances with uno constructorsNoel Grandin4-82/+14
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-05-20use for-range on Sequence in e*Noel Grandin1-3/+2
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-20use for-range on Sequence in d*Noel Grandin1-17/+15
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-08compact namespace in editeng..extensionsNoel Grandin1-2/+2
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-03-20-Werror,-Wpointer-to-int-cast (LLVM 10 trunk clang-cl)Stephan Bergmann1-2/+2
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>
2019-12-19sal_Char->char in editeng..eventattacherNoel Grandin1-1/+1
Change-Id: Ia9c736042a07a17377db6d88c5bcd2b468e98777 Reviewed-on: https://gerrit.libreoffice.org/85471 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-05loplugin:external (clang-cl)Stephan Bergmann3-0/+16
...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-11-26loplugin:consttobool (clang-cl)Stephan Bergmann2-5/+5
Change-Id: I81fea38cd737a8be74e6ece333ca37cc434a1c33 Reviewed-on: https://gerrit.libreoffice.org/83765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-24cppcheck: performing init in init list (dbaccess/desktop/dtrans/e.)Julien Nabet1-2/+1
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-19loplugin:fakebool (clang-cl)Stephan Bergmann5-6/+6
...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-19loplugin:fakebool (clang-cl)Stephan Bergmann1-1/+1
"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-08Avoid C++20 comparison operator overloading ambiguities (clang-cl -std=c++2a)Stephan Bergmann2-13/+18
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-10-17Remove some memset callsMike Kaganski1-6/+3
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-02-Werror,-Wmicrosoft-exception-spec (clang-cl)Stephan Bergmann7-139/+139
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-01loplugin:unnecessaryparen (clang-cl)Stephan Bergmann1-4/+4
Change-Id: Ief84a2e87bd8bb3cbdb753fdb5bec6e57cf38116 Reviewed-on: https://gerrit.libreoffice.org/79939 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:referencecasting (clang-cl)Stephan Bergmann1-11/+4
Change-Id: Ie534212b09b92a02b377d0bb348e11c96bf61786 Reviewed-on: https://gerrit.libreoffice.org/79934 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:indentation (clang-cl)Stephan Bergmann2-4/+4
Change-Id: I19750bd9ac4c77c88097210626fd0c3dfa510a7a Reviewed-on: https://gerrit.libreoffice.org/79928 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringconstant (clang-cl)Stephan Bergmann3-12/+12
Change-Id: Id1a82cea4444255fdb693e126b7571a406094624 Reviewed-on: https://gerrit.libreoffice.org/79916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-10clang-tidy: Fix suspicious catches of WIP unhandled-self-assignment checkTamás Zolnai1-0/+3
Change-Id: I1cb16b180f4cc5bf4d65485f03c44a06414d3580 Reviewed-on: https://gerrit.libreoffice.org/70481 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-27loplugin:typedefparam (clang-cl)Stephan Bergmann4-10/+10
Change-Id: I07604028845c49cc084927e21db7f21c5d053bab Reviewed-on: https://gerrit.libreoffice.org/69796 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-26loplugin:indentation (clang-cl)Stephan Bergmann1-2/+2
Change-Id: I94689e4eed290b4505d2caba2d9802ef7fb6cffd Reviewed-on: https://gerrit.libreoffice.org/68378 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-24Clean up dead uses of DISABLE_ATLStephan Bergmann1-6/+1
...after e597ef0489d9d5504721d21eefa15c65da0fb240 "No need for --disable-activex and --disable-atl any longer" Change-Id: I6ea0026fd18e0097aaaf0c1b05618e2a9ddf1a94 Reviewed-on: https://gerrit.libreoffice.org/66871 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-21o3tl::make_unique -> std::make_unique in dbaccess...frameworkGabor Kelemen1-3/+1
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Iad5a422bc5a7da43d905edc91d1c46793332ec5e Reviewed-on: https://gerrit.libreoffice.org/66545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-10o3tl::string_view -> std::string_view (in embedserv)Stephan Bergmann3-8/+12
Change-Id: I32bba8f45ff3b77084aa2d416126f96c051022f4 Reviewed-on: https://gerrit.libreoffice.org/66073 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann2-2/+2
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-18tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-1/+1
Change-Id: I60bb778a88dd5619efd4858eb74d56d28616c777 Reviewed-on: https://gerrit.libreoffice.org/63520 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin1-3/+3
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V716 Suspicious type conversion in return statementCaolán McNamara1-5/+2
https://docs.microsoft.com/en-us/windows/desktop/api/objidl/nf-objidl-irunnableobject-isrunning has IRunnableObject::IsRunning as returning BOOL unlike ::Run which returns HRESULT Change-Id: I992d8ba33502eff56b582e1cb9b73f6227c383b8 Reviewed-on: https://gerrit.libreoffice.org/62169 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-11Drop duplicate WINVER and _WIN32_WINNT definesJan-Marek Glogowski1-3/+0
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-09-24loplugin:external (clang-cl)Stephan Bergmann6-10/+12
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-17loplugin:simplifyconstruct (clang-cl)Stephan Bergmann1-1/+1
Change-Id: I7cae6b3f31b10efc72884bce4bda7bf6b380cbc2 Reviewed-on: https://gerrit.libreoffice.org/60597 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-01Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from dbaccess to extensions Change-Id: I4d15aa35e11664ef78c836ffc2937c7e0bb6ea59 Reviewed-on: https://gerrit.libreoffice.org/58165 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-23Fix typosAndrea Gelmini1-1/+1
Change-Id: If0d8f4033d9bc20f521d33d732fb349f0df5eeef Reviewed-on: https://gerrit.libreoffice.org/57822 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-06-26tdf#96099 Remove some trivial container iterator typedefsArkadiy Illarionov2-2/+1
Change-Id: Ifec98748d55ff6aca64c425c50c2cf2650f61591 Reviewed-on: https://gerrit.libreoffice.org/56422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-17Use for-range loops in embeddedobj, embedserv and formulaJulien Nabet2-19/+12
Change-Id: I56e1bace8ab8312524e681d3865a1a89d523812d Reviewed-on: https://gerrit.libreoffice.org/51459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-01embedserv: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski15-59/+0
Change-Id: I0abd5662648b09f31164d919688e17a651bf78c8 Reviewed-on: https://gerrit.libreoffice.org/48976 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-24loplugin:emptyif (clang-cl)Stephan Bergmann2-7/+0
Change-Id: I8ddf764f9e155c037e25855b7d6efc49eb494179 Reviewed-on: https://gerrit.libreoffice.org/48483 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23More loplugin:cstylecast on WindowsStephan Bergmann4-26/+26
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "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>
2017-12-15loplugin:salcall (clang-cl)Stephan Bergmann1-4/+4
Change-Id: Idda630320bb5e02e1ea675b3b3786c9ec6ac166b Reviewed-on: https://gerrit.libreoffice.org/46504 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-11loplugin:salcall (clang-cl)Stephan Bergmann3-8/+8
Change-Id: I31018af8d992c9496f01a72925e24d9b362e340d Reviewed-on: https://gerrit.libreoffice.org/46204 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-27loplugin:unnecessaryparen (clang-cl)Stephan Bergmann1-2/+2
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-07Remove unnecessary state checks and the variablesMuhammet Kara1-8/+0
Change-Id: I5dffeb9a05195085b6aa503421f65467d0b741a9 Reviewed-on: https://gerrit.libreoffice.org/44375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-27loplugin:includeform: embedserv (Windows)Stephan Bergmann15-30/+30
Change-Id: I98bd95a46e645cf61f81d66faa1f700675e538bd
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski2-22/+24
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>