summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2022-10-11Deduplicate O(U)StringConcatenationMike Kaganski
And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-08Simplify this code a bitMike Kaganski
Change-Id: I532784161de5f5655bca3fd8eb295bf95bb5d4da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141102 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-03svl : use uintptr_t instead of sal_uInt32 or sal_uInt64Arnaud Versini
Change-Id: I57a860ee67cc986936b1488f4ab59b5c47f2fd15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140657 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-27Reduce number of static objects a bitMike Kaganski
Change-Id: I80f0e8edeb4aa0b6a2179745ae9eda37cac278d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140641 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-27Prevent erroneous fraction detection of not yet accepted dateEike Rathke
May had happened if the locale's date separator is not '/' but a preset format uses it (for example DD/MM/YYYY) and the locale's date acceptance patterns do not contain D/M/Y so the first '/' did not already lead to a possible date before a match against the format is to be tried. Change-Id: I7f91130da52564496a2b1369741328236dde10e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140632 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-09-25unwrap SwDelChr to plain SfxHintBjoern Michaelsen
Change-Id: Ief37a8025181b6cc8a6e484e2726d8a8d92f57ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140567 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2022-09-25unwrap SwInsText to a plain SfxHintBjoern Michaelsen
- also add some constnesss and move some things to private Change-Id: I67a45e1326361b5a8f7e320b3525e74e93b1ef12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140556 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2022-09-24unwrap SwDelText to a plain SfxHintBjoern Michaelsen
Change-Id: I559f8f1e837830426e820dace6226618c5e0fc62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140210 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2022-09-23make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)Luboš Luňák
Without this, it may not actually be there, so interning "" would use a different string instance, and then comparing with SharedString::getEmptyString() would actually compare non-equal. Change-Id: I22660f63aa321e3a8f72cfb96df1db56e08fbb84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140402 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-09-21Use the more "natural" string_view o3tl::getToken variant hereStephan Bergmann
Change-Id: I31edc76e4358f7bcedabd89376fe0b28ec73e5f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140343 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-20use more string_view in svlNoel Grandin
Change-Id: Icd978cd3cb7946f96d2570a0b8c87a74eed57c98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140241 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-02tdf#150712 reduce cost of SharedString::getStringNoel Grandin
where the construction of empty strings is significant here which required fixing a couple of places that ended up using a reference to a temporary. Change-Id: I52feb1673bd39db4060585ac8d9ae2f3dea27fc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-19svl: rename SfxRectangleItem::aVal to maValChris Sherlock
Change-Id: I7bc86de644749fb42eba89872828b15be47bb0dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137380 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18use more pass-by-value in SfxItemSetNoel Grandin
which avoids some copying Change-Id: Id774c8947d0c2676425a1a192e0ac28c8f8402db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138468 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-17tdf#150452: Revert "tdf#130795 use concurrent hashmap in SharedStringPool"Xisco Fauli
This commit reverts 3749d9af3745c0eaff7239e379578e4e2af89e9d which removes the dependency on the external library cuckoo Without using cuckoo the same file in tdf#130795 takes real 0m4,892s user 0m5,298s sys 0m0,449s With it, it takes real 0m4,914s user 0m5,276s sys 0m0,444s pretty much the same time Change-Id: I4cc9000ac5bf26de22bb9835283ae8d5b3230196 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-08-03improve assert messageNoel Grandin
Change-Id: Ib51768018f5ed8db89993a162ac8c4b4951b3887 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137748 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25A bit of RAIIMike Kaganski
Change-Id: I58fb16f7e2c4c30212605b667cfd3f79a3dc7d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137400 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-25use more o3tl::spanNoel Grandin
which means we can reserve precisely the right number of entries when building maps Change-Id: I580414699289369de4730caae09829bbd8759e82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137292 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-14Accept 'Y D MMM' date input for locales with LongDateOrder::YDMEike Rathke
There currently is only lv-LV. Change-Id: I39aa38fbf34c44d914aeb6af0f55d820b5567a7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137083 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-07-14Let 'MMM D Y H:M' input follow the same date rule as 'MMM D Y'Eike Rathke
... and not only accept for DateOrder::MDY. Change-Id: Ic17efbdfee5aac1e00d3cee7b14c16875b3dd292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137076 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-07-13tdf#149950: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: Iae7facef72ad17b29b49ea5b52aab77c16357da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137031 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-07-13Resolves: tdf#149950 Handle LongDateOrder vs DateOrder for middle month nameEike Rathke
Change-Id: I30598f7081cea73fa368374084c03b0df108be84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137026 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-07-11tools: rename getHeight/Width() to GetOpenHeight/Width()Chris Sherlock
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-04dodgy use of dynamic_cast on an UNO objectNoel Grandin
rather just stick to using getFromUnoTunnel ever since commit 5420fbd0d722754e4e01e48d661f0ee082caef56 Date: Wed Mar 12 12:09:03 2008 +0000 INTEGRATION: CWS impresstables2 (1.16.30); FILE MERGED 2008/ Change-Id: I0ac7690ed779407c77c29fa319402e70427e184c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-01small optimisationNoel Grandin
in a very hot spot Change-Id: I2115fb23e217de7cdd84f7301acd3a27829f3298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136660 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-01ChangeNullDate: assert valid date after normalization if it wasn't beforeEike Rathke
... and abort if not. Also take over only valid values. This might pop up more crashtest import failures that would need fixes similar to commit 7ca3eca66888a1fa1b7bd59d79bb8f4c96bd7460. Change-Id: I217204378374a1a598b5a3ff3c9c6728f112af70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136688 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-06-29elide unnecessary copy in SfxItemSet constructorNoel Grandin
Change-Id: I6881f5dcea753a6d2cfbf203b50043219191fae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136601 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-29tdf#117539 Assert after cut and paste operation of a chart stickNoel Grandin
inline the call to the other constructor, and remove the assert(size() != 0) it appears to be valid to have a size of zero here Change-Id: Iff18581109a27622701a5dbe22874854ee7b1faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-20elide some makeStringAndClear() callsNoel Grandin
Change-Id: Id7116fac8a6f65db18ff93384c5faf2f6481f6fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-20Resolves: tdf#147265 Return correct default if currency format is duplicateEike Rathke
For the default currency format SvNumberFormatter::GetCurrencyFormatStrings() returned always the last added position, regardless whether that format was added or not, which it isn't if the format code is a duplicate. Let addToCurrencyFormatsList() return the position of the existing format if the duplicate was rejected and use that for default. Change-Id: I148d7379de75cae402b063f7b2f92947e345176f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136187 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-06-20SfxStyleSheetBasePool::Find can be constCaolán McNamara
Change-Id: I5cf2737d05cfe4b0be936a77cfb96db053483438 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-16tdf#128150 Add OOXML import/export for "use background fill"Samuel Mehrbrodt
and allow editing this fill property in area dlg Change-Id: Ic63ba11e9d499d4a0fb22f6739587e3e25140b8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134406 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-16Related: tdf#149325 tdf#52602 SvNumberFormatsObj::addNew accept differingEike Rathke
... resulting format code of an existing format as not attempting to add a duplicate. It makes no sense to insist on strictness if the client can't know the rules.. Change-Id: I0c8ca215984bf84487036ccf2b570128b1694d54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135898 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-06-15Use rtl::isAsceeLowerCase/rtl::toAsciiUpperCaseMike Kaganski
Change-Id: I61593b4f147bb2b83bd979f8fd429b70b3286d77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135885 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-15Resolves: tdf#149325 tdf#52602 SvNumberFormatsObj::queryKey try also uppercaseEike Rathke
... keywords; that should catch most lower case queries. If there are still remaining mismatches then either implement the bScan thing, or enhance addNew() to not fail on case-different format codes. That could be hit for the `General` keyword, for example. Change-Id: Ic728b8c5e38db76eb791cb305595f84acf7dc867 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135854 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-06-08Related: tdf#149484 Display BOOLEAN literal string text additionsEike Rathke
Change-Id: Ifbaf0b18178091c3a340a7c4bc66f78397aadc18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135506 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-06-03clang-tidy modernize-pass-by-value in svlNoel Grandin
Change-Id: I184efd7aee2c3eb02399100a4a7500951255d423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135357 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28add ClearItem to the SfxItemSet iteratorsNoel Grandin
to speed up operations when iterating over SfxItemSets Change-Id: Ie40327ffaf7faa801ccc12d2b05c546a7fe49802 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28split SfxItem::ClearItem into two methodsNoel Grandin
in preparation for passing a hint into it Change-Id: Id9e5516619a314406d8250bb2145996593dafbaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135078 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28simplify SfxItemSet::Differentiate and SfxItemSet::IntersectNoel Grandin
using SfxWhichIter instead of SfxItemIter Change-Id: I046ae2cec9246b1dea9c484f94b88d64825f952c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135077 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28add GetItemState to SfxItemIter, the same way I did to SfxWhichIterNoel Grandin
to speed up GetItemState while iterating Change-Id: Ibe092e7581a5be0160eed52472122afe7e0ef377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135076 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28use the new SfxWhichIter::GetItemState featureNoel Grandin
to speed up other places that are iterating over SfxItemSets Change-Id: I646bae12420d15e67effdd279e071cdf8a8afffd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28ofz#24932-1 speed up GetItemState when iteratingNoel Grandin
by having SfxWhichIter track the current position in the m_ppItems table, which means GetItemState does not need to traverse the ranges table to find the item position. shaves 75% off the time of ./instdir/program/soffice.bin --calc --convert-to pdf ~/Downloads/ofz24932-1.rtf Change-Id: Ib5fe61c75ca05bc2f1932e84b57ccfa55f8b7f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135023 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-27sw: language fallback in MSWordExportBase::GetNumberFormat()Michael Stahl
There is this number format: <number:date-style style:name="N36" number:automatic-order="true"> <number:day number:style="long"/> <number:text>.</number:text> <number:month number:style="long"/> <number:text>.</number:text> <number:year number:style="long"/> </number:date-style> in a paragraph which has fo:language="zxx", so the field has LANGUAGE_NONE. MSWordExportBase::GetNumberFormat() exports as: DATE \@"dd/MM/yyyy" But should be: DATE \@"dd.MM.yyyy" Follow Eike's suggestion to use the number format's language in case the field doesn't have one. Change-Id: I596bea5daa75c717931b3c5d5506103b87b8ee08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134638 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-26ofz#24932-1 walk ItemSets together in SfxItemSet::SetNoel Grandin
shaves 20% off the time of ./instdir/program/soffice.bin --calc --convert-to pdf ~/Downloads/ofz24932-1.rtf Change-Id: I85c8bdd51895d768c37d247f6bf07ce9183d1107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-26avoid some allocation in SfxItemPropertySet::setPropertyValueNoel Grandin
by using std::move on the newly created poolitem, so that the pool does not need to clone it Change-Id: Ib90b14173d19768517eb2a31cc0a105e5eb4d7c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23svl: spurious GCC12 -Werror=maybe-uninitializedMichael Stahl
In file included from svl/source/misc/sharedstringpool.cxx:11: In constructor ‘svl::SharedString::SharedString(rtl_uString*, rtl_uString*)’, inlined from ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’ at svl/source/misc/sharedstringpool.cxx:129:51: include/svl/sharedstring.hxx:56:20: error: ‘pResultUpper’ may be used uninitialized [-Werror=maybe-uninitialized] 56 | mpData(pData), mpDataIgnoreCase(pDataIgnoreCase) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ svl/source/misc/sharedstringpool.cxx: In member function ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’: svl/source/misc/sharedstringpool.cxx:93:33: note: ‘pResultUpper’ was declared here 93 | rtl_uString *pResultLower, *pResultUpper; | ^~~~~~~~~~~~ Change-Id: I2171855844c76ad3b2a72c1eca737691ca96fc46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134736 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-16std::stable_sort() where libc++ debug mode breaks a unittestLuboš Luňák
Libc++ debug has a feature that randomizes equal elements during sort, which normally wouldn't make a difference, but some tests rely on specific order of tested data. The ones failing without this include: CppunitTest_sw_ooxmlexport testMsoPosition CppunitTest_sw_xhtmlexport testTdf66305 CppunitTest_sw_ww8export testCommentExport Change-Id: Id49846939a264150cc82091718ffe6b904d7130e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134337 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>