summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)Author
2022-03-24loplugin:constantparamNoel Grandin
Change-Id: I86592be0717c062a918108bf4437074b0f70b372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-18tdf#133603 cache languagetag in FontSubstConfigurationNoel Grandin
speeds up saving XLSX by 10% Change-Id: I5f48fcd3de44675d27e275c6ff2f4e51a067c750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131727 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-25renames in template manager creates xml file in wrong locationNoel Grandin
revert part of commit dd42f133f604ee2f7e0ffbca6a8d94fb8f95dfe5 Author: Noel Grandin <noelgrandin@gmail.com> Date: Mon Jan 10 19:37:05 2022 +0200 tdf#146375 Cannot rename user-defined categories in template manager specifically, revert the > Simplify the UCB usage to just write the contents of the tempfile and also call SvStream::Flush() in utl::TempFile::GetURL(), so that the data actually hits the disk, so that when UCB attempts to read the data using a separate file handle, it sees the data. (Otherwise the temporary file data only exists in the operating system buffers, and can only be read by the same file handle that created it) Change-Id: I17798c53e49d65484605f2dcd96b45babd70054d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-06Avoid signed-integer-overflowStephan Bergmann
...as seen during e.g. UITest_calc_tests9 now, > unotools/source/i18n/localedatawrapper.cxx:1017:17: runtime error: signed integer overflow: -9223372036854775808 * -1 cannot be represented in type 'long' > #0 in LocaleDataWrapper::ImplAddFormatNum(rtl::OUStringBuffer&, long, unsigned short, bool, bool) const at unotools/source/i18n/localedatawrapper.cxx:1017:17 > #1 in LocaleDataWrapper::getNum(long, unsigned short, bool, bool) const at unotools/source/i18n/localedatawrapper.cxx:1217:5 > #2 in weld::MetricSpinButton::format_number(long) const at vcl/source/window/builder.cxx:306:32 > #3 in weld::MetricSpinButton::update_width_chars() at vcl/source/window/builder.cxx:259:61 > #4 in weld::MetricSpinButton::set_range(long, long, FieldUnit) at include/vcl/weld.hxx:1991:9 > #5 in weld::MetricSpinButton::set_min(long, FieldUnit) at include/vcl/weld.hxx:2005:9 Change-Id: I940e2f1e2e4d42db84d4bb0e7b68086204dc77ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129570 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-20WASM --enable-wasm-strip now skips lots of LO codeArmin Le Grand (Allotropia)
... resulting in a stripped-down, Writer-only build to decrease the resulting WASM bytecode size. It removes the following code from the build: * All other major modules: Base, Calc, Chart, Draw, Impress and Math and related writerperfect filters * The premultiply tables * The (auto-)recovery functionality * All accessibility (but not the accessibility document checker) * The LanguageGuess component * EPUB support * The start center / BackingWindow * The TipOfTheDay functionality * The splash screen communication Currently crashs with anything different then soffice --writer. Closing the document also still crashes. FYI: many of these features are now behind ENABLE_WASM_STRIP_* defines, but they normally don't work on their own, globally! That's because we started with stripping the main components. Change-Id: Ib9c0f9452815910c0a2aceaf142ba1ad4a9cb0d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126182 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-11tdf#146375 Cannot rename user-defined categories in template managerNoel Grandin
Regression from commit 3624a703361b108d22448bd60a97733f05e37820 tdf#135316 remove OTempFileService pessimisation So fix two things here (1) make it so the tempfile service flushes the SvStream buffer and resets the file position, so we can read the data after writing it. (2) Simplify the UCB usage to just write the contents of the tempfile via the tempfile InputStream, which is simpler and safer Change-Id: I15ed3b02c2d6415d10a9579f66374e6268188d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128195 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-10use less SvStream::Flush()Noel Grandin
Flush() turns into a sync() on the device, which is pretty slow. Most of the time all we actually want to do is to flush the internal buffers from the SvStream. So expose the FlushBuffer method and use that where possible. And also means we don't need the mbDontFlushOnClose flag on SvStream any more. Change-Id: Ibe089b88b325f0fdc565200a97ce72cd26b7fcfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25osl::Mutex->std::mutex in SvtPathOptionsNoel Grandin
Change-Id: Ibf0aef2116e6ee7ab1cdc0de2b2bb502a8ce05e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127417 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25osl::Mutex->std::mutex in OTempFileServiceNoel Grandin
Change-Id: If841031faf5b214a1978422b93b59cfa32fcd299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtModuleOptionsNoel Grandin
Change-Id: I6882b30c823d06aa04c04c8a17bfe33cc45d7307 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtCommandOptionsNoel Grandin
Change-Id: I80eaba645351e2f3a3c67586fdced3325608633e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtPathOptions_ImplNoel Grandin
Change-Id: I04d0bf2a6b00ab0da24735158ad267632356128f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127416 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtUserOptionsNoel Grandin
Change-Id: Ib16cc05a8d9c3e7ef828223e8b1067eeb7faf809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127399 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24rename some methods on UcbLockBytesNoel Grandin
The Impl suffix means internal methods, but these are part of the public API of the class Change-Id: I9c969f3464e0ae78d52f997643f7fb8489b7bd61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127401 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-30remove unnecessary virtual inheritanceLuboš Luňák
SvLockBytes is only inherited by UcbLockBytes, and that one is not inherited by anything, so there's no diamond inheritance, so there's no point. Probably a case of somebody not really understanding virtual inheritance and using it "just in case". Change-Id: I2c01f29634c4f1ff2b55d7552fc571b653878ace Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126074 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-19rtl::Static->thread-safe static in unotoolsNoel Grandin
Change-Id: I2a8c9ca7c45a8e20f3d114722a0677b856a13d8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125495 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-10new loplugin:stringliteraldefineNoel Grandin
look for #define FOO "foo" that can be converted into OUStringLiteral. This is the first pass of this plugin, only doing those #define which are local to a single compilation unit. Change-Id: Ic8610e29ec42c36d03db5014a93c244315d5bbea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124962 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin
Change-Id: I0567d103db8db401c737fed98483912a39352929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-05The std::auto_ptr workarounds should only be necessary for Boost < 1.67.0Stephan Bergmann
...see the commit message of f8b10b76bc3000eab3269de4472d6c28bd308059 "The std::auto_ptr workarounds should no longer be necessary" for details. (The removed settings in 52a26b146542526dc4f6bb193ffb4fd95e4f79fd "fix unotools/source/i18n/resmgr.cxx build with PCH on Mac" might still theoretically be necessary for macOS and Windows builds against the baseline Boost 1.66.0, but it is unlikely that anybody does such builds against anything other than our Boost 1.76.0 exteranl/boost, anyway.) Change-Id: I7a5cdc72e76c695b220353b02368623383dcd8a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-04fix potential out-of-bounds access in LocaleDataWrapperNoel Grandin
after commit 86b345a963a64fd9b9a3cab522b3ac2e909977fd Date: Sat May 1 08:30:46 2021 +0200 tdf#79049 speed up OOXML workbook load (4) if the number of reserved words returned by the locale is not correct. Change-Id: I1c709060a5f4e24c4278f3c36310364d10545f14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-01Prepare for removal of non-const operator[] from Sequence in unotoolsMike Kaganski
Change-Id: I720d1c1e4a8d32e8a7c7ac62ab9cf988bac31d01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-21loplugin:flattenNoel Grandin
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-19Use MsLangId::getConfiguredSystemUILanguage()Eike Rathke
Change-Id: Ia9344c44a71be656a731ab8735dd8e959e520592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123789 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-19Use MsLangId::getConfiguredSystemLanguage()Eike Rathke
Change-Id: I298f762ac7f3298aa9cb9621ad1f8cae50527b24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123790 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-11loplugin:moveparam in unotoolsNoel Grandin
Change-Id: Idd014c93e2e85d2ffc7a2535a9c65cffc8a9d403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123348 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-22Extend loplugin:stringviewparam to starts/endsWith: unotoolsStephan Bergmann
Change-Id: Ie8c73d187045d9def8f462ab7d37830331eabd4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122470 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-21reduce cost of some getProperty calls (tdf#125892)Noel Grandin
use OUStringLiteral to avoid cost of repeated OUString construction from ascii literal Change-Id: I4f8a4714c093e890adaa5524172bdc91231a561a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122379 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17need optional headerCaolán McNamara
Change-Id: Ic6515a32c2bf2ed7d287c003df154727644598b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122239 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-17speedup toUpperCase when called in parallelNoel Grandin
by removing locking from CharClass, which means we need to make it an immutable class Since SharedStringPool in sc/ stores a pointer to the CharClass in use, we have to tweak SvtSysLocale so that the object does not change location. Change-Id: I2c62d354fa542ebc04e755ce5b9b9e2ddff76a64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122185 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17remove GetCharClassPtr from SvtSysLocaleNoel Grandin
we already have GetCharClass and we never return a nullptr Change-Id: I3cb79bc60be614c0474ecfdaad17991f2ecb6368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-12ofz: better workaround for broken msan buildCaolán McNamara
workaround https://github.com/google/oss-fuzz/issues/6427 by forcing use of the libc++.a in /usr/msan/lib when compiling the msan version Change-Id: I4e992cd7710b5929e74034db7a49c590349149fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122014 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-12ofz: workaround moreCaolán McNamara
Change-Id: Ic7988757a5adc76335911f89d5de1e5a64ce7056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122001 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-12ofz: workaround memory sanitizer failure by skipping boost::localeCaolán McNamara
which seems to have started since... https://github.com/google/oss-fuzz/commit/a2be91d3f10c54f20ae651375683ae4605543a63 e.g. ==3509==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xa990506 in ~basic_string /usr/local/bin/../include/c++/v1/string:2267:9 #1 0xa990506 in ~pair /usr/local/bin/../include/c++/v1/__utility/pair.h:39:29 #2 0xa990506 in std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::shared_ptr<boost::locale::localization_backend> > >::destroy(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::shared_ptr<boost::locale::localization_backend> >*) /usr/local/bin/../include/c++/v1/__memory/allocator.h:156:15 #3 0xa9899a5 in destroy<std::__1::pair<std::__1::string, boost::shared_ptr<boost::locale::localization_backend> >, void> /usr/local/bin/../include/c++/v1/__memory/allocator_traits.h:309:13 #4 0xa9899a5 in __destruct_at_end /usr/local/bin/../include/c++/v1/vector:450:9 #5 0xa9899a5 in clear /usr/local/bin/../include/c++/v1/vector:374:29 #6 0xa9899a5 in ~__vector_base /usr/local/bin/../include/c++/v1/vector:487:9 #7 0xa9899a5 in ~vector /usr/local/bin/../include/c++/v1/vector:579:5 #8 0xa9899a5 in ~impl workdir/UnpackedTarball/boost/libs/locale/src/shared/localization_backend.cpp:34:45 #9 0xa9899a5 in ~hold_ptr workdir/UnpackedTarball/boost/boost/locale/hold_ptr.hpp:36:13 #10 0xa9899a5 in boost::locale::localization_backend_manager::~localization_backend_manager() workdir/UnpackedTarball/boost/libs/locale/src/shared/localization_backend.cpp:168:9 #11 0x579edc in init workdir/UnpackedTarball/boost/libs/locale/src/shared/localization_backend.cpp:263:17 #12 0x579edc in __cxx_global_var_init workdir/UnpackedTarball/boost/libs/locale/src/shared/localization_backend.cpp:264:15 #13 0x579edc in _GLOBAL__sub_I_localization_backend.cpp workdir/UnpackedTarball/boost/libs/locale/src/shared/localization_backend.cpp #14 0xbe861ac in __libc_csu_init (/tmp/not-out/psdfuzzer+0xbe861ac) #15 0x7f1bcadc003f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2703f) #16 0x57c40d in _start (/tmp/not-out/psdfuzzer+0x57c40d) Change-Id: I14010df7c009b4c44943b0fd56688ed05569c1b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121999 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-06clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I8590d67f064dd74da42c0e3bf543f2aadbd2b893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-01Simplify utl::removeTreeMike Kaganski
Implement it using comphelper::DirectoryHelper::deleteDirRecursively Change-Id: I89d4e7c71b7556cb23d43fffa9b1e12df5ef8c3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121452 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-01Simplify dtor logicMike Kaganski
Change-Id: I45395f2370474487dc11a0f634c581b30bdc9a61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121427 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-18ofz#36713 Indirect-leakCaolán McNamara
Change-Id: I665d7eb66f04fd78b6345f22d5f5724e5778a211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120653 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-18loplugin:passstuffbyrefNoel Grandin
Change-Id: I4f01eb3842ef198f02af274f54afb2760c820a4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120655 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13Help older linkers (Ubuntu 18.04, Fedora 31)Jan-Marek Glogowski
Fixes a regression from commit 429e6e6efbfbc65d36452cbf8b3a25740a1dc8bc ("osl::Mutex->std::mutex in OInputStreamHelper"), which results in failed linking with some older toolchains: /usr/bin/ld.gold: error: workdir/CxxObject/xmlsecurity/source/helper/UriBindingHelper.o: requires dynamic R_X86_64_PC32 reloc against '_ZThn40_N3utl18OInputStreamHelper7acquireEv' which may overflow at runtime; recompile with -fPIC include/com/sun/star/uno/Reference.hxx:240: error: undefined reference to 'non-virtual thunk to utl::OInputStreamHelper::acquire()' collect2: error: ld returned 1 exit status xmlsecurity/Library_xmlsecurity.mk:10: recipe for target 'symbols/instdir/program/libxmlsecurity.so' failed Known problematic setups are my Ubuntu 18.04 build schroot and Caolán's Fedora 31 VM to run Coverity. Change-Id: I40f0734a0cb9131193abf21ba95dc63816b5c1d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120426 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03Consolidate on C++17 std::scoped_lock instead of std::lock_guardNoel Grandin
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-03Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: I2a24a123a64b762fd0741c45eaca3ad4bdd5580d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02convert #defines to OUStringLiteralNoel Grandin
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31osl::Mutex->std::mutex in OInputStreamWrapperNoel Grandin
Change-Id: I59dbb1d5d3aea9b94959d26e544eddfb600e9fa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31osl::Mutex->std::mutex in OInputStreamHelperNoel Grandin
Change-Id: Ia6aa6541474e0e4c190ab805a931d74c8a598baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-31osl::Mutex->std::mutex in ItemHolder1Noel Grandin
Change-Id: I778450e986ec93f020ef594fe79bc65673ae78be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119714 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>