summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2019-07-18speed up sw_filters_test2Noel Grandin
in dbgutil mode, this takes the test from 2m31 to 1m45 for me. find(), even on a sorted vector, is rather slow in debug mode, and we can avoid one find here Change-Id: I8f82aaf5b8d82a32c78bf7c9df5712c90c68f7fc Reviewed-on: https://gerrit.libreoffice.org/75764 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-15Simplify Sequence iterations in svlArkadiy Illarionov
Use range-based loops, STL and comphelper functions Change-Id: I1c3dbf194600bec60c0881d2d19ff07b89d8333b Reviewed-on: https://gerrit.libreoffice.org/75563 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-07-13Move logic to GetDateOrder()Eike Rathke
Which saves a call to GetDatePatternOrder() in case a pattern was matched (usual case) and allows us to use the same logic in other places if needed. Change-Id: I259c7edf9fa301bf05184d0b25710edf54619a80 Reviewed-on: https://gerrit.libreoffice.org/75518 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2019-07-12Resolves: tdf#126342 obtain date particle order from pattern matchEike Rathke
... if there was any. In the NF_EVALDATEFORMAT_FORMAT_INTL case the input may match a current locale's pattern instead of a format's locale's pattern and patterns' (format locale + current locale) date orders may be different from the format's date order. Change-Id: I3aeaa6c361f98fe80f69c4f5d975fca892dac6ea Reviewed-on: https://gerrit.libreoffice.org/75481 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-21Extend INetURLObject::setName and drop INetURLObject::SetNameMike Kaganski
Change-Id: I488313eeb363d2a9344d6bc801900d5b1f913020 Reviewed-on: https://gerrit.libreoffice.org/74463 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-21Drop INetURLObject::GetName and INetURLObject::GetExtensionMike Kaganski
They are just synonyms for GetLastName and GetFileExtension resp. Change-Id: Ic498c7025cc421b830394ed94d64529fd74fe7dd Reviewed-on: https://gerrit.libreoffice.org/74448 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-17Add comphelper::getUnoTunnelImplementation templateArkadiy Illarionov
Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_* Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596 Reviewed-on: https://gerrit.libreoffice.org/74107 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-07tdf#42949 Fix IWYU warnings in svl/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Except source/svdde/* which is WIN-specific Also recheck include/svl Change-Id: I32d3bcb6b14665c56c07a2f10526329b08c64cbe Reviewed-on: https://gerrit.libreoffice.org/73630 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-03tdf#39593 use UNO3_GETIMPLEMENTATION* macrosArkadiy Illarionov
Change-Id: I4e9af3b43a5baf19e100f42b3f37a2ade89ada5d Reviewed-on: https://gerrit.libreoffice.org/73320 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-27@deprecated should be with @DeprecatedTomoyuki Kubota
Without this patch, warnings will be given when LibreOffice is built with JDK9 or later. Change-Id: I7aa6e99ace2377fbdb7dd732949ce10d9bd9df58 Reviewed-on: https://gerrit.libreoffice.org/72947 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-18avoid double-lookup in SharedStringPool::internNoel Grandin
An emplace_hint with the iterator pointing at end() doesn't really help, so rather attempt an insert with a temporary value. Also check if the upper-case string we got back is the same as the input string, in which case, we can save memory by mapping the input string to itself. Change-Id: I40b9e2b65a831e44c4b88d51d835242a47d8a86d Reviewed-on: https://gerrit.libreoffice.org/72516 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-16tdf#125254 Performance: A spreadsheet opens too slow, part1Noel Grandin
This takes the opening time from 55s to 48s for me. Change-Id: Ia60fff33e9948e0bd6906c82b48aa30f8b2551bb Reviewed-on: https://gerrit.libreoffice.org/72394 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-16tdf#125254 Performance: A spreadsheet opens too slow, optimise listenerNoel Grandin
saves about 0.5s out of a 43s load And remove the comment in EndListeningAll, SfxBroadcaster::RemoveListener doesn't have any weird side-effects any more Change-Id: Id7c8ac1bed8ff3487cb8f977990d8fac351d7f03 Reviewed-on: https://gerrit.libreoffice.org/72396 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13tdf#125215 Assertion when closing Database/Advanced SettingsNoel Grandin
This showed up as a segfault for me. Sometimes we have sortable items, for which we store duplicates (because those items are not poolable), in which case comparing by operator== means that we sometimes end up deleting the wrong one. Change-Id: Ic7dff0357d3c5a7a74bf0b4e87fa02f2f5857f30 Reviewed-on: https://gerrit.libreoffice.org/72222 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12regenerate PCH headersLuboš Luňák
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10Apply duration format for such newly entered formula cellsEike Rathke
... and the cell didn't have a number format applied already, [HH]:MM:SS instead of wall clock time format HH:MM:SS which comes to a surprise anyway if the result is >=24h. Related to tdf#125099 Change-Id: I6c19a86177f8714ac588d6798acf86e247a79b26 Reviewed-on: https://gerrit.libreoffice.org/72131 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-05-09loplugin:unusedmethodsNoel Grandin
Change-Id: I7b4d2e5e611935284e2902b0089950768dfb7717 Reviewed-on: https://gerrit.libreoffice.org/72036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-09avoid copying when placing items into SfxItemSetNoel Grandin
Change-Id: I05c627f590e7794c1ba11b66021dc30aa3285eb0 Reviewed-on: https://gerrit.libreoffice.org/71941 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-09move constructor for SfxItemSetNoel Grandin
Change-Id: If7f51a657606da8aea4bcf01f13468c6ac2086a8 Reviewed-on: https://gerrit.libreoffice.org/71901 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-07tdf#63640 FILEOPEN/FILESAVE: particular .odt loads/saves very slow, part2Noel Grandin
Use the existing sorting functionality in SfxItemPool and extend it to search for NameOrIndex item in SvxUnoNameItemTable This is a little tricky in that we are defining only a partial ordering over the CntUnencodedStringItem (and their subclasses) items. Partial because I can only use the part of the item that is not randomly mutated by various code, which is why the other fields in the subclasses are mostly out of bounds. I had to exclude FillBitmapItem because it triggers a unit test failure and I cannot figure out why that specific item does not play nice with this optimisation. After this optimisation, the load time goes from 3.6s to 2s on my machine. Change-Id: I52d58c68db2536b69a7b0a9611a2b4c703bc4928 Reviewed-on: https://gerrit.libreoffice.org/71461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-06improve assert in SfxItemPooL::PutNoel Grandin
need to check for ownership passing in both variants of the loop, so just move it into the common block below. Change-Id: I75929377dd64df722a8ef040b5f714346417475d Reviewed-on: https://gerrit.libreoffice.org/71826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-03ofz#14552 direct-leakCaolán McNamara
Change-Id: I8509b5805baca5b6357d7e266c05e3ff4404f4c1 Reviewed-on: https://gerrit.libreoffice.org/71754 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-03Use hasElements to check Sequence emptiness in sfx2..svxArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: Icabd773f3b924d465b33e8581175f1fcf70c282e Reviewed-on: https://gerrit.libreoffice.org/71704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-02fix assert in SfxItemPool::PutImplNoel Grandin
Change-Id: I6e9abe241c7a001b503a9e3006d08c0dfc52fcda Reviewed-on: https://gerrit.libreoffice.org/71676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-29tdf#125030: Prevent double-clearing the guardMike Kaganski
... discovered after after commit d38f9934f08939032cca64a32de58fa3901a88d5. Change-Id: I09bcee0053d1a5132483c933a903f006a236a679 Reviewed-on: https://gerrit.libreoffice.org/71550 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-29tdf#63640 FILEOPEN/FILESAVE: particular .odt loads/saves very slow, part1Noel Grandin
Make CntUnencodedStringItem sortable, implementing operator<. This takes the load time from 4s to 3.3s Change-Id: I532cdf65149a733d41d2caf367675800d2ba4d41 Reviewed-on: https://gerrit.libreoffice.org/71460 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-26Removed executions flags on source filesAndrea Gelmini
Change-Id: I165d417a8e28d5732945722158b83e2ac5edb402 Reviewed-on: https://gerrit.libreoffice.org/71388 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-26remove warning messageNoel Grandin
the only thing it picked up is the SvxFieldItem stuff, which cannot use this feature because the editeng and sc code likes changing some of the data in these supposedly immutable data classes Change-Id: I5430e95e9507c3c86bef263242ed9fba17dbbc29 Reviewed-on: https://gerrit.libreoffice.org/71348 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-25Cut down on -pthread/-lpthread proliferationStephan Bergmann
Building against libstdc++ effectively always requires -pthread anyway (as various standard C++ headers require it, see the comment added to solenv/gbuild/platform/unxgcc.mk), so many explicit uses of -pthread/-lpthread can be removed. Doing a (partial) test build on Linux with Clang -stdlib=libc++ suggests that libc++ indeed doesn't need -pthread as libstdc++ does. The remaining uses of -pthread/-lpthread are mostly in configure.ac for the various BSDs (which somebody else might want to clean up now), and related to external projects. I tried to be careful to remove -pthread/-lpthread from makefiles only when C++ object files are involved (so -pthread will now be included on the link command line by default). Change-Id: I936e082839cb9a434bd273ce5a1f187a4245dfa1 Reviewed-on: https://gerrit.libreoffice.org/71291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-25WIP: Further preparations for deeper Item changesArmin Le Grand
(1) Migrated all still existing binary load/save stuff in SfxPoolItem to legacy files. Isolated from Item implementations. Adapted all usages. No more methods Create/Store needed, also GetVersion removed (2) Removed operator= for SfxPoolItem. Adapted all usages. Goal ist to handle Items more as Objects ('Object-Oriented') in the sense to move/handle instances, not to copy one instance over another one (which is more and more problematic with hard to copy content as UNO API stuff or similar). This lead to much more usages of std::shared_ptr which correlates well with future plans fr Items (see dev branch). Next logic step will be to also remove copy constructor Linux build and corrections done Fixed Writer test and removed unused defines Fixed another unused m,acro Started to unify the AutoFormat stuff Changes to OUString constructor usages, tests completely No idea why, but SfxStringItem constructor which takes a OUString& now insists of not getting ::OUString's handed in - changed all 'SfxStringItem.*OUString.*".*"' accordingly Change-Id: Ibed7358b18fb019994a7490332b9d797a6694c29 Reviewed-on: https://gerrit.libreoffice.org/71075 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2019-04-24simplify call sites of SfxItemPool::PutNoel Grandin
use template to make return type match input type, so we don't need to cast at the call sites Change-Id: I1e65f362c67f74c9a230cdbc1db12545b28eb499 Reviewed-on: https://gerrit.libreoffice.org/71216 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-23std::call_once needs -lpthreadStephan Bergmann
...at least on Fedora 29: > [LNK] Library/libsvllo.so > ld.lld: error: undefined symbol: pthread_once > >>> referenced by gthr-default.h:699 (/usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/x86_64-redhat-linux/bits/gthr-default.h:699) > >>> /data/sbergman/lo-clang2/core/workdir/CxxObject/svl/source/crypto/cryptosign.o:(__gthread_once(int*, void (*)())) and the call to std::call_once was introduced with d43cc00cf97fa1151560aa6fe0a3fef38e7507f6 "crashtesting: tdf#122599 NSS_CMSMessage_CreateFromDER asserts". Change-Id: If14b8cc704dbb806c61edabb8f5621527965ceb2 Reviewed-on: https://gerrit.libreoffice.org/71118 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-23Fix typos in codeAndrea Gelmini
Change-Id: I5a39d89ad33d447f952d6c4c32923d387c47fd06 Reviewed-on: https://gerrit.libreoffice.org/71083 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21tdf#81765 slow loading of .ods with >1000 of conditional formats, part 2Noel Grandin
This takes the loading time from 15s to 14s. Reduce unnecessary allocation/copying by passing down ownership of the newly created ScPatternAttr to the item pool Change-Id: Iec38bbff572d10ff8d86f5e65fbe9a96b6a5a706 Reviewed-on: https://gerrit.libreoffice.org/71010 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-20tdf#81765 slow loading of .ods with >1000 of conditional formatsNoel Grandin
This takes the loaing time from 1m38 to 15s. Speed up finding existing pool items in the pool by storing a sorted_vector, sorted by a compare operator on the item. memcmp is faster than operator< on std::vector because operator< seems to be trying to use some kind of lexicographical compare Change-Id: Id72527106d604adb8cd2d158bb42f89e2b16a85d Reviewed-on: https://gerrit.libreoffice.org/71009 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-20flatten SfxItemPool_Impl (tdf#81765 related)Noel Grandin
Flatten the vector of SfxPoolItemArray_Impl, to reduce pointer chasing. This struct is movable, etc, so no need to allocate it separately on the heap. Change-Id: I794b4356660e9cd0e63bc98b011f58162a838662 Reviewed-on: https://gerrit.libreoffice.org/70884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-20simplify SfxPoolItemArray_Impl (tdf#81765 related)Noel Grandin
Since we want to look up items by pointer, just store them in a std::unordered_set, which allows fast find(). This dramatically simplifies most operations on this data structure. Fix a dodgy sd test that was relying on items with the same whichid being in the pool being in a certain order. Change-Id: I4d79fc718f95e3083a20788be1050fbe9fca7263 Reviewed-on: https://gerrit.libreoffice.org/70881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19crashtesting: tdf#122599 NSS_CMSMessage_CreateFromDER assertsCaolán McNamara
because NSS_Init wasn't called first Change-Id: Ib1b4c950dc2773af1fea7b64339b86566ee412e7 Reviewed-on: https://gerrit.libreoffice.org/70947 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-14loplugin:sequentialassign in starmath..svlNoel Grandin
Change-Id: I95d7b67cd8b6b68c087ff96fdb6bb283ab8b49ec Reviewed-on: https://gerrit.libreoffice.org/70718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13use more std::make_uniqueNoel Grandin
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-10clang-tidy: Fix suspicious catches of WIP unhandled-self-assignment checkTamás Zolnai
Change-Id: I1cb16b180f4cc5bf4d65485f03c44a06414d3580 Reviewed-on: https://gerrit.libreoffice.org/70481 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-04-08Use osl_atomic_increment/osl_atomic_decrement to change m_refCountMike Kaganski
Change-Id: Ia24441d3671102fdeeb797547396c25ee2a6ffd3 Reviewed-on: https://gerrit.libreoffice.org/70382 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-07Don't use resettable/clearable guard where plain guard is enoughMike Kaganski
Also use scope where possible. This allows to limit guard scope at language level; visualises the scope clearly; and helps avoiding errors like fixed in commit 61e4437c857854b331fa01da6f39b2b3b58a800b. Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41 Reviewed-on: https://gerrit.libreoffice.org/70376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-03svl.lockfiles.test: Create the temporary lock files in workdirTamás Zolnai
Change-Id: I98b03754259c296ec8b4de2dddf6aee611bfe68a Reviewed-on: https://gerrit.libreoffice.org/70209 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-04-03Revert "add more append methods to *StringBuffer"Noel Grandin
This reverts commit 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73. comment from sberg: we already have 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 "Replace OUStringBuffer::appendCopy with append(std::u16string_view)" (which can be extended to OStringBuffer if needed) Change-Id: Ifcc550a8cf26ef38ad49fde8b067f53c999c9276 Reviewed-on: https://gerrit.libreoffice.org/70178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03add more append methods to *StringBufferNoel Grandin
which performs the append without needing the creation of a temporary *String Change-Id: If9ad3222275f26659db2e7df8d34f068977c4d17 Reviewed-on: https://gerrit.libreoffice.org/69826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>