summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
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>
2022-05-16make SharedString move operator= inline (tdf#126109)Luboš Luňák
Calc uses SharedString in mdds::multi_type_vector, which may move contents of its blocks on some operations, and making this inline makes such operations faster. Change-Id: I67d14639cf253c56b8cca5b2837bb06bc9afd7d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134339 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-07cid#1504313 Uninitialized pointer readCaolán McNamara
Change-Id: I0a5fa033a54d8f3b8b0248cf67e252c640b33e82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-06svl: fix crash if user cancels/closes master password dialogMichael Stahl
(regression from d7ba5614d90381d68f880ca7e7c5ef8bbb1b1c43) Change-Id: I8bb9a967aefa2e88f05c23456a0dd1a090e1a5fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133932 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-06tdf#148383: Obtain start/end strings always in system localeDaniel Kamil Kozar
ScFillSeriesDlg always expects the strings describing the start and end values to be in the system locale. This change ensures that and fixes the bug where using non-locale-default data in the Fill Series dialog leads to an error. Change-Id: I25eafa2174294dc35a63473a54c529c2d7bd87ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132532 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-05-05use more o3tl::getTokenNoel Grandin
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03Just use Any ctor instead of makeAny in svlStephan Bergmann
Change-Id: Iefa570476bf0c881e36679ae9511ff63162e05d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133771 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29svl: fix testSignDocument_PEM_PDF with "dbm:" NSS DBMichael Stahl
CentOS 7 system NSS defaults to legacy "dbm:" DB. test_desktop_lib.cxx:2943:Assertion Test name: DesktopLOKTest::testSignDocument_PEM_PDF assertion failed - Expression: bResult NSS_CMSSignerInfo_Sign() (called from NSS_CMSEncoder_Finish()) internally calls PK11_FindKeyByAnyCert() and that fails likely for same reasons as documented in previous commit. The workaround here is a bit more involved, it turns out there's another path with NSSCMSSignerID_SubjectKeyID where the caller can pass in a SECKEYPrivateKey, let's try to do that as a fallback if a manual call to find the key fails. Change-Id: I298ee72f178220bcf644093917dba8143b092c92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133577 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27use string_view in ImpSvNumberInputScan::StringToDoubleNoel Grandin
Change-Id: I53df3f273fd5587b12c509ead1477c2108d7fe75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27add string_view wrappers for rtl::math::stringToDoubleNoel Grandin
Change-Id: I114bec72cb933238675e539a8388a607226827cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26add o3tl::toUInt32Noel Grandin
Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-25use string_view in CompareProtocolSchemeNoel Grandin
Change-Id: I3584042d0341d5c1b4f4e742e25e9eb0aa26f1da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-15Prepare SvNumberFormatter::GetEditFormat() to obtain for another localeEike Rathke
Change-Id: Iab8b9a802ebac60b52007754430352d3de925374 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133026 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins