summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2024-09-04tdf#151748 editeng: Fix crash in kashida justification after updateJonathan Clark
Commit 937023bca427f803a9e7085d5090d5d2b17623ed aggravated a bug that would cause editeng to use stale kashida positions after document changes (for example, font changes). This could cause crashes or spurious kashida, and both much more often after the above commit. This change fixes the underlying logic error. Change-Id: Id6465e739740a38ed11c9d9378d30faa51948731 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172866 Reviewed-by: Jonathan Clark <jonathan@libreoffice.org> Tested-by: Jenkins
2024-09-03use less dynamic_cast when broadcasting SfxHintNoel Grandin
Change-Id: I24c947c20afeffffebe5ac794108c4ccecb680f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-30tdf#151748 editeng: Improve kashida position validationJonathan Clark
Previously, editeng did not validate whether kashida insertion positions had enough room for at least a single kashida glyph. This caused kashida glyphs to overlap other characters in some situations. Editeng will now drop candidate kashida insertion positions from the beginning of the line, until there is enough room to safely justify the remaining text. This approximates Writer's behavior. Change-Id: I804cae72503332bea8dc9e60cdfe08bd3429dc52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172641 Reviewed-by: Jonathan Clark <jonathan@libreoffice.org> Tested-by: Jenkins
2024-08-30cid#1607168 Overflowed constantCaolán McNamara
Change-Id: I18856301045008938d5222ceb6774ff6fbb557fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172634 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-29If there editeng backcolor is unknown, assume bg is the doccolorCaolán McNamara
Change-Id: I65b2cd329db2c5868e6e84592303fd277ed63d56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172534 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172564 Tested-by: Jenkins
2024-08-29LOK: avoid dark auto color font on dark backgroundPranam Lashkari
Change-Id: I259d1af222af33c0226a3d11c7b146a8a5fd72f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172527 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172563 Tested-by: Jenkins
2024-08-24tdf#158556 make SvxAdjustItem hashableNoel Grandin
Change-Id: Ic6bda5fad24ef0d9676bfb3d997da9c32aa959f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172324 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-24tdf#158556 make SvxRightMarginItem hashableNoel Grandin
Change-Id: Iad6fef862eb0b7002bbe28ed80efe1e533ffeec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172323 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-23tdf#158556 make SvxLineSpacingItem hashableNoel Grandin
Change-Id: I19d88a35332ab3aa07e88085742d92cb48d5ff79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-23tdf#158556 make SvxBrushItem hashableNoel Grandin
Change-Id: I82794dbf004781a86c8443b72263528167fe0359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172316 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-23tdf#158556 make SvxColorItem hashableNoel Grandin
Change-Id: I39cfd46a8255b6231b0215ff22f4ac5f77fa38e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172312 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-23tdf#158556 make SvxFirstLineIndentItem hashableNoel Grandin
Change-Id: Ic23d0956b87eefb575696dad7af775a37cd50b10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172289 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-23tdf#158556 make SvxTextLeftMarginItem hashableNoel Grandin
Change-Id: Idc91bf66e8ba050fcd133ef98f8364fbbb2e8efa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172294 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-23tdf#158556 improve SvxTabStopItem::hashCodeNoel Grandin
to provide more discrimination, which means we spend less time in operator== when searching the pool Change-Id: I9beb8218fdd4b4fb3d60ecf6db461ae818d2a9ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-22tdf#158556 make SvxULSpaceItem hashableNoel Grandin
Change-Id: I381379bb4be4e27cb8af32a77505dfbb357dd720 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-22tdf#158556 make SvxBoxItem hashableNoel Grandin
Change-Id: I33557df66341ec0d201b66f97ed33c1c61155d7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172262 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-21tdf#158556 make SvxTabStopItem hashableNoel Grandin
speeds up searching for it in the item pool Change-Id: I37e8889e41d63a41e1a4bf2a35b4aa303745e15c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-20cid#1607396 silence Overflowed integer argumentCaolán McNamara
Change-Id: I756688604ce80d0e9ca6494826767f49dcc13af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172095 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-11cid#1558088 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1558080 COPY_INSTEAD_OF_MOVE cid#1558077 COPY_INSTEAD_OF_MOVE cid#1558055 COPY_INSTEAD_OF_MOVE cid#1558043 COPY_INSTEAD_OF_MOVE cid#1558039 COPY_INSTEAD_OF_MOVE cid#1558015 COPY_INSTEAD_OF_MOVE cid#1558014 COPY_INSTEAD_OF_MOVE cid#1558009 COPY_INSTEAD_OF_MOVE cid#1558002 COPY_INSTEAD_OF_MOVE cid#1557998 COPY_INSTEAD_OF_MOVE cid#1557996 COPY_INSTEAD_OF_MOVE cid#1557990 COPY_INSTEAD_OF_MOVE cid#1557986 COPY_INSTEAD_OF_MOVE cid#1557980 COPY_INSTEAD_OF_MOVE cid#1557971 COPY_INSTEAD_OF_MOVE cid#1557968 COPY_INSTEAD_OF_MOVE cid#1557967 COPY_INSTEAD_OF_MOVE cid#1557961 COPY_INSTEAD_OF_MOVE cid#1557959 COPY_INSTEAD_OF_MOVE cid#1557958 COPY_INSTEAD_OF_MOVE cid#1557956 COPY_INSTEAD_OF_MOVE cid#1557953 COPY_INSTEAD_OF_MOVE cid#1557949 COPY_INSTEAD_OF_MOVE cid#1557947 COPY_INSTEAD_OF_MOVE cid#1557940 COPY_INSTEAD_OF_MOVE cid#1557931 COPY_INSTEAD_OF_MOVE cid#1557930 COPY_INSTEAD_OF_MOVE cid#1557915 COPY_INSTEAD_OF_MOVE cid#1557913 COPY_INSTEAD_OF_MOVE cid#1557910 COPY_INSTEAD_OF_MOVE cid#1557886 COPY_INSTEAD_OF_MOVE cid#1557884 COPY_INSTEAD_OF_MOVE cid#1557880 COPY_INSTEAD_OF_MOVE cid#1557875 COPY_INSTEAD_OF_MOVE cid#1557871 COPY_INSTEAD_OF_MOVE cid#1557862 COPY_INSTEAD_OF_MOVE cid#1557847 COPY_INSTEAD_OF_MOVE cid#1557845 COPY_INSTEAD_OF_MOVE cid#1557844 COPY_INSTEAD_OF_MOVE cid#1557843 COPY_INSTEAD_OF_MOVE cid#1557838 COPY_INSTEAD_OF_MOVE cid#1557835 COPY_INSTEAD_OF_MOVE cid#1557834 COPY_INSTEAD_OF_MOVE cid#1557828 COPY_INSTEAD_OF_MOVE cid#1557823 COPY_INSTEAD_OF_MOVE cid#1557817 COPY_INSTEAD_OF_MOVE cid#1557813 COPY_INSTEAD_OF_MOVE cid#1557812 COPY_INSTEAD_OF_MOVE Change-Id: I55d4a920daa2d148683419169eb828325fd3c757 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171732 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-09cid#1556026 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1556027 COPY_INSTEAD_OF_MOVE cid#1556030 COPY_INSTEAD_OF_MOVE cid#1556032 COPY_INSTEAD_OF_MOVE cid#1556036 COPY_INSTEAD_OF_MOVE cid#1556049 COPY_INSTEAD_OF_MOVE cid#1557490 COPY_INSTEAD_OF_MOVE Change-Id: If694c4d518323a8ae58bb13569f401b2b36cd427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171704 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-08-01CairoSDPR: Simplify EditEngine text decompositionArmin Le Grand (Collabora)
The EditEngine decomposes it's content mainly to Prmitives (there is still a direct paint mode used in rare remaining cases which we not yet got rid of). For TABs the special case for 'extended' TABs (see format/paragraph/Tabs, FillCharacter) was handed through all layers using method DrawingTab, put into a DrawPortionInfo and held at the text primitive (TextSimplePortionPrimitive2D). While for direct paint the expansion was already done in ImpEditEngine::Paint anyways (and always painted, independent from bStripOnly what was unneccessary and I corrected that, too) it had to be done for text paint in VclProcessor2D for each repaint. This is not needed, so now the extended text created in EditEngine decompose gets used. This makes a lot of stuff simpler, including EditEngine/Outliner and some involved classes. If it somehow should show that it might be necessary to do that for each paint it should be done in the obvious way then - using an own primitive that creates the expansin in the decomposition (and buffers it). Change-Id: Ieb02219142af8f6bee01dcd658e08b185a4212cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171380 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-08-01cool#9352 unassign cursor on SdrObjEditView to avoid crashJaume Pujantell
On stress test with shapes and typing a segfault ocurred due to using a freed vcl::Cursor. On SdrObjEditView::SdrEndTextEdit, delete pOLV can delete the cursor remembered in pTECursorBuffer. But if it is set to the window before the deletion, it will be safely removed from the window. And on SdrObjEditView::ModelHasChanged a re-anchoring sets a cursor on the window that sholdn't be there and other SdrObjEditView can see, remeber, and use it even after this one died and freed the cursor. Change-Id: I3cfef3b68b77e6e6b49c3b68297a6a20e1f9394a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171184 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 3b5738ab1a646d089fa7cc59ffaeda7d011c1e07) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171288 Tested-by: Jenkins
2024-07-31Reintroduce OUString::replaceAt taking an OUString to LIBO_INTERNAL_ONLYMike Kaganski
This allows optimizations when 'this' is empty, avoiding allocations, and making it possible to not special-case it in other places, as was done in ContentNode::Insert in commit 8ab44b114c6706ab2e3d8a19884daeb544d3c2e1 (tdf#161846 avoid allocation in ContentNode::Insert, 2024-07-30). A couple of disambiguation templated overloads was introduced. Change-Id: I2b5e94c2175379b2696c34e600393d32731f0ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-07-31reduce number of GetItem callsNoel Grandin
if we already call GetItemState, we can use that call to fetch the item Change-Id: I736dec9bb56ad3bd66bb53e1cef2cf1e3092821d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-31tdf#161846 no need to CloneAsValue() hereNoel Grandin
the methods are already returning by value Change-Id: Ie9eaf2ba3ae0ca4ad79b05229dd6856537580044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171249 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-30tdf#161846 reduce re-alloc in ImpEditEngine::GetSelectedNoel Grandin
we can fairly easily allocate the exact buffer size we need and avoid needing to extend the buffer Change-Id: I7f0b2533dab03452db60ddaa5b8a5f3471c195ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-30tdf#161846 avoid allocation in ContentNode::InsertNoel Grandin
which is fairly common Change-Id: I3b1ec65d880cb71b8894f292061e23376af177bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171224 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-29tdf#161846 use unordered_map in SfxItemPropertyMapNoel Grandin
with large property maps, even a binary search starts showing up, but we can do a O(1) search here by using a map Change-Id: Ie7916076073e6dd393f0a1fb5a0db1b973999408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171173 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-29cid#1554812 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1555227 COPY_INSTEAD_OF_MOVE cid#1555329 COPY_INSTEAD_OF_MOVE cid#1555384 COPY_INSTEAD_OF_MOVE cid#1555387 COPY_INSTEAD_OF_MOVE cid#1555399 COPY_INSTEAD_OF_MOVE cid#1555400 COPY_INSTEAD_OF_MOVE cid#1555406 COPY_INSTEAD_OF_MOVE Change-Id: I85dc45e2686c6b3e8b97a23872cb26416edc27c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171178 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-24cid#1556131 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1556135 COPY_INSTEAD_OF_MOVE cid#1556146 COPY_INSTEAD_OF_MOVE cid#1556164 COPY_INSTEAD_OF_MOVE cid#1556171 COPY_INSTEAD_OF_MOVE cid#1556177 COPY_INSTEAD_OF_MOVE cid#1556181 COPY_INSTEAD_OF_MOVE cid#1556182 COPY_INSTEAD_OF_MOVE cid#1556183 COPY_INSTEAD_OF_MOVE cid#1556192 COPY_INSTEAD_OF_MOVE cid#1556201 COPY_INSTEAD_OF_MOVE cid#1556208 COPY_INSTEAD_OF_MOVE cid#1556215 COPY_INSTEAD_OF_MOVE cid#1556224 COPY_INSTEAD_OF_MOVE cid#1556227 COPY_INSTEAD_OF_MOVE cid#1556228 COPY_INSTEAD_OF_MOVE cid#1556238 COPY_INSTEAD_OF_MOVE cid#1556246 COPY_INSTEAD_OF_MOVE cid#1556247 COPY_INSTEAD_OF_MOVE cid#1556288 COPY_INSTEAD_OF_MOVE cid#1556293 COPY_INSTEAD_OF_MOVE cid#1556305 COPY_INSTEAD_OF_MOVE cid#1556310 COPY_INSTEAD_OF_MOVE cid#1556317 COPY_INSTEAD_OF_MOVE cid#1556321 COPY_INSTEAD_OF_MOVE cid#1556322 COPY_INSTEAD_OF_MOVE cid#1556331 COPY_INSTEAD_OF_MOVE cid#1556339 COPY_INSTEAD_OF_MOVE cid#1556342 COPY_INSTEAD_OF_MOVE cid#1556351 COPY_INSTEAD_OF_MOVE cid#1556358 COPY_INSTEAD_OF_MOVE cid#1556370 COPY_INSTEAD_OF_MOVE cid#1556379 COPY_INSTEAD_OF_MOVE cid#1556390 COPY_INSTEAD_OF_MOVE cid#1556423 COPY_INSTEAD_OF_MOVE cid#1556532 COPY_INSTEAD_OF_MOVE cid#1556561 COPY_INSTEAD_OF_MOVE cid#1556662 COPY_INSTEAD_OF_MOVE cid#1556704 COPY_INSTEAD_OF_MOVE cid#1556730 COPY_INSTEAD_OF_MOVE cid#1556988 COPY_INSTEAD_OF_MOVE cid#1557071 COPY_INSTEAD_OF_MOVE cid#1557081 COPY_INSTEAD_OF_MOVE cid#1557177 COPY_INSTEAD_OF_MOVE Change-Id: I2c723f0fe9a4eefa62a68f47049ed690d06eb0ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170932 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-24tdf#147021 Use std::size instead of SAL_N_ELEMENTS in editengTuukka Orava
Change-Id: I6cf0557b1e44dff08fa1efa4aefa14dec276458e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167134 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2024-07-23improve ImpEditEngine::SetParaAttribs a littleNoel Grandin
avoid doing GetItemState if we don't have a wrong list (the common case) Change-Id: I3a1a22da657835ae37e8025d8ce21ad14d4e2c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-22Resolves tdf#159541 - Fix font color must not change depending on backgroundHeiko Tietze
Change-Id: I954c9e3f8502a5243c664ed0bf066fb4c4cb4ccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169991 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-07-22Improve the perf for pool item scanning..Noel Grandin
for large complex documents with lots of shapes. When that happens, we spend a lot of time scanning the std::unordered_set inside DefaultItemInstanceManager. Since most of our items are already capable of being hashed, and thus avoiding the scanning cost, make it so we can use the HashableItemInstanceManager most of the time. Change-Id: I43f4c04e956d316c976bea67d1941529d2d91182 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170813 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Tested-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-20Remove now unneeded osl/diagnose.hGabor Kelemen
followup to commit 57c228803e55ed343c6693de7d0857ad7d3cd9e3 Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-07-18tdf#55693: port test to CppunitTest_sw_autocorrectXisco Fauli
so we can get rid of TestAutoCorrDoc, only used for test purposes Change-Id: I0931fa76550358d071ebdec364fd6b55485bb3b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170680 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-18make EditSelection single-arg constructor explicitNoel Grandin
Change-Id: Id7a81db385dd3ca30daa37ba74a82d06c417a51c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170678 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-17tdf#150621 Changed Korean word counting to use wordsJonathan Clark
Previously, Writer counted characters for all CJK languages, rather than words. This is the correct behavior for Chinese and Japanese, which make extensive use of ideographs. However, it is not correct for Korean. This change adjusts the Writer word count algorithm to count Korean words, rather than Korean characters. Change-Id: I6e77136867baca1a7b51248886ee5fd7073ad364 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170621 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-07-15cid#1607843 Use of auto that causes a copyCaolán McNamara
and cid#1555160 Use of auto that causes a copy Change-Id: I2e2056ddbfb2d11d288a5b2df273e8bc049387fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170455 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-07-14tdf#145538 - related: Make tools::PolyPolygon iterableYuki Joou
This patch allows tools::PolyPolygon to be iterated using c++11's fancy range-based for-loops. It also upgrades a bunch of old-style for-loops iterating over polypolygons to the new style to make code more readable. Note that not all for-loops iterating over polypolygons have been upgraded, as I didn't find a way to automatically find those. I just did a few I found manually. Change-Id: Ifa8d0d44e6f0aa28fdcfd87d70058b12f48c1349 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168730 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-13use DeleteOnDeinit for EditEngine poolNoel Grandin
to avoid it accidentally coming to life during shutdown. Change-Id: I016a3396639c30350432b60c375c9777e551eb84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170425 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-11ITEM: replaced typeid/hash_code with SfxItemTypeArmin Le Grand (allotropia)
for the ItemInstanceManager the identification was done using typeid/hash_code, but that has problems - it is only defined to be identical for two instances of the same type, but other types can have the same code. Thanks to Noel to find that out, that is not reliable to be used. In the meantime we have SfxItemType to identify Item instances, so I changed the code to use that. The master had five additionally added Items that use the (2a) method of this mechanism (see comments in svl/source/items/globalpool.cxx for that). The gloal is to use as less as possible of this Items in that mechanism, so I checked. For four of these hashing was used, so the mem/runtime aspect is okay -> access is fast enough to prefer mem over runtime. Adding hashed Items (or any other fast mechanism) is always okay. One did not have that (SvxBoxItem) and used just the fallback ItemInstanceManager, so I removed it. We now have 18 Items for which that mechanism is initialized immediately. Noel also already moved the countdown for starting to use the mechanism in case of default handling (case (1), NUMBER_OF_UNSHARED_INSTANCES) to the unorderd_set. someting I had already planned to do, too - thanks! Change-Id: Icf6f427e5ea64672f385357aaad75bb5b7fcbf98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170314 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-07-11cid#1607892 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1607910 COPY_INSTEAD_OF_MOVE cid#1607818 COPY_INSTEAD_OF_MOVE cid#1557402 COPY_INSTEAD_OF_MOVE cid#1556530 COPY_INSTEAD_OF_MOVE cid#1557396 COPY_INSTEAD_OF_MOVE cid#1556522 COPY_INSTEAD_OF_MOVE cid#1555628 COPY_INSTEAD_OF_MOVE cid#1554705 COPY_INSTEAD_OF_MOVE Change-Id: Iae3fbf4a04bf3714f416995640b9d70fe204cf73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170321 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-09Revert "fix and simplify the ItemInstanceManager mechanism"Noel Grandin
This reverts commit 85fd526fc681a994415bb422090d1d23aa7d54f6. Change-Id: I5019f72f88497f50a77666d57f2d16c2749bd1c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170218 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-07cid#1545961 COPY_INSTEAD_OF_MOVECaolán McNamara
Change-Id: I40a4dc9bc13bfb769b2f9f15b0ab1ff9490639da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170076 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-05fill in more SfxItemType valuesNoel Grandin
found by doing some git grepping, we should now have values for all items in the hierarchy Change-Id: I397ca7e8f53f53737201385c4c8029b436895c1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170016 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-05fix asan buildNoel Grandin
after commit 85fd526fc681a994415bb422090d1d23aa7d54f6 "fix and simplify the ItemInstanceManager mechanism" The problem is that some *Item classes in sw/ and sc/ share WhichIds, and a whole bunch of SfxBoolItem subclasses share the same SfxItemType enum value. So we ended up mixing and matching objects of different concrete subclasses in a given *ItemManager collection. Add some asserts to the global pool code to catch issues like this earlier on. Add unique value of the SfxItemType enum for all the SfxBoolItem subclasses Change-Id: I3c8d4e02be1cd412b0292e973a6498df5f8e7102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-04make SvxColorItem hashableNoel Grandin
Change-Id: Ic96d53c113cd6ae5b805df5a8e80d4da7adfec59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169966 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-04make SvxAdjustItem hashableNoel Grandin
Change-Id: Ic5c78a0de4e7edafc0ba97bf69d43c377f7b5503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169633 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-04make SvxEscapementItem hashableNoel Grandin
Change-Id: Ic03c78f6dde68f5557d474147336fa62be6f3aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>