summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2019-02-11tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: Ib9ad5b874a210ef3862c668158fcc5d18eeab363 Reviewed-on: https://gerrit.libreoffice.org/67579 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-10loplugin:indentation in soltools..svlNoel Grandin
Change-Id: I270a12cdb68920b8fa23b82dd933724e30334485 Reviewed-on: https://gerrit.libreoffice.org/67565 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-05Move dubious file: -> smb: conversion from INetURLObject to file UCPStephan Bergmann
The Linux-only conversion of file URLs with a non-empty (other than "localhost") authority to smb URLs had been added in 2010 with 0b9ef81ba5ff08d85f21275222458a5b9b9e484c "tools-urlobj-smb-scheme-patch.diff: migrated" (applying a Go-oo patch?) but giving no rationale beyond "process relative SMB paths (in hyperlinks) correctly". That makes it hard to tell whether that patch is (still) actively useful for anything, or was just a misguided hack from the beginning: * Why make this Linux only? What about other non-Windows OSs? (On Windows, such URLs can be resolved as UNC pathnames.) If the reason for Linux-only was that it is the only OS where LO can handle smb URLs via GIO, why not make it conditional on ENABLE_GIO? * Why map to smb? There are various remote file access protocols. Hardcoding smb looks arbitrary here. Anyway, INetURLObject is arguably at a wrong level for such a patch. To not drop the hack wholesale, reimplement it in the file UCP, forwarding to a potential other UCP that can handle smb URLs any file://<host>/... URLs (rewritten as smb URLs) that the file UCP cannot handle itself. (file://localhost/... URLs will already have been normalized to file:///... by INetURLObject when they reach the file UCP, and even if they were not, the osl/file.hxx functionality underlying fileaccess::TaskManager::getUnqFromUrl knows how to handle them, so they will not take the forward-to-smb code branch.) (The corresponding #ifdef WIN code from 0b9ef81ba5ff08d85f21275222458a5b9b9e484c has already been removed with 82034b04e81b74a048595b0eac0f73581ecbc9e4 "tdf#119326 crash when adding "Windows Share" File resource".) (I came across that 2010 patch while looking into <https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support 'file://' scheme with actual hostname". A next step would be to make the file UCP actually handle any file://<host>/... URLs that denote the local host.) Change-Id: I77242705dc4c6c1e9cb3a4f32253224ac6cb13cb Reviewed-on: https://gerrit.libreoffice.org/67372 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-28Resolves: tdf#122991 do not truncate time duration [] format valuesEike Rathke
Regression from commit e2e47898180e547cad7ccde1e5890385d573e551 CommitDate: Fri Aug 31 12:50:52 2018 +0200 Use tools::Time::GetClock() in number formatter for wall clock time This partly reverts the change for the affected time duration [] formats, which truncated the value within the magnitude that due to the imprecision of floating point values lead to "false" precision of h:m:s.999999... This might again yield imprecise display values (old behaviour) for a difference of two wall clock times that now are not rounded up into the next magnitude for display. If so, a tools::Time::GetDuration() might be appropriate. Change-Id: If8fbcc2e4c2e0da04ca742a2837f57cd313d0367 Reviewed-on: https://gerrit.libreoffice.org/67005 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-01-28o3tl::make_unique -> std::make_unique in sax...svtools (except sc)Gabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I6eea0877eaa1886b64c0cce06a43b8088cbccd8e Reviewed-on: https://gerrit.libreoffice.org/66751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-21Avoid -Werror=format-{overflow,truncation}=Stephan Bergmann
...as emitted by at least GCC 8.2 with --enable-optimized, by making the buffers large enough for the (hypothetical) largest values of the various date/time components Change-Id: I82e9b08fa099546b2d6f29c702e1440df9e6c6e0 Reviewed-on: https://gerrit.libreoffice.org/66618 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Related: tdf#122509 prevent access of not existing base formatEike Rathke
Call to pFormat->HasPositiveBracketPlaceholder() with nullptr as obtained for the not existing nIndex was the immediate cause of the crash. Also obtain the type from the format if found instead of the separate GetType() call that again would need to find the format first. This clarifies that the other places accessing pFormat don't need additional checks because eType isn't UNDEFINED there. Change-Id: I5d78ad73eeb4c3820c45d6a91b0e729ed22951a4 Reviewed-on: https://gerrit.libreoffice.org/66476 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-01-14ofz#12507 micro optCaolán McNamara
Change-Id: I7cdb2e371cb3e209b71659174594bf5bb687f379 Reviewed-on: https://gerrit.libreoffice.org/66284 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-03Avoid getTokenCountMatteo Casalin
Change-Id: I66d6e8d91924b2dcca9ab8ab499fb94bfb1dc723 Reviewed-on: https://gerrit.libreoffice.org/65658 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2018-12-14tdf#120750: Revert "tdf#96248 delete SfxPoolItems with Which Id >= 4000"Xisco Fauli
This reverts commit c9493b344a9bd104d0a882f5e9407880c0c63c20. According to https://bugs.documentfoundation.org/show_bug.cgi?id=96248#c15 the asert was gone even before the patch... Anyway, better to have an assert than a crash Change-Id: I84389bf2e8e604f6967923c0eedaae3aec3455e6 Reviewed-on: https://gerrit.libreoffice.org/65115 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2018-12-10simplify some copy constructionNoel Grandin
Change-Id: Icc20ae913052a7ae96c0722a458d75bbb5eef1cd Reviewed-on: https://gerrit.libreoffice.org/64862 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...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-12-07remove unused ConfigItemMode::DelayedUpdateNoel Grandin
unused ever since commit c1758889cbd5e8e4afb1044425c908715eb3e1cd Date: Fri Nov 11 22:48:37 2011 +0100 Heavily simplified utl::ConfigManager. and rename ConfigItemMode::ImmediateUpdate to NONE, since it doesn't mean that anymore Change-Id: Ia1d06142a25c9eea0f1d30b70653eed325a21b37 Reviewed-on: https://gerrit.libreoffice.org/64719 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-07Revert "Blind fix for pre-C++14 std::equal, for now"Stephan Bergmann
This reverts commit 75299cd119dcb3121540471354d2b33af7f6684d, now that we have full C++17 support. Change-Id: I6616a724394d6f9f6c386f7aa48ee386433bec50 Reviewed-on: https://gerrit.libreoffice.org/63990 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-06Drop juh.jar dependency from Java UNO testsJan-Marek Glogowski
Since upstream Java reverted the strict classpath checks, it's not needed anymore. See discussion in https://gerrit.libreoffice.org/#/c/63118 and http://hg.openjdk.java.net/jdk-updates/jdk11u/rev/8513ac27b651 Change-Id: Iff863702b1aeda157c8e230ab36372a71dcfb4bb Todo: tdf#121925 Reviewed-on: https://gerrit.libreoffice.org/64634 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-12-05loplugin:singlevalfields in svlNoel Grandin
Change-Id: I26d11f60f486f3cfe4615828a410789f8e22af48 Reviewed-on: https://gerrit.libreoffice.org/64602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05remove unused SvLockBytesStatFlag enumNoel Grandin
Change-Id: I90b82f1bbf4b51fc76cde10ec55448053345018c Reviewed-on: https://gerrit.libreoffice.org/64561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-26inline FindPositionsByName in a couple of placesNoel Grandin
it is no more complex, and it saves us the construction of an intermediate vector Change-Id: Ie92c2970c5b10805d7bcfc0cc2a74378f2cbda08 Reviewed-on: https://gerrit.libreoffice.org/64039 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-26add dumpAsXml methods to more pool itemsMarkus Mohrhard
Change-Id: Ia33ac2dfa23bdc4e2990e6d028d1bae7fedfe4f5 Reviewed-on: https://gerrit.libreoffice.org/63853 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-11-25seems we need to include algorithm hereNoel Grandin
commit 260002b16f18634a7e1d10d4160378beb0cc0c5f Simplify containers iterations in svgio, svl, svtoolsHEADmaster Change-Id: Ie97dd4276753e5b1b3a4382cf0060132caf6bd1b Reviewed-on: https://gerrit.libreoffice.org/63980 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-25Blind fix for pre-C++14 std::equal, for nowStephan Bergmann
...which plagues some builders that haven't been updated to full C++17 support yet, let <https://ci.libreoffice.org/job/lo_tb_master_linux/31969/> Change-Id: I93ea997b9f7a85b370681103f64c791b2f28e4f2
2018-11-25Simplify containers iterations in svgio, svl, svtoolsArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I98a3e55a14c8ac00188c5003f84194c2cc6795fb Reviewed-on: https://gerrit.libreoffice.org/63959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22improve function-local statics in scripting..svtoolsNoel Grandin
Change-Id: Idf3785a1fbc6fc5b8efbdc4cd363047709f3af91 Reviewed-on: https://gerrit.libreoffice.org/63782 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21tdf#42949 Fix IWYU warnings in include/vcl/[B-E]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iabe571aa8f00492902c499094bea8365a3e17fca Reviewed-on: https://gerrit.libreoffice.org/63623 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-19Fix typosAndrea Gelmini
Change-Id: I0c966f517e337caa340526b48fa62b9910ce0a3e Reviewed-on: https://gerrit.libreoffice.org/63504 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-16loplugin:buriedassign in sd..writerfilterNoel Grandin
Change-Id: I954c12d9e1c493be6ac8c7b15076077b5bff5b74 Reviewed-on: https://gerrit.libreoffice.org/62811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-14tdf#42949 Fix IWYU warnings in include/svl/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ide75232858599c275e023c2300201090acd22307 Reviewed-on: https://gerrit.libreoffice.org/63237 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-09Fix many Java subsequentcheck test by using JUHJan-Marek Glogowski
Splits gb_JunitTest_set_unoapi_test_class_and_jars into two separate defines as: - gb_JunitTest_use_unoapi_jars - gb_JunitTest_use_unoapi_test_class Then replaces many of the gb_JunitTest_use_jars lists with the new gb_JunitTest_use_unoapi_jars to fix the JUH dependencies. This probably adds some unneeded JUH dependencies to some Java tests, but that shouldn't be a problem. Change-Id: I0c4fce6b50f7c6eb8d62bfb2c50f056b97584794 Reviewed-on: https://gerrit.libreoffice.org/63119 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-11-07loplugin:collapseif in sdext..svxNoel Grandin
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f Reviewed-on: https://gerrit.libreoffice.org/62985 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-05replace double-checked locking patterns with thread safe local staticsMike Kaganski
Change-Id: I4ed97cc6d9f733292156d71551d5ce3af6071445 Reviewed-on: https://gerrit.libreoffice.org/62858 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-04replace double-checked locking patterns with thread safe local staticsMike Kaganski
Change-Id: I1bf67196e97411aeecc13ed4f91d1088a315e323 Reviewed-on: https://gerrit.libreoffice.org/62839 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-03tdf#120703 PVS: V547 Expression is always falseMike Kaganski
Let FSStorage::GetContent() return reference. Change-Id: I6595f48d56f7eb9256600eb6ee1a569077fef92f Reviewed-on: https://gerrit.libreoffice.org/62823 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-01clang-tidy: (WIP) bugprone-too-small-loop-variable findingsTamás Zolnai
Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561 Reviewed-on: https://gerrit.libreoffice.org/62701 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-11-01use unique_ptr in markForDeletionNoel Grandin
Change-Id: I10e5ad02243c7045d51191c735163ee4a027126e Reviewed-on: https://gerrit.libreoffice.org/62695 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-01rename RemoveX->Remove in SfxUndoArrayNoel Grandin
accidentally left it this way when doing commit 19e715973e15f9e7cf6e8237643dbbc14f8eb87a Date: Mon Oct 29 16:15:27 2018 +0200 loplugin:useuniqueptr in MarkedUndoAction Change-Id: I250676df7af27f485c5d34281ef0da1e127eb24c Reviewed-on: https://gerrit.libreoffice.org/62694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-31loplugin:useuniqueptr in SfxItemPoolCache::ApplyToNoel Grandin
Change-Id: Ica6ffb5bbaad5c941c65cae02bba7ea2380646f3 Reviewed-on: https://gerrit.libreoffice.org/62652 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-30loplugin:useuniqueptr in MarkedUndoActionNoel Grandin
Change-Id: Ic06b990112df5bc135cfd7af6f1129580f294428 Reviewed-on: https://gerrit.libreoffice.org/62509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-26tdf#42949 Fix IWYU warnings in include/unotools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444c43b9d549977039f25bec2b5bf666c3e15e0e Reviewed-on: https://gerrit.libreoffice.org/62041 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-26use unique_ptr when Clone()'ing PoolItemsNoel Grandin
and fix a handful of small leaks in the process Change-Id: I876e12ff5305f9dda84532d4182fb91657d6fa0c Reviewed-on: https://gerrit.libreoffice.org/62389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-25return std::unique_ptr from CloneSetWhichNoel Grandin
Change-Id: I709122cb8cd7c257e7eb2bd564c529689e6d555a Reviewed-on: https://gerrit.libreoffice.org/62350 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
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-22sc: avoid checking for time formats in case of SvNumFormatType::NUMBERSerge Krot
Change-Id: I565506d58f2dd94a6c2c5e1c4a2000ce1f9752cf Reviewed-on: https://gerrit.libreoffice.org/61445 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-10-22pvs-studio: V794 The assignment operator should be protectedCaolán McNamara
Change-Id: Ia443a0e61a091d877c8da26bf7d45bf4261f8669 Reviewed-on: https://gerrit.libreoffice.org/62166 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-22loplugin:singlevalfields look for fields that can be boolNoel Grandin
Change-Id: Ief773b661a8378a10db56943b32127c7a2c86d11 Reviewed-on: https://gerrit.libreoffice.org/62037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22loplugin:staticvar in soltools..svxNoel Grandin
Change-Id: Ie9f36eb0e00aaee34a27f136ed903f8f87e52dcc Reviewed-on: https://gerrit.libreoffice.org/61916 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-21tdf#120703 (PVS): redundant nullptr check; loop index sizeMike Kaganski
V668 There is no sense in testing the 's' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. V1029 Numeric Truncation Error. Result of the 'size' function is written to the 16-bit variable. Change-Id: I8e0598e892ca160ac074bccfed87c14367a3b46a Reviewed-on: https://gerrit.libreoffice.org/62139 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-20result of DdeQueryStringW unusedCaolán McNamara
since commit 88e3b846b8a4bd4ce5507d1bc5441ee4167e5326 Date: Wed Apr 6 11:28:44 2016 +0200 remove some dead bits of DDE Change-Id: I66b2f8365e3fed15391ff0fe2eb3c874b5054e91 Reviewed-on: https://gerrit.libreoffice.org/62070 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>