summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)Author
2022-11-25fix assertNoel Grandin
finger trouble in commit c757117afb398277a46e79ba22066c5bbf2c9f72 tdf#81765 slow loading of .ods with >1000 of conditional formats Spotted by sberg. Turns out my original idea idea with the assert was too restrictive, so make the check a little smarter. Change-Id: Ie735d00c87a05a70e8a71f03e75043dcd8dfc88f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-22Fix presumed typoStephan Bergmann
...introduced in 6cb400f41df0dd108cdb4b4d3ec6656844814147 "store the SfxItemSet inside SfxSetItem by value". It appears to make more sense here to check that an SfxItemSet is not an SfxAllItemSet, than to check that an SfxSetItem is not an SfxAllItemSet. Change-Id: I292c2a88910db9852cf8ba7c61999c5f281ed14a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-21Drop comphelper::OWeakTypeObject, use cppu::WeakImplHelper<> insteadStephan Bergmann
Change-Id: Ie4152d7736ae3f2ffdd3489cd7a444e5035d2422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143030 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-21qa: remove duplicated operatorsXisco Fauli
it's already defined in include/tools/color.hxx Change-Id: I26eaba4a1279fadd8669e9702b695e02871052d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142512 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-05-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): svlStephan Bergmann
Change-Id: Ia7e9ce9f93fbc48db412678da541fda4f1f7717f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142334 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-04tdf#115007 svl: clean-up "add NatNum12 number format list items"László Németh
As suggested by Eike Rathke: – call getCurrBankSymbol() via rLoc(); - remove CCC support with NatNum12: "This old CCC automatic format code never was used with NatNum12 and shouldn't be introduced, it also isn't offered in the number format dialog if a legacy document doesn't already use it." Follow-up to commit 2a1d2d42af7f365330479f4032ddfdd9eeba7c1d "tdf#115007 add NatNum12 number format list items, fix title case". Change-Id: Ia298d62221b1ce220724bdd7cfe627913ee1afc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142269 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-11-03tdf#115007 add NatNum12 number format list items, fix title caseLászló Németh
Add NumberText NatNum12 number formats, e.g. "One Hundred", and currency formats, e.g. "One U.S. Dollar and Twenty Cents" to number formatting dialog windows, i.e. Format Cells->Numbers in Calc and Format Numbers in Writer (Edit Fields->Format-> Additional formats...). Fix also bad English title case: "One Euro *and* *Twenty-Two* cents" (not *And* and *Twenty-two*) Details: – svl: list NatNum12 NumberText currency codes in Currency formats (i.e. after choosing Currency category). – svx: Recognize bank symbol "CURRENCY" in NatNum12 parameters defined in locale resource files. For example, "[NatNum12 CURRENCY]" is converted to "[NatNum12 USD]" in the number format dialog windows, using bank symbol of the current locale settings. Recognize compatible (old) bank symbol "CCC" in NatNum12 parameters defined in locale resource files. For example, "[NatNum12 CCC]" is converted to "[NatNum12 DEM]" in the number format dialog windows, using bank symbol of the compatible currency of the German locale settings. User-defined formats with arbitrary bank codes are recognized as currency formats, e.g. modifying "[NatNum12 USD]" to "[NatNum12 EUR]" in the dialog window results a new currency format item. – i18npool/*en_US.xml: define four Standard NatNum12 formats (lower case, sentence case, title case, upper case) and four Currency NatNum12 formats (title case, title case with digits, upper case, upper case with digits). – cui: use lower sample numbers for spell out formats: – 100 for Standard: One Hundred one hundred One hundred ONE HUNDRED – 1.2 for Currency: One U.S. Dollar ONE U.S. DOLLAR One U.S. Dollar and Twenty Cents ONE U.S. DOLLAR AND TWENTY CENTS – i18npool: fix English title casing of NatNum12 conversions: – Don't apply casing on "and", according to the title case rules, for example: "One Euro and One Cent" instead of "One Euro And One Cent". – Apply casing on the second element of the hyphenated compound words: "Twenty-One" instead of the bad "Twenty-one". – add unit test for extended Number and Currency categories. Note: according to the changes, update user-defined number format id in chart2/qa/extras/chart2dump/reference/chartdatatest/simple_chart.txt Change-Id: Ieaf9a8f75a4f197b858eaf67f83484df70295834 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141994 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-10-31tdf#126788 only call TotalCount() if we need the resultNoel Grandin
Change-Id: Idcacc67f005204ac499f8cdff2792e97636ae85c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142056 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-24Use constexpr kTimeSignificantRound for all occurrencesEike Rathke
Change-Id: I3d55c5ee0d0e7a803f95c0fe9f67ee15fe814b65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141773 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-10-24Related: tdf#136615 Do not round a DateTime clock format into the next dayEike Rathke
=TEXT(44858+86399.99/86400;"yyyy-mm-dd hh:mm:ss") gave 2022-10-25 00:00:00 instead of 2022-10-24 23:59:59 whereas =TEXT(44858+86399.99/86400;"yyyy-mm-dd hh:mm:ss.000") correctly results in 2022-10-24 23:59:59.990 Change-Id: Ib2ec5281eeb8590023e5137e816a8ad8fde2a8ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141764 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-10-23Resolves: tdf#147817 ignore date acceptance pattern with numeric ambiguityEike Rathke
i.e. if it matches numeric with decimal separator; may had been added as user-defined pattern to configuration or resulted from locale merge of default locale and format's locale. Change-Id: Ie42a65fac26e8ddc6898a53ee3bec8695ace9a70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141684 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-10-22use more TempFileFastService in svlNoel Grandin
Change-Id: I798a7bb773028aba059f058d4e65e7b2e845c015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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