summaryrefslogtreecommitdiff
path: root/comphelper
AgeCommit message (Collapse)AuthorFilesLines
2018-09-27-Werror=unused-variable (--enable-debug --disable-assert-always-abort)Stephan Bergmann1-1/+1
...found by <https://ci.libreoffice.org//job/lo_tb_random_config_linux/1504/> Change-Id: I8ebbe48cdbbdf378731bbc4548031d8799d91532 Reviewed-on: https://gerrit.libreoffice.org/61023 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-24tdf#42949 Fix IWYU warnings in include/comphelper/[a-l]*Gabor Kelemen9-1/+12
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I22ba2c8aec235e34cd7835b8a0a716bf3057db7a Reviewed-on: https://gerrit.libreoffice.org/60837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-19generateGUIDString: Fix incorrect string lengthSamuel Mehrbrodt1-1/+1
This bug caused signature line IDs in OOXML to be written with an appended "_x0000_". Change-Id: If219279a5d5177ec5fac2d9dd747dc015c16b6bc Reviewed-on: https://gerrit.libreoffice.org/60736 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-09-17New loplugin:externalStephan Bergmann5-5/+8
...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-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin1-1/+1
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06loplugin:simplifyconstruct in canvas..cuiNoel Grandin3-6/+2
Change-Id: I02eba1df117a9d0df42bcac13c3251cb4fa6da14 Reviewed-on: https://gerrit.libreoffice.org/60074 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin2-3/+4
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-05loplugin:useuniqueptr in AccessibleEventNotifierNoel Grandin1-3/+3
Change-Id: I4a77e1ea7338a2d38120597a146a5a2d893e970b Reviewed-on: https://gerrit.libreoffice.org/59996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov1-2/+1
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:constantparam (1)Noel Grandin1-42/+7
Change-Id: I25077e391ecca1b678062d261a83d88daadf0a58 Reviewed-on: https://gerrit.libreoffice.org/59701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22new loplugin:conststringfieldNoel Grandin4-62/+49
Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-08-09remove Calc's software interpreterLuboš Luňák1-2/+0
- it's in practice never used nowadays, group threading has higher priority in the code and since SwInterpreter's allowed opcodes are a subset of group threading's, there should be no formula where control flow gets as far as using SwInterpreter - the only opcodes SwInterpreter allows are ocAdd, ocSub, ocMul, ocDiv, ocSum and ocProduct, which is a rather limited set and group threading should handle all that as well - if SwInterpreter performs anything better than group threading, there shouldn't be a problem doing the same for group threading - it's yet another code path that should be handled, tested, etc. and the added complexity is not worth it - it shares some code with OpenCL handling, which is both added hassle in case OpenCL code needs changes, and it also causes confusion such as people thinking SwInterpreter has something to do with OpenCL Change-Id: I99052862b60b6266c70dd436d1d7938177dc6bd9 Reviewed-on: https://gerrit.libreoffice.org/58643 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-07-27new loplugin:stringloop, and applied in variousNoel Grandin1-4/+5
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27Related: rhbz#1602589 add comments to coverity annotationsCaolán McNamara1-1/+1
Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7 Reviewed-on: https://gerrit.libreoffice.org/58093 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-26comphelper: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann1-6/+0
...by removing explicitly user-provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non-deleted in the future. (Even if a dtor was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already inline, so why bother with a non-inline dtor.) Change-Id: Id5494686dd169b17de7830588e603d1fd5f6b768 Reviewed-on: https://gerrit.libreoffice.org/58061 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26loplugin:returnconstant in tools,comphelper,unotoolsNoel Grandin1-3/+1
Change-Id: Iabc3c67b4cdcd0344a37c533bf92dd00cd4700d8 Reviewed-on: https://gerrit.libreoffice.org/57974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-23Fix typosAndrea Gelmini1-2/+2
Change-Id: If0d8f4033d9bc20f521d33d732fb349f0df5eeef Reviewed-on: https://gerrit.libreoffice.org/57822 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-07-20loplugin:unusedfields - look for fields that can be const, in comphelperNoel Grandin9-26/+26
idea from tml. Extend the unusedfields plugin to find fields that are only assigned in the constructor. Change-Id: I258d3581afbe651d53ce730c9ba27a4598cd9248 Reviewed-on: https://gerrit.libreoffice.org/57733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19Fix typosAndrea Gelmini1-1/+1
Change-Id: If7365b05c8f4fd1bf130678cb28f05c9a1add4c7 Reviewed-on: https://gerrit.libreoffice.org/57598 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-07-18Allow the comphelper threadpool to be reset after construction.Michael Meeks1-5/+4
Otherwise some pre-init components can start it, and threads get stranded in the forkit process causing grief. Change-Id: Ib1846f8b329b4c6b84645999dafba1252c5129c7 Reviewed-on: https://gerrit.libreoffice.org/57631 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-07-11clean up UNO available() implementationsNoel Grandin2-3/+2
There seems to be some confusion here. available() is actually the number of bytes that can be read without blocking, but most implementations seems to be just returning the number of bytes remaining in the stream. Since we're doing that, let's do it properly. (*) some of them were just casting, instead of clamping, which will return wrong values sometimes. (*) FileStreamWrapper_Impl/OInputStreamWrapper/OTempFileService were doing unnecessary work, instead of just asking the underlying SvStream for it's remaining size Change-Id: I3ef26e0363e989ed3e00be0fdb993e1cdeb7819f Reviewed-on: https://gerrit.libreoffice.org/57264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09Add missing sal/log.hxx headersGabor Kelemen10-0/+10
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 a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-06base64: change impl. of encodig to also work with OStringBufferTomaž Vajngerl2-51/+75
+ make test simpler and add a test case for the new behaviour Change-Id: Ifc743835f0cd634c79929ce22dc36b5a822a7e88 Reviewed-on: https://gerrit.libreoffice.org/56969 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-07-05tdf#117901 Write signature line images as emf to ooxmlSamuel Mehrbrodt1-0/+33
Change-Id: Idbf60be3cef2d9dde454da0279d2810488b1e157 Reviewed-on: https://gerrit.libreoffice.org/56871 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-07-04Make ThreadPool::pushTask take param by std::unique_ptrNoel Grandin1-12/+12
And fix leak in XclExpRowBuffer::Finalize, was not freeing the synchronous task it creates Change-Id: Id1e9ddb5d968e6b95d9d2b5ca0c9e50774580182 Reviewed-on: https://gerrit.libreoffice.org/56874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-21merge GenericSolarMutex and SolarMutexNoel Grandin1-20/+11
Since nothing else is implementing the SolarMutex abstract class. Change-Id: I2a41254af3e9c7534033cdd0bece9dd8e0258b9d Reviewed-on: https://gerrit.libreoffice.org/56153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin1-1/+0
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke6-6/+1
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-01loplugin: look for CPPUNIT_ASSERT_EQUALS with params swappedNoel Grandin2-4/+4
idea originally from either tml or moggi, can't remember which Change-Id: Id78d75035036d3aa1666e33469c6eeb38f9e624d Reviewed-on: https://gerrit.libreoffice.org/55126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-31Introduce comphelper::Automation::AutomationInvokedZoneTor Lillqvist2-0/+37
Enables finding out anywhere whether the thread is processing a call from an Automation client. Not sure how I have managed without this until now. Presumably the Invocation_Impl::mbFromOLE variable in stoc can be replaced by a call of comphelper::Automation::AutomationInvokedZone:: isActive(). Change-Id: Ib79ec5f6dff17af25c8539d2907c7cd5d7b9a62c
2018-05-29loplugin:unusedfields-in-constructor in variousNoel Grandin1-2/+2
Change-Id: Ie0fb647938e3cf730976fb2e435b92bfd67ef645 Reviewed-on: https://gerrit.libreoffice.org/54998 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25Improve re-throwing of UNO exceptionsNoel Grandin3-4/+22
(*) if we are already throwing a Wrapped*Exception, get the exception using cppu::getCaughtexception. (*) when catching and then immediately throwing UNO exceptions, use cppu::getCaughtException to prevent exception slicing (*) if we are going to catch an exception and then immediately throw a RuntimeException, rather throw a WrappedTargetRuntimeException and preserve the original exception information. Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558 Reviewed-on: https://gerrit.libreoffice.org/54692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-22loplugin:unusedfields in avmedia..comphelperNoel Grandin1-4/+2
Change-Id: I74f125103b67c506d9bb67537e4c4cd3f8f871da Reviewed-on: https://gerrit.libreoffice.org/54641 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-18Refactor SfxObjectShell sign methodsSamuel Mehrbrodt1-0/+13
for signature line signing Change-Id: Iac4f3a248af53bdbf159e6e8d656e1dcbc3aacbf Reviewed-on: https://gerrit.libreoffice.org/54473 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-04-25turn off randomness when running under valgrindNoel Grandin1-0/+9
Change-Id: Ic9853c967cdc36b1bf919a4914b04bf6752f0834 Reviewed-on: https://gerrit.libreoffice.org/53374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-15cppcheck: variableScopeMuhammet Kara1-4/+2
Change-Id: Ia149b2b3f6f445e48cd469bb48a80f12b44648cd Reviewed-on: https://gerrit.libreoffice.org/52903 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr>
2018-04-15remove some unused comphelper includesJochen Nitschke2-1/+2
and fix the fallout Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359 Reviewed-on: https://gerrit.libreoffice.org/52894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-10loplugin:unusedmethodsNoel Grandin1-60/+0
Change-Id: I6f976ba8f792d2cee34859e9258798351eed8b1d Reviewed-on: https://gerrit.libreoffice.org/52636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07comphelper: use a lambda expression in NamedValueCollection::operator >>=()Chris Sherlock1-23/+6
Change-Id: Idf47f500be097c4af907c37f6ca8632cd91f3ba2 Reviewed-on: https://gerrit.libreoffice.org/52548 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07sw lok: View jumps to cursor position even if it is moved by an other view.Tamás Zolnai1-0/+12
Scrolling is done twice. Once in SwCursorShell::UpdateCursor() by SCROLLWIN flag. Here we can check the actual viewid and avoid scrolling if the cursor is move by an other user. The second instance in the LO online code, for it we need to pass the viewid identifying the view which moved the cursor. Change-Id: I033274f88ce41acbb632e2aeb0d986ab11cd2d52 Reviewed-on: https://gerrit.libreoffice.org/52220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-04-03accessibility: more simplifiation in OCommonAccessibleText.Arnaud Versini1-20/+17
Change-Id: If1284f2e50be08372dda08a8250263c9ec435923 Reviewed-on: https://gerrit.libreoffice.org/51825 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke4-4/+0
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-25accessibility: simplify OCommonAccessibleTextArnaud Versini1-33/+28
Change-Id: Ied5520179d15f0a854c16b14f5a5e6b84cef1300 Reviewed-on: https://gerrit.libreoffice.org/51514 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2018-03-08oox: preserve the ContentType of custom filesAshod Nakashian1-0/+32
Generic logic to preserve custom files with their correct ContentType. Standard default file extensions with respective ContentType preserved in [Content_Types].xml. Change-Id: I651ed691e9a4745cd2cb4b3c4d4c5fd7287b66c2 Reviewed-on: https://gerrit.libreoffice.org/50856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-03-08loplugin:constantparam in canvas..comphelperNoel Grandin1-2/+1
Change-Id: Ia666cb46c409852a13789389c032f0ce4377c0d5 Reviewed-on: https://gerrit.libreoffice.org/50927 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08loplugin:unusedmethodsNoel Grandin1-13/+0
Change-Id: Id6b4edd265cb6bef31c72e2a0a440211d51c7c33 Reviewed-on: https://gerrit.libreoffice.org/50900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05drop sax::tools::*base64 methodsNoel Grandin2-0/+107
and use the underlying comphelper methods rather. This is so that I can break the dependency that tools has on sax, and can add methods that make sax depend on tools. Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5 Reviewed-on: https://gerrit.libreoffice.org/50767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27Use for-range loops in comphelper and configmgrJulien Nabet9-55/+40
Change-Id: I91033395cb30a4ba9e65adb89712b3c70a39a508 Reviewed-on: https://gerrit.libreoffice.org/50396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-26Introduce DocPasswordHelper::GetOoxHashAsVector() with salt value vectorEike Rathke1-5/+15
In preparation to use this in AgileEngine. Change-Id: I45fb6ba24b759a72af0c7afa22eae75f1ae728ce