summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/misc/dp_misc.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-04-02tdf#146619 Remove unused #includes from C/C++ filesRafaƂ Dobrakowski1-1/+0
the 'desktop' module was cleaned Change-Id: Ia7dcb77a42ca7f9be67e30d10cd54697bf93b6d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165663 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2023-03-25loplugin:stringadd in d*Noel Grandin1-2/+1
after my patch to merge the bufferadd loplugin into stringadd Change-Id: I625a0adf89f54ea25f0377a266c37acf9a37d723 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149550 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-23rtl::Static to thread-safe-staticNoel Grandin1-11/+13
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13Fix/simplify some vnd.sun.star.expand: handlingMike Kaganski1-6/+2
The vnd.sun.star.expand: payload must be URL-decoded prior to passing it to expandMacros; the protocol must be checked case-insensitively. Use startsWithIgnoreAsciiCase for that. Change-Id: I2be993a0400a27cb7dc57207cd0824b4505afd2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146855 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-28Avoid compiler warningTor Lillqvist1-1/+3
Change-Id: I322b2c0ea14bbf8ed2fe1a306c0ed28f5e5ae258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136875 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit ece304df9ad2aa0f974927320a1324c06b89f337) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146076 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-09use std::this_thread::sleep_for instead of osl equivalentArnaud VERSINI1-1/+2
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-28use more string_view in desktopNoel Grandin1-8/+9
Change-Id: I16dbc8cb027f51703bc016e095096c868f6e2881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140705 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-05tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macrojsala1-1/+1
Also change some integer by std::size_t Change-Id: Ia51b27bb99b8adda576394f9331345cb11149d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137274 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2021-11-12rtl::Static to thread-safe staticNoel Grandin1-0/+8
Change-Id: I6390d1811bad59c09a074039c635710d25a660d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124886 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin1-1/+1
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-07rtl::Static -> function local staticNoel Grandin1-6/+4
Change-Id: Iee030633d2e2b020f38797d0d323680fa552b81a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113713 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28simplify code, use more subView()Noel1-1/+1
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann1-4/+4
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel1-4/+4
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-29loplugin:simplifybool in dbaccess..frameworkNoel Grandin1-2/+2
Change-Id: I0d73bb7d8d3fde426edc0a10c0750758b68aceb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95099 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-20use for-range on Sequence in d*Noel Grandin1-2/+2
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-01-24tdf#42949 Fix IWYU warnings in desktop/Gabor Kelemen1-1/+2
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If72377cb352be71050a5b0a471bbe3b02d9c0f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87117 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-23List more possible executable names returned by osl_getExecutableFileMike Kaganski1-21/+10
Change-Id: I2266b04ec0aabe60ba55a40b71aa7832bcf53bbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87245 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-23Use crt functions for IO in unopkg on WindowsMike Kaganski1-34/+6
Since https://gerrit.libreoffice.org/c/core/+/87210, the workaround using WinAPI is not needed anymore, so this unifies Windows behavior with other platforms. Change-Id: I0fa46b6b98a03a7e4d2fd1347b05c15b8f142607 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87221 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-10use more std::make_sharedNoel Grandin1-2/+1
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21size some stringbuffer to prevent re-allocNoel Grandin1-2/+2
found by the simple expidient of putting asserts in the resize routine. Where an explicit const size is used, I started with 32 and kept doubling until that site did not need resizing anymore. Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4 Reviewed-on: https://gerrit.libreoffice.org/81138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-24loplugin:returnconstval in desktop..formsNoel Grandin1-3/+3
Change-Id: I268e352e4e3054d1c1a8e61e52d91fd99794b359 Reviewed-on: https://gerrit.libreoffice.org/78057 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann1-1/+2
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin1-1/+1
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-16Fix typosAndrea Gelmini1-1/+1
Change-Id: I25660634dcb9ebb31292275e31ed7a047e4ddd25 Reviewed-on: https://gerrit.libreoffice.org/63474 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann1-1/+1
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24loplugin:external (clang-cl)Stephan Bergmann1-1/+1
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-17New loplugin:externalStephan Bergmann1-1/+1
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin1-1/+1
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-13Increase resolveUnoURL timeout from 20 to 40 secStephan Bergmann1-2/+2
(Used when a unopkg process talks to an soffice process, or a unopkg or soffice process talks to a uno process.) Jenkins lo_ubsan ASan+UBSan builds quite often fail in CustomTarget_odk/build-examples with connections from an unopkg process to a uno process (that has just been forked by the unopkg process) timing out. Lets see if increasing the timeout will fix that. Change-Id: Ifcd886f00670f86bb8975a206c89f565d409912e
2017-10-23loplugin:includeform: desktopStephan Bergmann1-3/+3
Change-Id: I2dacb21cd0c9618dadb49912e0f09c9ab576f9b0
2017-09-22Windows: avoid dependence on UNICODE define; prefer W functionsMike Kaganski1-1/+0
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-07-19loplugin:constparams in desktopNoel Grandin1-1/+1
Change-Id: Idba3acbd1e6ad5e1ce1cae9f80f764906ab8b143 Reviewed-on: https://gerrit.libreoffice.org/40157 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke1-1/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-15use more SAL_N_ELEMENTS part 3Noel Grandin1-1/+1
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07revert OSL_ASSERT changesChris Sherlock1-7/+7
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert desktop module away from OSL_ASSERT to assertChris Sherlock1-7/+7
Change-Id: I521042a79cf93a51d84b72554d04715b321dd942
2017-04-28loplugin:salunicodeliteral: desktopStephan Bergmann1-1/+1
Change-Id: Id4594d5e0ff79dbe75c5545c22e5b95745d64061
2017-03-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I4b2eac5c999771b10e65fedebdab1d4ef435b367 Reviewed-on: https://gerrit.libreoffice.org/35626 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-07Propagate failure of reading from stdinStephan Bergmann1-1/+1
Change-Id: I8dbd27035db890813a871b4a4ef44d458e28fc61
2016-12-13OSL_TRACE->SAL in chart2..ooxNoel Grandin1-1/+0
Change-Id: I133a6441824bfbefcfcda130119b5c5d706f86b2 Reviewed-on: https://gerrit.libreoffice.org/31907 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-16clang-cl loplugin: desktopStephan Bergmann1-2/+2
Change-Id: If2f5bfa6c05098c5362cd6c7b546520dc01ee821 Reviewed-on: https://gerrit.libreoffice.org/29871 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl1-1/+1
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-04-25clang-tidy modernize-loop-convert in d*Noel Grandin1-2/+2
Change-Id: I0830a41b48e884ef63d32b5873c7007195659bb9
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin1-2/+1
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-01tdf#97966 Drop 'static' keywordsWastack1-1/+1
Including no keywords from extern "C" blocks Change-Id: Icff7c0308843d6a7608be24d7fcf11fa079c7b72 Reviewed-on: https://gerrit.libreoffice.org/23672 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-22tdf#84323: Make osl::Thread::wait more readableGurkaran1-2/+2
It is to improve the readability of calls to osl::Thread::wait. Change-Id: I025d89abf8e84ca73ba08f001be3f45b86c89957 Signed-off-by: Gurkaran <gurkran@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/23416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17use consistent #define checks for the Windows platformNoel Grandin1-6/+6
stage 2 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro In this stage we focus on replacing usage of the WIN macro Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84 Reviewed-on: https://gerrit.libreoffice.org/22393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-09Remove excess newlinesChris Sherlock1-3/+0
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-17/+17
Change-Id: I8204a300c98b891a842ef2e40b65f0810dd7817a