summaryrefslogtreecommitdiff
path: root/sw/source/filter/basflt
AgeCommit message (Collapse)AuthorFilesLines
2024-03-11Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-freeMike Kaganski2-4/+4
The events may be processed after the shell has been destroyed. This is happening reliably after commit e2bfc34d146806a8f96be0cd2323d716f12cba4e (Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable, 2024-03-11) when controlling LibreOffice from external Java scripts; but obviously, it could happen before as well. Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase. Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-16Deduplicate and unify SwNodes::Go(Next|Prev)(Section)Mike Kaganski2-27/+24
The "Next" methods are made static, just as "Prev" ones. Overloads taking SwNodeIndex and SwPosition are implemented using a common implementation function, to avoid code duplication. Change-Id: I4035188b5c29d19824cd6d031e05d668d5cf1e86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163443 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-18tdf#155917 sw: fix Repeat of Insert File with FlyMichael Stahl1-14/+2
There is a fly frame anchored on the 1st node of the inserted file. On Repeat, first SwUndoInsLayFormat::RepeatImpl() runs and inserts another fly, adding 3 nodes before the body of the document, then SwUndoInserts::RepeatImpl() creates SwPaM from its stored positions that is off by 3 nodes and invalid (crossing cell boundaries). The problem is that the way the Undo objects are created in SwReader::Read() is wrong, and there is alreay a better way not to create the SwUndoInsLayFormat manually from the outside but automatically in SwUndoInserts::SetInsertRange(), which is already used in Paste - why Insert File never used this has always been a mystery. The only difference appears to be that SwReader::Read() also handled at-page anchored flys which SetInsertRange() didn't, as these probably can't be part of a Paste, but that is easy to add. (regression from commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: I19d7a4d668ae8bed0986162da6ec5b5ea3118091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162208 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-30drop some IsFuzzing spam we don't needCaolán McNamara1-2/+1
Change-Id: I1da86b0be73713b506044c969930912b58b4d514 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161435 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30move IsFuzzing to comphelperCaolán McNamara1-1/+1
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-20use the cheaper variant of SfxItemPool::areSame where possibleNoel Grandin1-1/+1
Change-Id: I10a357293ef176fb8aba7a683cac9a73ac3ea897 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)1-1/+1
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-10-29tdf#157663 SW: Tracked change improve moveAttila Szűcs1-0/+1
Made accept/reject handle move redlines other pair, (moveto-movefrom) and handle the whole move redline, even if it is split into small pieces that separated from each other. Added unique ID to every move redline to help find their other parts. This move ID is generated in case of: move recognition moveing a paragraph. (directly create move redline with unique id without calling the recognition it is faster and more stable) (there are other cases that could be improved to not use recognition, but generate ID directly, like moveing selected partial text with mouse) Implemented the odt export/import of this move ID. it is a tag like this: "<loext:move-id>4</loext:move-id>" next to creator/date Improved the docx import to generate this move ID, so move redlines can find their other parts (Not changed Docx export... it works a bit, but far from perfect) Improved move reckognition: It can find them even if they are split into multiple parts differently. (like "ab"+"cd" == "a"+"bcd") Disabled this because of probably performance issue. made a complex unit test for it. Note: Left the move recognition on every place, to avoid as much regressions as possible.. but in the future, we may can disable it in some cases. Note2: We will have to keep move recognitnion, because there are documents from past, saved without any move informations in the file, and users expect to see move redlines there. (generated by the recognition.) Change-Id: If968d4235b676c5e538cfaf4187a4482a86eae9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157740 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158611 Tested-by: Jenkins
2023-10-03replace ErrorInfo with simpler mechanismNoel Grandin1-4/+4
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>
2023-07-28ReqIF: allow to output a single selected OLE objectMike Kaganski1-5/+9
To do that, "SelectionOnly" boolean propertyvalue is supported in the store arguments. Change-Id: I265e802256a9a678779bbd021dde9b0c87ca08b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155012 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-21Fix typoAndrea Gelmini1-1/+1
Change-Id: I37e5692fc75089fc889116f86fcb0846be1ba1b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154563 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-04[API CHANGE] Drop unused Excel_Lotus, W4W, Writer groupsGabor Kelemen1-14/+0
These seem to be unused ever since their 2002 addition in commit 72cbd26315bf935a0d6e2c9ffcdbea7d2ada07fb and some description in sw with: commit 7e30aa52adc691c6b468ec4e15089e32a418b919 Change-Id: I8e5c76e8483aa5dbd0934f4eabc16538366b26a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150994 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-05-01replace SwFrameFormats with sw::FrameFormats<SwFrameFormat*>Bjoern Michaelsen1-1/+1
- SwFrameFormats is now completely replaced by stronger typed sw::FrameFormats<>, thus remove it Change-Id: I7e655a83ba8cf01d1e68dccd1804c167e8daca9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150455 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2023-04-14loplugin:stringviewparam improvementsNoel Grandin1-3/+3
improve the check by checking for methods that exclude using string_view, rather than checking for methods that __can__ use string_view, which leads to exposing some holes in our o3tl/string_view.hxx coverage. Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-13Always update fields when loading documentSamuel Mehrbrodt1-1/+1
to make sure that table formulas are re-evaluated after loading. When a document has a wrong sum saved (which seems to happen sometimes), this sum is used until user clicks into the table or otherwise refreshes the formula. Change-Id: I5cc3f983524b395089c17aa35d8641847a388bad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148355 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-11-24add SwFormatAnchor::GetAnchorNode methodNoel Grandin1-1/+1
as a step towards switching away from using SwPosition inside SwFormatAnchor (because SwFormatAnchor wants to do weird stuff with the internals of SwPosition) Change-Id: I1527b6585d1e130b46e1e51b1e40eea043339d8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143205 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-15ofz#53416 AbrtCaolán McNamara1-1/+2
Change-Id: I5adb6a1a3987b74212b8606aef3826e7d2f77aaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142727 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-14tdf#151605 Add option to not include hidden text in ASCII filterSamuel Mehrbrodt1-0/+11
When setting this option, hidden text will not get exported/copied to clipboard. Change-Id: Id31aafc28ffb61a81bdc1412892f9e7997512f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141551 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-09-27sw: fix inserting fields between 2 adjacent input fieldsMichael Stahl1-1/+1
Primarily this is achieved by using GetTextAttrMode PARENT in SwCursorShell::CursorInsideInputField() and SwCursorShell::PosInsideInputField(). But this requires some refactoring to make this parameter available. Change-Id: I1a0ef4e3d93a6733d972544abfe07ddf929eb62c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140661 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-29use more SwPosition::AssignNoel Grandin1-4/+4
part of hiding the internals of SwPosition Change-Id: I9a0e393e755c8cb6a1b9857ecf0abbabf61a2840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-26use more SwPosition::AssignNoel Grandin1-17/+15
as part of the process of hiding the internals of SwPosition Change-Id: Id1f00a87b1097e7cc938450acf69e3bf5b71f167 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138868 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-26use more SwPosition::AssignNoel Grandin2-8/+4
as part of the process of hiding the internals of SwPosition Change-Id: Id8449baac2a17a8a6a7b89a083fa7071636d1222 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138858 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-20use more SwPosition::GetNodeNoel Grandin1-1/+1
Change-Id: Ib09191384e0ae3175a564edf9387e4de00ce851d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138583 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-20SwNodeIndex->SwNode in StealAttrNoel Grandin1-1/+1
Change-Id: Ieb808380b7eeeca1568945765c80d12c5ae9fc0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138570 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-20SwNodeIndex->SwNode in CalculateFlySizeNoel Grandin1-2/+2
Change-Id: Ieea800ff515fbbbdbe3ba89b6e5d1016955553d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14rename SwPaM::GetContentNode to GetPointContentNode/GetMarkContentNodeNoel Grandin1-1/+1
Using a parameter to select point/mark makes the code much harder to read Change-Id: Ic24098a6045ff2262d4c808228ded7bf8206fe8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14rename SwPaM::GetNode to GetPointNode/GetContentNodeNoel Grandin2-3/+3
Using a parameter to select point/mark makes the code much harder to read Change-Id: I4ac8b904ac423e2b99253b7e4b6adc72c8afe1a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138083 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14use more SwPosition::GetNode instead of nNodeNoel Grandin2-4/+4
as part of the process of hiding the internals of SwPosition. This just changes the places we are passing nNode to the constructor of SwNodeIndex Change-Id: I3dffba5df6c044a69da27b6a1254592695b976af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-12clang-tidy modernize-pass-by-value in swNoel Grandin2-2/+4
Change-Id: I9a3b33595e34a264baeede33672a0c090ae85157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-06make CheckNodesRange take a SwNode, not an SwNodeIndexNoel Grandin1-4/+4
as part of the process of hiding the internals of SwPosition Change-Id: If8e9426df4b78ebf95bbac54ebfdcff4b19b6292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04clang-tidy modernize-pass-by-value in swNoel Grandin1-10/+10
Change-Id: Ie5c250c64f95e649d33d3f3da7b54e81a4b81d0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137781 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04elide some SwNodeIndex temporariesNoel Grandin1-2/+1
Change-Id: I5391aa409d760870ead26d43b2287b23d2d40089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetContentIndexNoel Grandin2-5/+5
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nContent.GetIndex' | xargs perl -pi -e 's/\bnContent\.GetIndex/GetContentIndex/g' Change-Id: I12684071a6666c365dbadbab2a4b37cf51b274d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137695 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetNodeIndexNoel Grandin2-3/+3
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetIndex' | xargs perl -pi -e 's/\bnNode\.GetIndex/GetNodeIndex/g' Change-Id: I3616cea4c47595afe74f1aa8e3be553279f25d44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetNodeNoel Grandin1-4/+4
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetNode' | xargs perl -pi -e 's/nNode\.GetNode/GetNode/g' Change-Id: Id1937df1bd5a54677c2c1bbfb2d693a4e22a7b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137671 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-01introduce SwPosition::GetNodesNoel Grandin1-1/+1
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetNodes' | xargs perl -pi -e 's/nNode\.GetNodes/GetNodes/g' Change-Id: I05ac253803ef3f265edfa9be6f24f8f66b2b02c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137670 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-29use more SwPaM::StartEndNoel Grandin1-1/+1
which is more efficient than calling Start() and End() separately Change-Id: I41c99527bcb37728bb9a87f63ed654e0be3d1f0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137614 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-26elide some temporaries when constructing SwPositionNoel Grandin1-1/+1
because the resulting pointer manipulation is not free, the temporary has to be attached to a linked list and then immediately de-linked Also add some asserts to catch SwPosition being created with mis-matching nodes in the SwNodeIndex and SwContentIndex. Which flushes out some bugs in SwHTMLParser::NewDivision SwIntrnlSectRefLink::DataChanged where it was creating a SwPosition with the SwNodeIndex and the SwContentIndex pointing at different nodes. Change-Id: Iea69f5ffc5860eb654435e161bc544b412d4c245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137411 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25rename SwIndex->SwContentIndexNoel Grandin2-2/+2
to help my poor brain with the different kinds of index we have floating around Change-Id: I47ed223922170687d7e07812445aed66b3218230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-15tdf#119840 elide some dynamic_cast costNoel Grandin1-2/+6
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-06-02std::move SfxPoolItem into SfxItemSet where possibleNoel Grandin1-1/+1
found with the help of a temporary loplugin (which i have put into the store/ folder) Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin1-14/+14
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-04use string_view in comphelper::string::splitNoel Grandin1-6/+6
Change-Id: I4afe8aee85905ee35ba195b00b454aefa0ba38af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-28Recheck sw/ cxx files with IWYUGabor Kelemen1-1/+0
See tdf#42949 for motivation Change-Id: I8a8df68946297fad517b753d73e4373203a45ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-04use SfxItemSet::GetItemIfSet in sw/source/filterNoel Grandin1-7/+6
Change-Id: I8712a42236310a268fcbd7c47c01899333f4731c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-31tdf#106899 - Remove header definition of buffer sizeAndreas Heinisch1-2/+2
Change-Id: Ia7e3cc32c067afa0f376e52e0eb5cdc83ca2e4b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129082 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-01-20tdf#106899 - Import concordance file using appropriate charsetAndreas Heinisch1-0/+17
At the beginning of the import process for the various index entries, try to determine the correct character set for the tox concordance file. Change-Id: I3f48325a80ed08c2c06c295a24b2fc29ce1adf99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128194 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
2021-12-23tdf#92161 add GB18030 encoding to iodetectdtm1-0/+4
Change-Id: I0f1201cb9cba13f70cb3430772612aa00fcc4b58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127347 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin2-7/+7
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11loplugin:moveparam in swNoel Grandin1-2/+2
Change-Id: I4fa524e4abb101ed0ff1b8f97b84582b84aa1d07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>