summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
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>
2019-04-02Introduce next Japanese gengou era 'Reiwa'Takeshi Abe
starting from 2019-05-01, which has been announced officially. This fills the provisional slot acknowledged at cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb. Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87 Reviewed-on: https://gerrit.libreoffice.org/70028 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-03-30Some refactor of lockfile classes to minimize interfaceMike Kaganski
Change-Id: Icc67c31d6a2351b6504429e25067c25353233f5f Reviewed-on: https://gerrit.libreoffice.org/69947 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-30Slightly simplify URL handlingMike Kaganski
Change-Id: Ie63745c1cb826399dc78f93ebb21af8d165c4bff Reviewed-on: https://gerrit.libreoffice.org/69946 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-27MSO lockfiles: Deduplicate MSO lock file reading codeTamás Zolnai
The removed code was extracted to MSODocumentLockFile class so use that class here too. Use openStreamNoLock() for reading MSO lockfiles, because otherwise we can not read lock files written by MSO. Change-Id: Ib31cb9f3783d0b0ce784f900821047b9d32156f2 Reviewed-on: https://gerrit.libreoffice.org/69759 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-26Generate MSO lock files when the related MSO compat. option is setTamás Zolnai
Added a new compatibility option to the Tools -> Load / Save -> Microsoft. When this option is set on the UI or or set in the configuration files LO generates lock files for MSO supported file formats, similar to the lock files MSO generates itself. Change-Id: I2f882723841162add01be9d3f7285a5162a60331 Reviewed-on: https://gerrit.libreoffice.org/69678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-25Fix typoAndrea Gelmini
Change-Id: I889e7809e8ae48f770afd376cc2d6eca3442b189 Reviewed-on: https://gerrit.libreoffice.org/69642 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-23Introduce new lockfile handler for MSO like lockfilesTamás Zolnai
* Implement writing of MSO lockfiles * Grab the already implemented parsing code (tryMSOwnerFile method) and put it together into one class * Add tests about the generated URL for lockfiles and the lockfile content * MSO lockfiles are not written yet by LO, next step is to integrate this code into the locking mechanism. Change-Id: I3b0ed1975cd57dfd006d4e1890b23c307890de5c Reviewed-on: https://gerrit.libreoffice.org/69582 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-20sw: make ODT export of paragraph auto-styles deterministicMiklos Vajna
If a complex enough document is loaded into Writer and saved as ODT, then the content.xml's automatic paragraph styles (P<num>) are re-ordered on each save, which leads to unnecessary noise. The actual random order is created during import by the time we convert direct formatting (e.g. from HTML import) to autostyles, as StylePoolImpl::maRoot stores autostyles in a map that orders autostyle parents based on their pointer address. This has benefits like automatic ordering of item sets and fast comparison, so don't change that, but extend the svl API to also track the name of those parents. This way by the time StylePool::createIterator() would iterate over those autostyles, it can order the parents by their name, so two import->export runs will result in the same autostyle ordering. (This appears to be the only indeterminism in content.xml for a test HTML input, while meta.xml and settings.xml still changes all the time.) Change-Id: I1cfcae2c664a5c5c3dee48be733046979c1593ed Reviewed-on: https://gerrit.libreoffice.org/69469 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-17tdf#120703 PVS: remove redundant static castsMike Kaganski
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I6d1523e71b3e06be1cf41abaabb44e49fe11cd8e Reviewed-on: https://gerrit.libreoffice.org/69369 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-14Only return elements with both name and predicate matching argumentsMike Kaganski
... otherwise, after first stylesheet with matching name but failing predicate, next stylesheet that matches predicate is returned, regardless what is its name. See commit b37b299d5228beeecb913980780f463756c5a878. Change-Id: I965ddcd0f8f578b60a46b3c7412d33973aa7a2aa Reviewed-on: https://gerrit.libreoffice.org/69228 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-07log nice exception messages whereever possibleNoel Grandin
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-06remove some unnecessary typedef struct... sugarNoel Grandin
Change-Id: I1576282b0a0a3af8ae14c04725d9c4900073f2c4 Reviewed-on: https://gerrit.libreoffice.org/68758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04OSequenceIterator is not necessary anymoreNoel Grandin
we have been able to iterate over a sequence for a long time now Change-Id: Ie7ed6ec25682f631e01170029f7c9f0089448836 Reviewed-on: https://gerrit.libreoffice.org/68666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04simplify UNO getTypes methodsNoel Grandin
Change-Id: Ia8b07edec54527fb4904536fabb03a18e8452550 Reviewed-on: https://gerrit.libreoffice.org/68659 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28use the xmlTextWriterPtr typedef consistentlyNoel Grandin
this is the single biggest chunk of stuff my upcoming paramtypedef loplugin will warn about, so do it separately Change-Id: I412e69e76406d6d947101885d4cd92c65e021508 Reviewed-on: https://gerrit.libreoffice.org/68486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28Resolves: tdf#123748 do not strip date part before calling Time::GetClock()Eike Rathke
GetClock() needs it to properly scale and round the floating point value. It also handles negative values, fiddling with that is only needed for the [] formats. Regression from commit e2e47898180e547cad7ccde1e5890385d573e551 CommitDate: Fri Aug 31 12:50:52 2018 +0200 Use tools::Time::GetClock() in number formatter for wall clock time Change-Id: I05fe9e22886d4e59f110c0a826dadb43234d348a Reviewed-on: https://gerrit.libreoffice.org/68508 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-02-22loplugin:unusedfields in svlNoel Grandin
and simplify SvAddressParser Change-Id: I8333b4442dca69e46ad14c952436b98e40089a8c Reviewed-on: https://gerrit.libreoffice.org/68199 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13Use indexed getToken()Matteo Casalin
Change-Id: I7a9ee6cb1e5fd9dac917d236bfd612100828c087 Reviewed-on: https://gerrit.libreoffice.org/67626 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
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>