summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2024-01-17Lok: make Ignore All list name independent on UI languageMike Kaganski
Fixes not working "Ignore All" context menu entry in e.g. German UI in Online. Change-Id: I761c9f65c89fb5c7e929ea20f2db4eff20f7d53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161170 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-17tdf#154248 Impress: fix color of hyperlinkAttila Szűcs
Added a new FindAttrib method that searches in the attribs a bit different. The original FindAttrib searches in attribs as if their position intervals are closed from both side [Start,End]. However, the actual attribs array was created using PaMs as positions, and these are right-opened intervals [Start,End) Change-Id: I9a46b6b27ce447366fc20af1b46fd60b5c745359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161836 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-16calc: on editing invalidation of view with different zoom is wrongMarco Cecchetti
This patch fixes the following invalidation issue: There are 2 views with different zoom levels. In a view text editing for a cell occurs. The other view is not invalidated properly: the computed invalidation rectangle is misplaced. Change-Id: I72db61486647640ee68e6cb2db96b2902de5b997 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160303 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> 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/+/162161 Tested-by: Jenkins
2024-01-15Keep selection as after copying the textPranam Lashkari
This also aligns code with 'else' branch behaviour problem: in online when coping a slide with comment, comment text was never copied in online, it required document to reload to show it correctly Change-Id: I6d444c10808ef23f282370b4b305c41eb5043b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160812 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit db7faa06762ac902ff56ecbab3fff763951146e1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160943 Tested-by: Jenkins
2024-01-12tdf#159049 use RTF_LINE for EE_FEATURE_LINEBR for copyRegina Henschel
Copy of simple text uses ImpEditEngine::WriteItemAsRTF() method. Error was, that in case of a line break ('\n') the string OOO_STRING_SVTOOLS_RTF_SL was written, but it needs to be the string OOO_STRING_SVTOOLS_RTF_LINE. Change-Id: I1c2ff2087c563b26e26d8768dfcfd1645be91d2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161842 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161954
2023-12-29Resolves: tdf#158608 put calc spelling suggestions at start of context menuCaolán McNamara
a problem since: commit 57544b075b77331b7b1cc7cb18898a52e7bb21a6 Author: Caolán McNamara <caolanm@redhat.com> Date: Sat Dec 12 21:21:09 2020 +0000 weld editview menu Change-Id: Id2ffd7f4f3da15d5c0ebc1c7a17247e8ab1ec5bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161327 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-12-19tdf#158703: return updated position from FnAddNonBrkSpaceMike Kaganski
The paragraph text may become shorter after the function succeeds, because it may remove arbitrary number of preceding spaces; since the position may then be used to access data in the string in the caller, we need to update it, to avoid use of old position (which may point beyond the string, and produce a crash; or it may point to a wrong position in it). Change-Id: Ib1b4b63cbd7150e0f69c97032e3410db7dadd4dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160924 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 1325d66a7f8657aaf9951a0664fbf14cca86905b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160934 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-12-18tdf#158186 Fix saving ApplyNumberingAfterSpaceSamuel Mehrbrodt
Change-Id: I6880f75c140f6e800bbdb6c56dd1ff166a3191d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160916 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> (cherry picked from commit cefe7488930895a971dce41a286144dae39f57d4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160930
2023-12-08tdf#129357 editeng: show soft hyphen in text boxes and shapesLászló Németh
Shapes and text boxes didn't show the optional hyphen at line break. Change-Id: I5cc842964fc91571e5c55995981de697da966b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160453 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2023-12-07cid#1546503 Using invalid iteratorCaolán McNamara
and cid#1546284 Using invalid iterator cid#1546275 Using invalid iterator cid#1546049 Using invalid iterator cid#1545929 Using invalid iterator cid#1545870 Using invalid iterator cid#1545668 Using invalid iterator cid#1545420 Using invalid iterator Change-Id: I3ad3000631b4be5917b9c5f49f21b8cc003a309c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159056 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-05cid#1546503 Using invalid iteratorCaolán McNamara
and cid#1546284 Using invalid iterator Change-Id: I9ff3498b65ce392dbe859566b49e60a31e0779f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160370 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-04cid#1545597 Using invalid iteratorJulien Nabet
and : cid#1545537 Using invalid iterator cid#1545508 Using invalid iterator cid#1545494 Using invalid iterator cid#1545478 Using invalid iterator cid#1545427 Using invalid iterator cid#1545420 Using invalid iterator cid#1545400 Using invalid iterator cid#1545300 Using invalid iterator cid#1545258 Using invalid iterator cid#1545257 Using invalid iterator cid#1545200 Using invalid iterator cid#1545183 Using invalid iterator Change-Id: Ibf3a41902f34286967195c5c3b22e337a4b06809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160322 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04cid#1545810 Using invalid iteratorJulien Nabet
and : cid#1545802 Using invalid iterator cid#1545745 Using invalid iterator cid#1545717 Using invalid iterator cid#1545675 Using invalid iterator cid#1545668 Using invalid iterator cid#1545639 Using invalid iterator cid#1545634 Using invalid iterator cid#1545629 Using invalid iterator cid#1545620 Using invalid iterator cid#1545608 Using invalid iterator cid#1545607 Using invalid iterator cid#1545601 Using invalid iterator Change-Id: I403842175f64a570d7e52fba7c3e03bf21b7d05b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160320 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04cid#1546021 Using invalid iteratorJulien Nabet
and : cid#1545983 Using invalid iterator cid#1545969 Using invalid iterator cid#1545949 Using invalid iterator cid#1545929 Using invalid iterator cid#1545911 Using invalid iterator cid#1545910 Using invalid iterator cid#1545886 Using invalid iterator cid#1545870 Using invalid iterator cid#1545813 Using invalid iterator Change-Id: I2ad10c2a9affd348050a4abe0917a90927a52547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160317 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04cid#1546275 Using invalid iteratorJulien Nabet
and : cid#1546219 Using invalid iterator cid#1546088 Using invalid iterator cid#1546070 Using invalid iterator cid#1546061 Using invalid iterator cid#1546055 Using invalid iterator cid#1546049 Using invalid iterator Change-Id: I6f3a786852b5c262d60c3195e446a37967ed9b59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160311 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-04cid#1546422 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546416 COPY_INSTEAD_OF_MOVE cid#1546415 COPY_INSTEAD_OF_MOVE cid#1546391 COPY_INSTEAD_OF_MOVE cid#1546390 COPY_INSTEAD_OF_MOVE cid#1546317 COPY_INSTEAD_OF_MOVE cid#1546252 COPY_INSTEAD_OF_MOVE cid#1546251 COPY_INSTEAD_OF_MOVE cid#1546249 COPY_INSTEAD_OF_MOVE cid#1546243 COPY_INSTEAD_OF_MOVE cid#1546195 COPY_INSTEAD_OF_MOVE cid#1546193 COPY_INSTEAD_OF_MOVE cid#1546137 COPY_INSTEAD_OF_MOVE cid#1545738 COPY_INSTEAD_OF_MOVE cid#1545782 COPY_INSTEAD_OF_MOVE Change-Id: I10d5091aa72b682371764b8a18cc5062e272c031 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160285 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-03cid#1546503 Using invalid iteratorCaolán McNamara
and: cid#1546480 Using invalid iterator cid#1546479 Using invalid iterator cid#1546454 Using invalid iterator cid#1546419 Using invalid iterator cid#1546410 Using invalid iterator cid#1546150 Using invalid iterator cid#1546039 Using invalid iterator cid#1545831 Using invalid iterator cid#1545736 Using invalid iterator cid#1545701 Using invalid iterator cid#1545630 Using invalid iterator cid#1545381 Using invalid iterator Change-Id: I9e151b623f751ee1e982b5da0011ff08ab0ad5e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160270 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-01cid#1546413 silence Using invalid iteratorCaolán McNamara
sample to test silencing this Change-Id: I73a8e22a5266367d7b2c76aa00d38d40431b4841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160213 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-25tdf#158317 fix cleanup of SfxPoolItems in editengArmin Le Grand (allotropia)
It is not possible to use implCreateItemEntry/implCleanupItemEntry, that is tooling limited *by purpose* to svl/Item/ItemSet stuff. But what I can do is to do that SfxPoolItemHolder I already talked/thought about. It is a helper that can safely hold a SfxPoolItem in cases where an SfxItemSet is too expensive. Think about it as a SfxItemSet for a single item. That solves the problem why DirectPutItemInPool/DirectRemoveItemFromPool is used in general (each usage is a 'compromize'). Did that now, works well. Editengine is now free of DirectPutItemInPool/DirectRemoveItemFromPool. Replaced ::CursorMoved with checkAndDeleteEmptyAttribs since all these got static with no longer need to DirectRemoveItemFromPool. Corrected create/delete counters. Change-Id: Ia6e53f48ac2e479b461546515e68697039b5b628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159931 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-25tdf#156243 Fix off-by-one bug for autocorrectMatt K
This change removes the "-1" from the code that applies the autocorrection so that the entire string to be autocorrected is replaced, instead of leaving off the last character. Also, the starting character of the string is preserved (i.e. non-bold if changing to bold) by adding 1 to the start position; this is for the case when the user cancels the autocorrect dialog. Change-Id: Ibe500a1ba0ca5b12ec9c918b51353074b8dd12ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154685 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-20Extended loplugin:ostr: editengStephan Bergmann
Change-Id: I5dbd4047d2b66c12475020abfdd2b8f16d65a8f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159714 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-18c++20: use std::erase(_if) instead of std::remove(_if)+erase (part 4)Julien Nabet
Change-Id: I6af5501e3fde07024dcc74f00c8fd69bd369d8d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159613 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18tdf#157716 - Rename "Language settings" to "Languages and Locales"t-aswath
Change-Id: Idd31b18c87998b03d884e7aa17197c459241abf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159315 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2023-11-15tdf#158031 editeng: rename GetFieldAtCursorJustin Luth
because it doesn't really get the field at the cursor, and certainly is not similar to SelectFieldAtCursor. It first gets the field under the mouse. Then, if there is a selection, it gets the selected field, else it looks for the field on either side. There were LOTS of places where it probably had not been used properly. Most of those are gone now, so it is easier to rename the function. Change-Id: I1a64af24092582cf865509d2a474080258edd76c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159022 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_REMOVE_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This patch depends on prior patches for this bug report. This is mostly just a clean-up patch to make it function like the others. It was a lot like EDIT_HYPERLINK - because it selects the hyperlink first, so it didn't need any fixing up. However, there was one instance where KEYBOARD selection of Remove Hyperlink in Draw could have been cancelled/slot-invalidated if the mouse had been moved away from the field. Change-Id: Id1b911f2548b8e2751ae34a2158ee4984dfc9a59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159018 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_COPY_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This patch depends on prior patches for this bug report. This fixes nothing being copied if the mouse was right-clicked over that second half of the hyperlink (since a "smart" positioning set the cursor after the field instead of before it). Change-Id: I6c933224cd8d36f48f4e1f0aafaa1f45555e46d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159015 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_*_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This fixes the GTK3 problem where only the first half of the link successfully ran SID_EDIT_HYPERLINK against an editeng hyperlink. Fixed for Writer and Calc editeng hyperlinks (i.e. in textboxes). TODO: fix SID_COPY_HYPERLINK (which doesn't SelectFieldAtCursor) The problem showed up when the menu option was added because the mouse was over an unselected field, but when the mouse moved to select the menu option, the slot was not considered valid anymore if the cursor had moved behind the field. (The right-click to open the context menu puts the cursor before or after the field.) Now, by checking for a field-before-the-cursor during validation, the field is found and the command is not prevented from running. Once this is all in place, some older commits from Caolan should be able to be reverted. (Strangely, SID_OPEN_HYPERLINK and SID_REMOVE_HYPERLINK seem to run before the slot is invalidated. No idea why they are different. For GEN, the popup usually either kept the pre-menu mouse position, or else it always runs the command before the slot invalidates.) Change-Id: If992b3fdc94d89162b60447458cabced2d5e3f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158856 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15related tdf#158031 editeng: GetFieldAtSel...(+look before cursor)Justin Luth
Nearly a No-Functional-Change, but not quite. For practical and intentional purposes, it can be considered NFC. Although I didn't find an actual case where it happened, a code read says SelectFieldAtCursor COULD select a non-field. It assumed that previous code had already identified that there must be a field here. Well, I want to extend GetFieldAtSelection to check backwards to solve bug 158031 anyway, so I might as well "fix" this assumption to only select a valid field. This function REALLY depends on GetFieldAtSelection working properly. So, I put some asserts in to ensure that stays true. Change-Id: Ie22945a418497511501b04df5e17071d977cbd5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158855 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-11-11use more concrete type in ImpEditEngine::SetUndoManagerNoel Grandin
instead of dynamic_cast'ing to the type we want, and __ignoring__ the parameter if it is not, just adjust the type that we want, which luckily everything is already sending Change-Id: If083e11c9818cdcae199afc1261efbdb652e1c76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in accessibility::AccessibleContextBaseNoel Grandin
Change-Id: Ibd71c2e809731114d4415754c8fd94110bd5736b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10tdf#157363 add HTML format when pasting into draw textOliver Specht
adds HTML to paste(special) in draw text in impress/draw/calc/writer Change-Id: Iaede82e1b3d48be362b70bd631e7f912b02b9822 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158659 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)
To understand this, some look back in history will be needed to see why it is as it is today. In some (reworked) comments 'poolable' is described as flag to hold Items in the ItemPool, also always having only one incarnation of each possible Item. This is not the original intention, but a side-effect. The reason is what the binary format in the office did: To save a document, the Objects & the Pool were saved, *not* individual Items *together* with the objects. The Pool was completely (binary) saved (and loaded) in one run. Temporary IDs were used to represent at the objects in file which Items were referenced. This *required* to have only one incarnation per item to have a minimal binary file size, thus this high effort was put into this. At doc load, the pool was loaded, all Items were set to RefCount 5000, the references from the objects were restored and then for each Item the RefCount was lowered by 5000 again and - if being zero - deleted. Items for UI were marked 'non-poolable' to *not* safe them with the document, so poolable was a flag to decide if that Info/Item was to be saved with the document - or more direct: if it is Model Data. Items are small, so if we prefer runtime it is okay to no longer being strict with this, anyways does not happen often and has only marginal memory effects - compared to runtime effects/savings. Other problems which this caused: One example is that objects in the UNDO stack were still in the pool, so e.g. deleted pictures were saved with the document despite no longer being used (!). That is the reason we have an UndoItemPool and a method MigrateItemPool to move stuff to that Pool when objects go to the UNDO stack - all of this is also no longer needed. Cleaning this up means to ideally have all items in the SfxItemSet, no longer at the Pool. The Pool should be reduced to a 'Default-Item- Holder' and a 'Slot-to-whichId-mapper'. This needs thorough cleanups/removals, but will be worth it because that massive simplification(s) will increase safety an runtime and make migrating to the goal of completely type-based ItemSet stuff easier for the future. Hopefully only view code in the office working with items will have to be changed for this. In this 1st step I already found that some 'compromizes' will be needed: - There are still Items that have to be at the pool to make the Surrogate-stuff working. This gives back all Items in a Pool of a type and is used in ca. 80 cases. Each one looks at these Items *without* context (e.g. a SfxItemSet at an Object would be a context), so if e.g. a dialog is open that temporarily uses Items of that type you would also get these - without knowing about it... To make that work there is still a mechanism to have Items at the Pool, but now just *registering* (and un-reg) them without any sort/search/ remove needs. Also only for Items that need that, so I evaluated the GetItemSurrogates calls and added some asserts when GetItemSurrogates tries to access an unregistered item type which needs to be added. - Another caveat is that there are about 250 places that directly put Items to the Pool (not all remove these, that is done at pool deletion, so some kind of silent 'garbage-collection' is in place). To have an overview I renamed the accessing methods to separate them from the same functionality at the SfxItemSet, which had the same names. An implementation does still add these directly to the pool, there is no way to cleanup those usages for now. In principle all these should be changed to hold the data at an SfxItemSet. I am still hunting problems. But you can build the office, all apps work (including chart) and you can do speed comparisons already. There are test throwing errors, so I hunt these now. It is hard to give an estimation about how much more changes/corrections will be needed. Completed adaptions to new registered Items at Pool, that reduces the failing tests. Still many that I need to hunt. Added stuff to work around that 'compromize' in ScDocumentPool: It overloads ::PutImpl of the pool to implement special handling for a single Item in SC, the ScPatternAttr. In former code that method was used from SfxItemSet and ::PutImpl at the pool directly, so it was only used in one place. I am not sure if it was used from the SfxItemSet functionality, but better offer it for now. To not waste too much runtime the callbacks depend on the boolean 'NewItemCallback' at the SfxPoolItem, it gets set for that single Item in SC and only then the callbacks trigger. I hope to get rid of those again, e.g. newItem_UseDirect is only needed since we have no 'real' StaticPoolDefaults currently - another thing that needs to be cleaned up in a next step. Since usages of impl(Create|Cleanup)ItemEntry and Direct(Put|Remove)ItemInPoolImpl got more and more similar I decided to unify that: move impl(Create|Cleanup)ItemEntry to tooling, make it globally available in svl and use it also directly for Direct(Put|Remove)ItemInPoolImpl. This slightly increases the failing tests again, but only since in Direct(Put|Remove)ItemInPoolImpl that fallback (e.g. tryToGetEqualItem) was used before, thus this is the same class of errors (SfxPoolItem ptr-compare) as the others which I will need to find anyways. Also fixed some missing stuff. Have now idenified and redirected all SfxPoolItem ptr-compares to be able to debug these - one cause for the remaining errors is probably that before with bPoolable those often were sufficient, but are no longer. Used the [loplugin:itemcompare] and a local clang build to do so, see https://gerrit.libreoffice.org/c/core/+/157172 Stabilized Direct(Put|Remove)ItemInPoolImpl forwards, added parameter to implCreateItemEntry to signal that it gets called from DirectPool stuff - currently needed. Hopefully when getting rid of that DirectPool stuff we can remove that again Added two more debug functionalities: - Added a SerialNumber to allow targeted debugging for deterministic cases - Added registering & listing of still-allocated SfxPoolItems at office shutdown Found PtrComp error in thints.cxx - POC, thanks to areSfxPoolItemPtrsEqual. Will hopefully help more with other tests Found some wrong asserts/warnings where I was too careful and not finding something/succeeding is OK, fixes some UnitTests for SC For SC I now just tried to replace all areSfxPoolItemPtrsEqual with the full-ptr-content compare SfxPoolItem::areSame. I also needed to experiment/adapt the newItem_Callback solution but got it working. Did that replacement now for SW too, found some places where the direct ptr compare is OK. Continued for the rest of occurrences, now all 160 places evaluated. Also done some cleanups. Massive cleanups of stuff no longer needed with this paradigm change. Also decided to keep tryToGetEqualItem/ITEM_CLASSIC_MODE for now. It is used for *one* Item (ScPatternAttr/ATTR_PATTERN) in SC that already needs many exceptions. Also useful for testing if errors come up on this change to test if it is related to this. Added forwarding of target Pool for ::Clone in SvxSetItem and SvxSetItem, simplified SfxStateCache::SetState_Impl and returned to simple ptr compares in SfxPoolItem::areSame to not do the test in areSfxPoolItemPtrsEqual. Debugged through UITest_calc_tests9 and found that in tdf133629 where BoxStyle is applied to fully selected empty calc the Item- reuse fallback has to be used not only for ATTR_PATTERN, see comment @implCreateItemEntry. Maybe more... Problem with test_tdf156611_insert_hyperlink_like_excel. Found that in ScEditShell::GetFirstURLFieldFromCell the correct SvxURLField is found and returned as ptr, but it's usage crashes. That is due to the SfxItemSet aEditSet used there gets destroyed at function return what again deletes the SvxFieldItem that is holding the SvxURLField that gets returned. This shows a more general problem: There is no 'SfxPoolItemHolder' that safely holds a single SfxPoolItem - like a SfxItemSet for a single Item (if Items would be shared_ptrs, that would be a safe return value). That will be needed in the future, but for now use another solution: Since I see no reason why EE_FEATURE_FIELD should not be shareable I wil change this for ow in the SfxItemInfo for EditCharAttribField. That way the Item returned will be shared (RefCnt > 1) and thus not be deleted. I changed the return value for GetURLField() and GetFirstURLFieldFromCell() in ScEditShell: At least for GetFirstURLFieldFromCell the return type/value was not safe: The SvxFieldItem accessed there and held in the local temporary SfxItemSet may be deleted with it, so return value can be corrupted/deleted. To avoid that, return a Clone of SvxFieldData as a unique_ptr. With all that UnitTest debugging and hunting and to get the paradigm change working to no longer rely on shared/pooled items I lost a little bit focus on speed, so I made an optimization round for the two central methods implCreateItemEntry/implCleanupItemEntry to get back to the speed improvements that I detected when starting this change. It was mainly lost due to that 'strange' chained pool stuff we have, so I added to detect the target pool (the one at which the WhichID is registered) directly and only once. Next thing to cleanup will/should be the pool and it's concept, all this is not needed and really costs runtime. Since implCreateItemEntry/implCleanupItemEntry are executed millions of times, each cycle counts here. Had an error in the last changes: pool::*_Impl methods use index instead of WhichID - most of them. Another bad trap, I really need to cleanup pool stuff next. Change-Id: I6295f332325b33268ec396ed46f8d0a1026e2d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157559 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-07tdf#158083: RTF: drop export for \pgdsctblVasily Melenchuk
This table is not standard extension to RTF format. It is not described in RTF specification and even is not used by Writer on import these days. Change-Id: I52f27dfd30877d461ad535b7847f40dd4c6f4ea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158986 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-03NFC related tdf#158031 editeng: flatten and simplify the codeJustin Luth
No Functional Change intended. Just some slight optimizing that leads to some nice flattening. Change-Id: I46d20a56821f218973c728f51575b104e6020500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158854 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-11-02this should never be null, so we can use a referenceCaolán McNamara
Change-Id: I682e30cfb4fd63a4f906bfb875cafdf77ae9cfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158805 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-02crash seen in EditView::GetTransferable in calcCaolán McNamara
if (pColor->getComplexColor().getType() == model::ColorType::Unused) (gdb) print pColor $10 = <optimized out> but: (gdb) print *pSet $12 = {_vptr.SfxItemSet = 0x7f7cd56f3198 <vtable for SfxItemSet+16>, m_pPool = 0x31e7d880, m_pParent = 0x0, m_ppItems = 0x33ecece0, m_pWhichRanges = { m_pairs = 0x7f7cd47b2480 <svl::Items_t<(unsigned short)4008, (unsigned short)4064>::value>, m_size = 1, m_bOwnRanges = false}, m_nCount = 1, m_bItemsFixed = false} (gdb) print *(pSet->m_ppItems) $11 = (const SfxPoolItem *) 0x0 so, apparent null deref of pColor #0 SvxUnoTextRangeBase::_getOnePropertyStates (pSet=0x7ffe47b3ded0, pMap=0x7f7cd5a50600 <ImplGetSvxTextPortionPropertyMap()::aSvxTextPortionPropertyMap+384>, rState=@0x38ae2d4c: com::sun::star::beans::PropertyState::PropertyState_DIRECT_VALUE) at editeng/source/uno/unotext.cxx:1179 #1 0x00007f7cd1e6f5be in SvxUnoTextRangeBase::_getPropertyStates (this=0x3543bc00, PropertyName=..., nPara=nPara@entry=-1) at editeng/source/uno/unotext.cxx:1057 #2 0x00007f7cd1e6fa12 in SvxUnoTextRangeBase::getPropertyStates (this=<optimized out>, aPropertyName=...) at editeng/source/uno/unotext.cxx:1031 #3 0x00007f7cd41e723b in (anonymous namespace)::FilterPropertiesInfo_Impl::FillPropertyStateArray (this=this@entry=0x32e94820, rPropStates=std::vector of length 0, capacity 0, rPropSet=..., rPropMapper=..., bDefault=bDefault@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:327 #4 0x00007f7cd41e9230 in SvXMLExportPropertyMapper::Filter_ (this=this@entry=0x34dc72a0, rExport=..., xPropSet=..., bDefault=bDefault@entry=false, bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=0x0) at xmloff/source/style/xmlexppr.cxx:651 #5 0x00007f7cd41ea026 in SvXMLExportPropertyMapper::Filter (this=this@entry=0x34dc72a0, rExport=..., rPropSet=..., bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:526 #6 0x00007f7cd42dbbcd in XMLTextParagraphExport::Add (this=this@entry=0x37110830, nFamily=nFamily@entry=XmlStyleFamily::TEXT_TEXT, rPropSet=..., aAddStates=..., bDontSeek=bDontSeek@entry=false) at xmloff/source/text/txtparae.cxx:685 #7 0x00007f7cd42dd09f in XMLTextParagraphExport::exportTextRange (this=this@entry=0x37110830, rTextRange=..., bAutoStyles=bAutoStyles@entry=true, rPrevCharIsSpace=@0x7ffe47b3eef0: true, openFieldMark=@0x7ffe47b3ec34: XMLTextParagraphExport::NONE) at xmloff/source/text/txtparae.cxx:3731 #8 0x00007f7cd42e57df in XMLTextParagraphExport::exportTextRangeEnumeration (this=this@entry=0x37110830, rTextEnum=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, rPrevCharIsSpace=@0x7ffe47b3eef0: true) at xmloff/source/text/txtparae.cxx:2438 #9 0x00007f7cd42ea746 in XMLTextParagraphExport::exportParagraph (this=this@entry=0x37110830, rTextContent=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, rPropSetHelper=..., eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2378 #10 0x00007f7cd42e0634 in XMLTextParagraphExport::exportTextContentEnumeration (this=this@entry=0x37110830, rContEnum=..., bAutoStyles=bAutoStyles@entry=true, rBaseSection=..., bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, pRangePropSet=<optimized out>, eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2008 #11 0x00007f7cd42e113a in XMLTextParagraphExport::exportText (this=this@entry=0x37110830, rText=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, eExtensionNS=eExtensionNS@entry=TextPNS::ODF) at xmloff/source/text/txtparae.cxx:1762 #12 0x00007f7cd1e78669 in XMLTextParagraphExport::collectTextAutoStyles (bExportParagraph=true, bIsProgress=false, rText=..., this=<optimized out>) at include/xmloff/txtparae.hxx:459 #13 (anonymous namespace)::SvxXMLTextExportComponent::ExportAutoStyles_ (this=0x7f7cb4522930) at editeng/source/xml/xmltxtexp.cxx:341 #14 0x00007f7cd406121c in SvXMLExport::ImplExportAutoStyles (this=this@entry=0x7f7cb4522930) at xmloff/source/core/xmlexp.cxx:1127 #15 0x00007f7cd40645f5 in SvXMLExport::exportDoc (this=0x7f7cb4522930, eClass=<optimized out>) at xmloff/source/core/xmlexp.cxx:1380 #16 0x00007f7cd1e78d64 in SvxWriteXML (rEditEngine=..., rStream=..., rSel=...) at editeng/source/xml/xmltxtexp.cxx:321 #17 0x00007f7cd1da1d0c in ImpEditEngine::WriteXML (this=this@entry=0x34f87990, rOutput=..., rSel=...) at editeng/source/editeng/impedit4.cxx:270 #18 0x00007f7cd1d88881 in ImpEditEngine::CreateTransferable (this=0x34f87990, rSelection=...) at editeng/source/editeng/impedit2.cxx:3843 #19 0x00007f7cd1d4c091 in EditEngine::CreateTransferable (this=<optimized out>, rSelection=...) at editeng/source/editeng/editeng.cxx:816 #20 0x00007f7cd1d5c91a in EditView::GetTransferable (this=0x33eb8190) at editeng/source/editeng/editview.cxx:662 #21 0x00007f7cc2c03eac in ScModelObj::getSelection (this=<optimized out>) at sc/source/ui/unoobj/docuno.cxx:904 Change-Id: Idb8cbbebe02188678f9c1b17e80cf89feffa9de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158803 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-21ofz#63406 Timeouts with huge fontsCaolán McNamara
reduce limit further when fuzzing Change-Id: I66345f78a5375a6415f0b25ba736c41fd27ce8d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158308 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: editengStephan Bergmann
Change-Id: I9ea2bdf3b939f260184bf793e2b91cd37e9d80c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158190 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19tdf#147021 Use std::size() in editengWillian Pessoa
Change-Id: Id6496b34a3601fb021af2894fbf7f876b444145f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157895 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12editeng: move the methods into Test class definitionTomaž Vajngerl
This makes makes all the Test class methods contined in the class definition body, so more readable and less noise for the actual test definitions. Change-Id: I3ea177f27aa868a396e537b1682ce91d93c1208e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157837 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-12prefix some members of ImpEditEngineTomaž Vajngerl
Change-Id: I9975bed2af853374a10b87c468840ff22b230157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157833 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-09cid#1547102 Uninitialized pointer fieldCaolán McNamara
Change-Id: Id713220c13df8b557b637d305da158abc5d5421f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157694 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-08ofz#62236 avoid TimeoutCaolán McNamara
Change-Id: Ic7207ece03a30d8ffefadbf072d4da5fa66dfc12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157688 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-07tdf#157568 After deleting the content of a cell by pressing the delete..Noel Grandin
.. key, Orca still speaks the content. this reverts commit f22cb3dfab413a2917cd810b8e1b8f644a016327 Author: Noel Grandin <noelgrandin@gmail.com> Date: Mon Jun 12 20:02:19 2023 +0200 tdf#155376 weakly cache ScAccessibleCell which was a nice idea, but means that we would need to have some way of updating the ScAccessibleCell when the associated cell data changes. Which is likely to be complicated. So return to creating new ScAccessibleCell objects all the time, but fix them to not leak. Change-Id: Ie17ee5c950c9809d4c7281f93761584f75256121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157673 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-03replace ErrorInfo with simpler mechanismNoel Grandin
Instead of returning ErrCode class everywhere, return a new class ErrrCodeMsg, which combines an ErrCode with the other parameters that are used to control the error reporting. I do not change everything that uses ErrCode here, I started from SfxBaseController/SfxMedium and worked outwards. This change serves two purposes (1) Replace the extremely whacky ErrorInfo mechanism we were using to smuggle information into the error handler reporting mechanism with a very straightforward approach of just combining it into the error class. (2) Allow us to capture the source location that produced the error, which makes debugging the source of a problem soooo much easier. Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>