summaryrefslogtreecommitdiff
path: root/comphelper
AgeCommit message (Collapse)AuthorFilesLines
2018-02-14oox: cosmetic cleanupAshod Nakashian1-9/+9
Change-Id: Ifafd7338ddfec8b707b5ddf4acb39512faf186da Reviewed-on: https://gerrit.libreoffice.org/49325 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-30silence coverity#1428735 Use of untrusted scalar valueCaolán McNamara1-0/+1
Change-Id: I7e40f25ce506b1a26d683848a1bc83c16baf762f
2018-01-27lok: Allow whitelisting languages that should be used by LibreOfficeKit.Jan Holesovsky1-0/+48
LOK may get way too many languages if there are dictionaries for them installed which blows the pre-init to >2G easily; let's allow limiting that. Also make the preloading of languages work with the internal spell checking dictionaries and thesauri. Change-Id: I77119970030a7386a5cccbe4fdc89b15eab56ef1 Reviewed-on: https://gerrit.libreoffice.org/48720 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-25loplugin:unused-returns in basegfx..cppcanvasNoel Grandin3-36/+13
Change-Id: I32dc8c92871c8349651d2f4204a332d387e6e1b2 Reviewed-on: https://gerrit.libreoffice.org/48428 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23new loplugin: pointerboolNoel Grandin1-1/+1
look for possibly bogus implicit conversions to bool when passing (normally pointer) args to bool params. this plugin comes in the wake of a couple of bugs caused by refactoring, where some of the call sites were not currently updated. Of the changes, the following are real bugs: desktop/../dp_persmap.cxx StartInputFieldDlg in sw/../fldmgr.cxx which occurred as a result of commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e Date: Tue May 3 11:39:37 2016 +0200 tdf#99529 sw: don't pop up input field dialog before inserting field CSerializationURLEncoded::encode_and_append in forms/../serialization_urlencoded.cxx XclExpCFImpl::XclExpCFImpl in sc/../xecontent.cxx I have no idea how to properly fix this, just made a guess. SwDocTest::test64kPageDescs in sw/qa/core/uwriter.cxx which looks like a simple copy/paste error. Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441 Reviewed-on: https://gerrit.libreoffice.org/48291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23More loplugin:cstylecast on WindowsStephan Bergmann1-1/+1
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>
2018-01-19loplugin:unusedmethods also check for functions returning boolNoel Grandin1-3/+1
we were previously excluding them Change-Id: I48a68799b0de60b4995fae541eb363e043d4dd11 Reviewed-on: https://gerrit.libreoffice.org/48167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-17xmlsecurity: cleanup commentThorsten Behrens1-1/+0
Change-Id: I1e34e1c4c51411be3de2dbd417126d263713c88a
2018-01-15tdf#114488 Rank multiple images also for flat odfSamuel Mehrbrodt1-4/+4
Only the file extension was considered before which is not available in flat odf. Now both internal and external URLs are resolved to their respective mimetype. Change-Id: Id7e290cd9a441a1a6c2ce5e8d764391c50495bea Reviewed-on: https://gerrit.libreoffice.org/47824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-01-15More loplugin:cstylecast: comphelperStephan Bergmann1-1/+1
Change-Id: I64421e43afd7086a582fcfae0fd97b2afb6f8ef4
2018-01-15loplugin:useuniqueptr in comphelper,cppu,registryNoel Grandin2-8/+3
Change-Id: Ib353d901827e417498fe4f8e397f1a57c61a9736 Reviewed-on: https://gerrit.libreoffice.org/47794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-13tdf#114550 use 32 bit random session key for gpg encryptionThorsten Behrens1-2/+2
Otherwise we'd need to pointlessly spread it to 32 bit down the road for AES. Change-Id: I7303be71fd855aa454d07fcae04d7f42e3c9cd9c Reviewed-on: https://gerrit.libreoffice.org/47781 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-13gpg4libre: open encrypted files also via gpgThorsten Behrens1-0/+96
Adds code to sfx2 and package to try gpg4libre for extracting session keys, and use them in turn to decrypt odf storage. Change-Id: I1f626143e6c8443b4ad0c4fc5bdbd5ab8d56a451 Reviewed-on: https://gerrit.libreoffice.org/47780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-12tdf#114939 sfx2: notify user of non-interoperable passwordsMichael Stahl1-0/+2
For ODF 1.1 encryption, SHA1 is used as the start-key digest algorithm of PBKDF2. For the ODF export password-to-modify "feature", PBKDF2 is used without a start-key digest round, so the UTF-8 encoded password is directly the input. In both cases, if the user entered a password with a known problematic length, reject it and request a new one. Change-Id: Ie6510c1e668e1ed32be439ebe00354881b6ca83f
2018-01-12tdf#114939 package,comphelper: Try both real SHA1 and StarOffice SHA1Michael Stahl1-1/+12
... when importing ODF documents. In CreatePackageEncryptionData(), add a 3rd SHA1 password hash, PackageSHA1CorrectEncryptionKey, to EncryptionData. Use it in ZipPackageStream::getDataStream(), which has 3 fall-backs for SHA1 bugs now. Also add a CorrectSHA1DigestContext, to be used together with PackageSHA1CorrectEncryptionKey, and rename the existing one to StarOfficeSHA1DigestContext, to be used together with the existing 2 PackageSHA1{UTF8,MS1252}EncryptionKey. The fallback won't be used very often anyway: for the password SHA1 to be wrong, you need a password between 52 and 55 bytes long, and for the SHA1/1K checksum to be wrong, you need a file smaller than 1K with compressed size mod 64 between 52 and 55; all XML files have enough random "chaff" added to be too large. Test that we can read both correct SHA1 and StarOffice SHA1. Change-Id: I988fa489b5e40c7657f404f18538f637d54d28f1
2018-01-12More loplugin:cstylecast: comphelperStephan Bergmann22-93/+93
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I71a5092b344f206f2c7de606f2739d3b6e2cf0bb
2018-01-04loplugin:unusedfieldsNoel Grandin1-13/+0
fix the ReturnStmt check Change-Id: I95076076bd1313d23798c4615ea12910c86ed9a8 Reviewed-on: https://gerrit.libreoffice.org/47309 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-28Full UBSan in external/firebirdStephan Bergmann1-1/+0
...after 6a312a4a3d642f0f9769df54c0ec25471c9916bd "Prepare external/firebird for sanitizers". Doing `make check screenshot` on Linux with Clang -fsanitize=undefined -fsanitize=local-bounds -fsanitize=nullability works now. Patches that might be unwanted in non-UBSan builds are added to sanitizer.patch while unproblematic ones are added to always-included ubsan.patch. CppunitTest_dbaccess_firebird_test, e.g., shows that comphelper::AsyncEventNotifierAutoJoin::onTerminated called base-class osl::Thread::onTerminated (which does nothing, anyway) of an already destroyed object, so just drop that. Change-Id: If50f442ee6dbe590db843c38681d1c1cade8fa6a Reviewed-on: https://gerrit.libreoffice.org/47122 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-19lokdialog: Allow windows / dialogs in different languages.Jan Holesovsky1-2/+15
Change-Id: I9f32161981aed73e6d97696e5f976af276d1625a Reviewed-on: https://gerrit.libreoffice.org/46327 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/46775 Tested-by: Jenkins <ci@libreoffice.org>
2017-12-19inline use-once typedefsNoel Grandin2-4/+3
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-18loplugin:unusedindexMike Kaganski2-23/+18
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15lok: calc: LOK_FEATURE_RANGE_HEADERSMarco Cecchetti1-0/+12
For allowing the client to enable/disable the new range based header data Change-Id: I95da8ec3e48137fb75b9b22af3bb1296001ba9ca Reviewed-on: https://gerrit.libreoffice.org/46095 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 069cf9321be51e7203e336e0e87d8ba7dc9b729e) Reviewed-on: https://gerrit.libreoffice.org/46570 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-12-14No need to keep these whitelisted functions decorated with SAL_CALLStephan Bergmann1-6/+6
The only effect SAL_CALL effectively has on LO-internal code is to change non- static member functions from __thiscall to __cdecl in MSVC (where all other functions are __cdecl by default, anyway). (For 3rd-party code, it could be argued that SAL_CALL is useful on function declarations in the URE stable interface other than non-static member functions, too, in case 3rd-party code uses a compiler switch to change the default calling convention to something other than __cdecl. But loplugin:salcall exempts the URE stable interface, anyway.) One could argue that SAL_CALL, even if today it effectively only affects non- static member functions in MSVC, could be extended in the future to affect more functions on more platforms. However, the current code would already not support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c "loplugin:salcall fix functions" changed FrameControl_createInstance in UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even though its address (in ctl_component_getFacrory, in the same file) is passed to cppuhelper::createSingleFactory as an argument of type cppu::ComponentInstantiation, which is a pointer to SAL_CALL function. Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6 Reviewed-on: https://gerrit.libreoffice.org/46436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-12Move generateGUIDString to comphelperSamuel Mehrbrodt1-0/+14
and remove duplicate method Change-Id: Ic513a780f3b9b526c3abd0f273ad9c230ffbb373 Reviewed-on: https://gerrit.libreoffice.org/46233 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-12-11loplugin:salcall fix functionsNoel Grandin11-11/+11
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-10remove unused osl/time.h includes ..Jochen Nitschke3-13/+0
and some more in base64.cxx Change-Id: I31c9f23d3bd11f5482774e976a7c40025ffcfb86 Reviewed-on: https://gerrit.libreoffice.org/46157 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-08cppcheck: fix some reportsJulien Nabet2-7/+4
variableScope reports in comphelper/drawinglayer/editeng +filter/framework/l10ntools Change-Id: I4575428773e8b9b3efedabb44fdcd6d8175ac46a Reviewed-on: https://gerrit.libreoffice.org/46116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-08rtlRandomPool: remove pointless seeding with system timeThorsten Behrens2-7/+0
Change-Id: I88647a66a72d092303560a4348ce3dc55ee6c321 Reviewed-on: https://gerrit.libreoffice.org/46055 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-12-08gpg4libre: rename GPGME_HAVE_GPGME to HAVE_FEATURE_GPGMEThorsten Behrens1-2/+2
Change-Id: I6f085b67c3477f427bd1efd96db93cbb89e20647 Reviewed-on: https://gerrit.libreoffice.org/46050 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-12-07comphelper: fix windows buildThorsten Behrens1-1/+1
Change-Id: I3241426674050c027e1b000b33fb284525a58cbb
2017-12-07gpg4libre: permit multi-select encrypt certThorsten Behrens1-3/+10
And pass down all necessary parameters everywhere Change-Id: I152b9d84c0e35be9e5193a9a6f67de9fb86133b0
2017-12-07gpg4libre: [API CHANGE] add storage helper for GPG encryption dataThorsten Behrens2-14/+98
OpenPGP encryption needs to pass down slightly different meta data to package / zip storage. Change-Id: Idba9ad7a821cb33070cf5e5a0f79ae55db99b276
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin3-13/+13
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-30tdf#113696 Add mimetype to image elementSamuel Mehrbrodt1-0/+54
Otherwise browsers don't recognize base64 encoded svg files. Change-Id: I54d0b87c52a1ca9da1d820751ae32159b88ed28f Reviewed-on: https://gerrit.libreoffice.org/45528 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-11-28tdf#109202: Convert images to desired format in (f)odt filterKatarina Behrens2-0/+52
Pass down mimetype to SvXMLGraphicHelper Change-Id: I9c81c06d2a1d6168704440094081e99d0bcbbff9 Reviewed-on: https://gerrit.libreoffice.org/41893 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22Make loplugin:unnecessaryparen warn about (x) ? ... : ... after allStephan Bergmann1-1/+1
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-13Fix typosAndrea Gelmini2-2/+2
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-13Remove OAccessibleTextHelper::getCharacter and getTextRangeArnaud Versini1-28/+7
Change-Id: Ib32e3ca6ba55ab99820a54023041247cea96ab0c Reviewed-on: https://gerrit.libreoffice.org/44652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-13Remove OCommonAccessibleText::getText and getCharacterCount.Arnaud Versini1-22/+0
No need to create helper for those methods. Change-Id: I0505fe8141b1bad852b7f30aeb69628fb6a90071 Reviewed-on: https://gerrit.libreoffice.org/44649 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-10No need to blacklist this loplugin:unnecessaryoverrideStephan Bergmann1-7/+0
...a using declaration should fix it just fine Change-Id: I0279994c155775e9a58e93aef8da4522d4fd93fd Reviewed-on: https://gerrit.libreoffice.org/44590 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-09loplugin:finalclasses in comphelperNoel Grandin2-17/+2
convert ServiceInfoHelper to a namespace, since the only usage is to call it's static method Change-Id: I908bdbc06cbdb6b72ee1ae469ff207b2fca69963 Reviewed-on: https://gerrit.libreoffice.org/44533 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-09use rtl::Reference for SlaveDataNoel Grandin1-15/+14
Change-Id: I0cc0455a97be2e0cd84ccadba1f3745b584e1f33 Reviewed-on: https://gerrit.libreoffice.org/44461 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-04Make Windows error reporting more robustMike Kaganski1-1/+1
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-10-30clang-tidy modernize-use-equals-default in comphelperJochen Nitschke1-13/+0
Change-Id: I24a3ecd2ea9fe7e08c92b95aac57a58b922616b2 Reviewed-on: https://gerrit.libreoffice.org/44054 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-27fix memory leakCaolán McNamara1-0/+2
Change-Id: I6683ab0d39dbbb5c0ba0958d72f0a1bbfab47164 Reviewed-on: https://gerrit.libreoffice.org/43954 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25loplugin:constmethod in comphelper,ucbhelperNoel Grandin5-10/+10
Change-Id: I27a860fbbedd2174c60c199af18cae76e02abc25 Reviewed-on: https://gerrit.libreoffice.org/43759 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: comphelperStephan Bergmann11-31/+31
Change-Id: I9297bd0449633d1055125e7c2f2f6d215a22ae7d
2017-10-23overload std::hash for OUString and OStringNoel Grandin3-3/+3
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-05TSCP: include certificate usage in paragraph signaturesAshod Nakashian1-1/+1
Change-Id: I6f4b891a016c67051efd9033329065d7e3c8a06b Reviewed-on: https://gerrit.libreoffice.org/43022 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>