summaryrefslogtreecommitdiff
path: root/include/svl
AgeCommit message (Collapse)Author
2022-09-27A bit of cosmeticsMike Kaganski
Change-Id: If7440ea4e99ce33948a1c040f9f0345b18d18c42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140635 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-26crashtesting: forum-de2-1635.odsNoel Grandin
regression from commit b52fd544b9c128d3e28de6355286f6480b618e93 Date: Tue Sep 20 15:48:38 2022 +0200 avoid some string refcounting with sheets with lots of conditional formatting Change-Id: If1414221aef0b227200cfb6ffb8e87abb48a90c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-26introduce sw::SectionHidden as plain SfxHintBjoern Michaelsen
Change-Id: I7412c16d0ffd4cf38a1b4186f81703443cdf6fbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140576 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
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-24Replace RES_NAME_CHANGED with an SfxHint for stronger typingBjoern Michaelsen
Change-Id: I0bbe9dc4e10491aafcc623c2add62a246ea67d80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139961 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-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-06Related: tdf#150307 Use SfxHintId::ScAreasChanged, tdf#137577 follow-upEike Rathke
... instead of ScTablesRenamed, as ScAreasChanged (confusingly named) was meant exactly for this and also updates the Navigator. Change-Id: I6d90b82e6d5121e69c1a40af369be36544ad1b3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139453 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
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-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-07-27tdf#119840 elide some dynamic_castNoel Grandin
Change-Id: Iafaedf26231bac142759d2bf667dfba083cf0122 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137503 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-15tdf#119840 elide some dynamic_cast costNoel Grandin
when opening a large writer file, shaves off about 5% off load time Change-Id: I501d0ebfbaec572e7c93c1dbc3f0cfaab3938f20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137099 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-12elide some dynamic_castNoel Grandin
Change-Id: I32c804e64cf219364e27ad6d9549c68c1f737a19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-15Revert "simplify SharedString::operator=(&&)"Noel Grandin
This reverts commit 2da1cdd31312a70f205f29bb4dfcbc1771409aa4. Comment from llunak: I'm possibly not remembering it exactly. But the point is that if you're going to destroy something, it's faster to destroy it outright rather than move it somewhere and destroy it later. If you google it you'll find posts on how implementing std::move() using std:swap() is generally a pessimisation. Change-Id: Ice4234ad074cd894a25782e9c52b34c5acb26c8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-15simplify SharedString::operator=(&&)Noel Grandin
the release will happen in the destructor Change-Id: Ibb1f2ca11a157affdcfa9e0959558945657caa21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10loplugin:unusedvarsglobalNoel Grandin
Change-Id: I37a1772ffdd682d17571aa06e24089136d2d8547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135600 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-06add comments to SvtBroadcaster about field sizes/packingNoel Grandin
Change-Id: Ia01897ac1444e9ac905a0e383b892fa1478c2c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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-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-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-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-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-16Fix typoAndrea Gelmini
Change-Id: I3f2da2522f80fdcbbd377686032a1f8e919e4484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133065 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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
2022-04-13use more string_view in svlNoel Grandin
Change-Id: I9b6a074eb6342808d02a69f3ed1fa713e81d2608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132958 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11use more string_viewNoel Grandin
found by tweaking the loplugin:stringview and making it whitelist getLength Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-06make CellTextAttr half the sizeLuboš Luňák
It's set for every cell with value. Change-Id: Ie46617a621e6eb16b5f67d92e85bf2155e650fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131072 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06make a bunch of SvtBroadcaster/SvtListeners functions inlineLuboš Luňák
These classes are used extensively during some operations in Calc, and not even LTO can inline these when they end up in different binaries. Change-Id: I5b17a004c6cc039508b76d557d58714c83f237a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131071 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06do not destroy broadcasters and then recreate again (tdf#134268)Luboš Luňák
Sorting ends tells all listeners on all the sorted cells to end listening to stop updates, then sorts the cells and starts listening again. This will cause all broadcasters for the sorted cells to temporarily stop having any listeners, so they'll be deleted and removed from the mdds vector (which may additionally cause moving large parts of the mdds vector repeatedly). And since all listeners will want to listen again after the sort, this will all need to be reconstructed. To avoid this, temporarily block this removal and then later just checks and remove any possibly left-over broadcasters that ended up with no listeners. Change-Id: Ie2d41d9acd7b657cf31a445870ce7f18d28d5ebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131069 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-28checked signedness of Sfx*IntItem types (part2)Noel Grandin
See comments here https://lists.freedesktop.org/archives/libreoffice/2022-January/088360.html Make SfxItemSet::GetItemState check the type of the ppItem pointer using TypedWhichId the same way we do for other calls. Take the opportunity to name the new method GetItemIfSet and change the signature to reduce the boilerplate at call sites.. This is just the initial commit, the bulk of the patch (the actual usage) will be split into lots of smaller patches to aid bisecting for bugs. Change-Id: I6704059331787c8776f786af764b4ba3478a307b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128908 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-27use more SfxItemSet::CloneAsValueNoel Grandin
to reduce heap allocations Change-Id: Ia755c3e7f9610a5441a447cc74ea38ebcef068bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-21replace SfxPoolItem::LookupHashCode() with Lookup() (tdf#135215)Luboš Luňák
The LookupHashCode() way still loops over an array while calling virtual functions for a type that is actually known. Overriding instead a whole new Lookup() function that does the loop avoids the virtual calls, allowing compiler optimizations such as inlining, or class-specific optimizations like the hash code. So this still improves performance with ScPatternAttr a bit, for tdf#135215 it saves about 40% of load time, but this is scraping the bottom of the barrel, as this is still a linear search (the IsSortable() approach, if it worked, would be still 3x faster). Change-Id: I8fe5f70cabb77e2f6619d169beee8a3b4da46213 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130228 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-18improve the SfxItemSet::CloneAsValue checkNoel Grandin
to prevent object slicing. Which reveals a problems with commit 044fa30a4c77013c87a7e2a6dd9022a2f6599778 Author: Noel Grandin <noelgrandin@gmail.com> Date: Thu Sep 23 18:44:42 2021 +0200 no need to allocate this SfxItemSet on the heap and commit 044fa30a4c77013c87a7e2a6dd9022a2f6599778 Author: Noel Grandin <noelgrandin@gmail.com> Date: Thu Sep 23 18:44:42 2021 +0200 no need to allocate this SfxItemSet on the heap so revert the problematic bits of those commits Change-Id: I5eeba1d5bdb91f4e539850516f2b1c11e69ff2c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130127 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-15fix SfxItemPool::GetWhich changeNoel Grandin
In commit 339fde9d905135e24b2f4e204009ee289d678b0c Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Feb 15 08:56:13 2022 +0200 add typed GetWhich operations I got the parameter type wrong Change-Id: I7b1d86bc06da7feb3238f5033bbffbd166cd4fdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-15add typed GetWhich operationsNoel Grandin
to reduce boilerplate at call sites Change-Id: I290c2bf60ad5e6ddb000aa26cf543830ed39120a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-08speed up SfxItemPool searches with items that can't use IsSortable()Luboš Luňák
As pointed out by 585e0ac43b9bd8a2f714903034e435c84ae3fc96, some item types cannot be used as IsSortable(), because they are modified after having been inserted in the pool, which breaks the sorted order. But it's possible to at least somewhat improve performance of these items by explicitly providing a hash code and using that first for comparisons when looking up items, which may be cheaper than calling operator==. With ScPatternAttr such comparisons seem to take only 60% of the original time, reducing loading time of some documents by 25%. Change-Id: I41f4dda472fb6db066742976672f2c08b9aeef63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129667 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2022-02-07tdf#145868 sd replace: if search changes, restart find/replaceJustin Luth
REPLACE is really a replaceAndFind instead of a findAndReplace. Thus, when you changed your search parameter and did a replace, it replaced the previously searched for item, and then found the first instance of the new search parameter. That of course is just wrong. So make sure to verify that the previous search matches the current search competely. However, that doesn't mean that the entire searchItem matches, since we don't want to restart the search just because the replace parameter changed. In my testing, this wasn't an issue for REPLACE_ALL. So the only time we need to worry about the last search result is in a replace once situation. P.S. This commit exposed that mpSearchItem can point to a destructed SvxSearchItem, so this patches unit test will crash if the other 7.4 commit is missing. Change-Id: I7be14d64534018718145c6ac5f8629ff5f2e5611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129385 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-02-03SfxMetricItem should take signed valueNoel Grandin
since it extends SfxInt32Item been this way since commit 5f51e579fc2e3207166b053382ca14b95082728c Date: Wed Apr 11 18:28:13 2007 +0000 INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED 2007/02/09 16:12:44 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to svtools/inc/svtools and correspondent necessary changes Change-Id: Id23909c5cb842b858baf2f6918298607a79adcec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129402 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-31support for the WebP image format (tdf#114532)Luboš Luňák
This commit implements a WebP reader and writer for both lossless and lossy WebP, export dialog options for selecting lossless/lossy and quality for lossy, and various internal support for the format. Since writing WebP to e.g. ODT documents would make those images unreadable by previous versions with no WebP support, support for that is explicitly disabled in GraphicFilter, to be enabled somewhen later. Change-Id: I9b10f6da6faa78a0bb74415a92e9f163c14685f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128920 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-01-29used TypedWhichId in the constructor of various svx *Item classesNoel Grandin
to act as an extra check that we have the association of Item and TypedWhichId annotations correct. (*) requires that I add an upcasting constructor to TypedWhichId (*) Make the field dialog stuff in writer use a new item id FN_FIELD_DIALOG_DOC_PROPS instead of abusing the existing SID_DOCINFO Change-Id: Ica4aea930c80124609a063768c9af5a189df1c27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129098 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>