summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2021-09-17create OnDemandCharClass cacheNoel Grandin
and use it in SvNumberFormatter for situations where we are rapidly switching locales (e.g. spreadsheet with alternating locales on adjacent rows) Change-Id: Ic35fdbbfbdc960673e91a37efed1d0e12c1a0751 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17no need to allocate CharClass separately in SvNumberFormatterNoel Grandin
Change-Id: I79b815567c59702c2d3fe7944bb2f16bacf0e472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122252 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-15loplugin:finalclassesNoel Grandin
Change-Id: I88831f290e1923db6fb5a733746bfa3bc7fbc7e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122148 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-13Check string boundsEike Rathke
Doesn't occur in practice because all date acceptance patterns start with a YMD character, enforced by the dialog, but just in case.. Change-Id: I8ed43a272e9501c6977888b1f587ed14c85024ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122025 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-09-13Resolves: tdf#116184 Check that there is no trailing number behind a matchEike Rathke
... without being separated by a blank so the match is rejected if it doesn't possibly form a date+time input and input can be accepted as decimal fraction. Change-Id: Iabd1d216366ecb8454c59822ce58f112bfa6091e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122024 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-09-09workaround -Wshadow in libcuckooNoel Grandin
that triggers with gcc (Ubuntu 10.3.0-1ubuntu1~20.10) 10.3.0 Change-Id: I038e229890fcc3c8bb7986a747434e9e033b4f5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121838 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-09tdf#130795 use concurrent hashmap in SharedStringPoolNoel Grandin
we are loading a spreadsheet in parallel here, but the parallel threads achievei very little actual concurrency because of heavy contention in the SharedStringPool mutex. So switch to a concurrent hash map. I looked at a couple of different ones (including the Folly one), and this was the one with the simplest resulting code. This takes my load time from 12.5s to 8s Change-Id: I04d6d8e11d613b510eb3bc981f3338819b7ac813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-03clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I6a2a36c28fafac7002fbe093b22ad186562ea5c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-01Resolves: tdf#144209 Handle General containing formats in RoundValueAsShown()Eike Rathke
Calling SvNumberformat::GetThousandDivisorPrecision() for a "AA "General format resulted in 3000 as that was implemented for tdf#106253 without taking into account that ImpSvNumberformatInfo::nThousand may be abused under some conditions, which here is having FLAG_STANDARD_IN_FORMAT = 1000 as nThousand, multiplied by 3 gives 3000. Subtracted from the 0 precision gave -3000 decimals for which of course the new rounding produced 0 where it previously simply ignored the decimals and returned the original value. Change-Id: I66afaf1e2d8b2654d9f7cc8cfb66389357fb742d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121447 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-08-24osl::Mutex->std::mutex in OFSStreamContainerNoel Grandin
Change-Id: I1402b66935c0229977357d0a6ec8ed0bc777de3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-24osl::Mutex->std::mutex in OFSInputStreamContainerNoel Grandin
Change-Id: Icd6ec9e6cd47fd0396cb70d6c63c435d7370b6fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-23loplugin:referencecasting look through more clang TypesNoel Grandin
Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-20New loplugin:unusedcapturedefaultStephan Bergmann
In sc/qa/unit/ucalc_formula.cxx, dropping the capture-default from the lExpectedinF lambda revealed that MSVC in C++17 mode (i.e., when building without --with-latest-c++) requires ROW_RANGE (a local const int variable from the enclosing TestFormula::testTdf97369) to be captured, even though all uses of that variable within the lambda body are constant expressions. That is still true at least for the latest Visual Studio 2019 version 16.11.1. (This is not an issue for the lExpectedinH and lExpectedinI lambdas a few lines further down, as they, in addition to using that ROW_RANGE, also use the local const double variables SHIFT1 and SHIFT2, whose uses are not constant expressions, so they are implicitly captured and loplugin:unusedcapturedefault does not suggest dropping those lambdas' capture-defaults in the first place.) Change-Id: Iee7efb485187cbe8eba6a2d470afca4993eb1816 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120693 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-20msan: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
nCheckPos is always set to something, but for nCheckPos != 0 nType might be left uninitialized, so test nCheckPos == 0 before nType seen in ooo76602-1.slk and ooo10703-1.html with distro-configs/LibreOfficeOssFuzz.conf ==623515==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x59600b4 in SvNumberFormatter::PutandConvertEntry(rtl::OUString&, int&, SvNumFormatType&, unsigned int&, o3tl::strong_int<unsigned short, LanguageTypeTag>, o3tl::strong_int<unsigned short, LanguageTypeTag>, bool, bool) svl/source/numbers/zforlist.cxx:658:72 #1 0x8c7f72 in ScImportExport::Sylk2Doc(SvStream&) sc/source/ui/docshell/impex.cxx:2130:48 #2 0x8bcb26 in ScImportExport::ImportStream(SvStream&, rtl::OUString const&, SotClipboardFormatId) sc/source/ui/docshell/impex.cxx:392:13 #3 0x650f4b in TestImportSLK sc/source/ui/docshell/docsh.cxx:3360:19 #4 0x6055a7 in LLVMFuzzerTestOneInput vcl/workben/slkfuzzer.cxx:87:11 #5 0x555b53 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/out/slkfuzzer+0x555b53) #6 0x541622 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6 #7 0x54722e in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/out/slkfuzzer+0x54722e) #8 0x56fa82 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 #9 0x7fbd8b65ebf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6) #10 0x51cc49 in _start (/out/slkfuzzer+0x51cc49) Uninitialized value was created by an allocation of 'nType' in the stack frame of function '_ZN14ScImportExport8Sylk2DocER8SvStream' #0 0x8c27c0 in ScImportExport::Sylk2Doc(SvStream&) sc/source/ui/docshell/impex.cxx:1837 Change-Id: I0422ca34827319d1e35d453606a7afe6a9de3840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120762 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-16Rename setX/setY to SetPosX/SetPosY, to align with SetPosMike Kaganski
Change-Id: I856194f26fefad993f416d7b92b57a9417a3c0a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120546 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-16Drop tools::Rectangle::getX/getY, which are just duplicates of Left/TopMike Kaganski
The change allowed to simplify many places where previously this API was used, to avoid inefficient calculations (e.g., moving rectangle keeping its size, and then immediately changing the size). Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-11Drop convertMm100ToTwip in favor of the new o3tl::toTwipsMike Kaganski
Step by step, duplicates from <tools/UnitConversion.hxx> may go Change-Id: Id4c03ff8adc120ae06dbfdbdfb4f5ff0bb51f489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120315 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-09tdf#143664: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: If62da781bffc2480fd81dd6aaf28db69b46a0e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120198 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-08Year without leading 0 if era code is also usedEike Rathke
YYYY GG or GG YYYY shall display 1 BC not 0001 BC, or AD 1 not AD 0001 Change-Id: I1955f55d37a4af5075c9cfc20c3ea200ba340765 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120174 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
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-03Resolves: tdf#143664 {de-*} accept "Mär" and "Mrz" for MarchEike Rathke
Change-Id: I82c094687137995a634450cb4f617909859d1688 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119916 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-08-02flatten SfxUndoManager_Data a littleNoel Grandin
no need to allocate the SfxUndoArray separately Change-Id: I5866ee1382d0be22b71a7322fe4379d3e159f488 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119894 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 ItemHolder2Noel Grandin
Change-Id: I6e21d6b8b582d4793f64b04183edcfcb3b178f1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119722 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29loplugin:unnecessarymethodsNoel Grandin
Change-Id: I1d7a9c2ca91816c9e550cd673e04599f5efcf5ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119668 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29rtl::Static -> static localNoel Grandin
Change-Id: Ib8d9a24659a37e6b94237d98f030cd2be00bcb39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119665 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-28use officecfg for SvtCJKOptionsNoel Grandin
and remove some unused options Change-Id: I487a233de4f7414012e5405f2c2e1f9c8b8fb4f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-27drop SvtLanguageOptions classNoel Grandin
since it is just a wrapper over SvtCJKOptions and SvtCTLOptions. Later I will replace those two with the equivalent officecfg calls Change-Id: I61c5667a05f75d42643175f2c28c29d7a590b15c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-26use officecfg for SvtSystemLanguageOptionsNoel Grandin
Change-Id: Icf5cf974e4235d9a961e08bfc5689ec58930236e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119515 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-23expand out contractions in PasswordContainerNoel Grandin
Change-Id: I884356fe9f0081b13dfd47c1ecbd581adf25ebd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-23no need to allocate the StorageItem separatelyNoel Grandin
Change-Id: I941404fcc2ded3568afe4818c4851a1bd72e30b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119386 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-23osl::Mutex->std::mutex in SvtLanguageOptionsNoel Grandin
Change-Id: I5b24c729f63f2f51b2a2bebc8539e8c61cf77bee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-21remove obsolete commentsNoel Grandin
Change-Id: Ie2ceb7abb9bef5e84e740fba32f30697144f1c3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119303 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20flatten the vector in NfCurrencyTableNoel Grandin
Change-Id: I4a024e2d8c9743374e58836f95aa1fcbdc406b5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20Simplify SfxItemSet ctors and TotalCount using delegationMike Kaganski
Change-Id: I6f40cf80bcd6c8a53f5d25f99688526d4b946bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119238 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-19Move svl::Items to include/svl/whichranges.hxx, and unify its usageMike Kaganski
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed to explicitly use 'value' in WhichRangesContainer's ctor, or create an instance for use in SfxItemSet ctor (svl::Items is already defined as a template value of corresponding type). Instead of WhichRangesContainer Foo(svl::Items<1, 2>::value); SfxItemSet Bar(rItemPool, svl::Items<1, 2>{}); now use: WhichRangesContainer Foo(svl::Items<1, 2>); SfxItemSet Bar(rItemPool, svl::Items<1, 2>); Change-Id: I4681d952b6442732025e5a26768098878907a238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-17drop sal_uInt16* constructor in SfxItemSetNoel Grandin
Change-Id: Ifb283a49b01c9c6421e385f697e749439db6a53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-17osl::Mutex->std::mutex in SharedStringPoolNoel Grandin
std::mutex is slightly faster Change-Id: I0741cd1ed0a011d5e8d6099c189c85f50060a326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119087 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-16-Werror=class-memaccessNoel Grandin
gcc doesn't like memcpy here error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<short unsigned int, short unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] 1459 | memcpy(p, other.m_pairs, m_size * sizeof(WhichPair)); Change-Id: I44055d0d4dec589af7f98d62f106b701f1f5a4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119063 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-16Drop unused ctorMike Kaganski
Change-Id: I5144d23d4e6f8e01035ef88a222f609184043c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-16Move validity check to svl::Items, to avoid invalid WhichRangesContainerMike Kaganski
This uncovered lots of pre-existing invalid ranges, e.g. introduced in commit 6dbfbebad37fd84208e4c336f0864d26019db153, or in much older commit 46952138c938730afcc3607e1a524bb590b0e30e. Also this makes the static in svl::Items to be array of WhichPair, to avoid questionable reinterpret_cast in WhichRangesContainer ctor. Change-Id: I86030b2a2ac0a6d98870f8f7f5cc83e071c6597c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119003 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-15drop the Pair constructor from SfxItemSetNoel Grandin
just so we have one fewer odd constructors here Change-Id: I81278e9436747a4eb46a33da9bfec7a8b30079b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118982 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-15WhichRangesContainer, reduce malloc in SfxItemSetNoel Grandin
SfxItemSet shows up in perf profiles frequently, and the hottest part is the malloc of the two arrays we need. But most of the time, one of those arrays is a compile-time constant. So this change introduces (*) WhichRangesContainer, which manages whether the SfxItemSet owns the array it points at or not. (*) a static const member in svl::Items (idea from mkaganski) to store the data. Change-Id: Icb8cdbc4d54fd76739565c575e16a744515e5355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118703 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-09Make loplugin:stringadd slightly more aggressiveStephan Bergmann
...by assuming that all const member functions are side-effect free. (This presumably means that some of the special cases in StringAdd::isSideEffectFree are obsoleted by this more general case, but any such removal is postponed to later clean-up.) (Came across this when idly wondering why 8b7f948d9d79393bc6c1b11d239706666fd5d7de "sc, VmlFormControlExporter: avoid OStringBuffer style" had not been found by the plugin before.) Change-Id: I6bca10df53885b14a590543aabd61f23b3748572 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118675 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>