summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2024-08-20cid#1557276 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1556657 COPY_INSTEAD_OF_MOVE cid#1556654 COPY_INSTEAD_OF_MOVE cid#1556397 COPY_INSTEAD_OF_MOVE cid#1556339 COPY_INSTEAD_OF_MOVE Change-Id: I20be9764c327ebda9beeb62b54c399998180bfab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172098 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-20tdf#158556 no need to create another cursor hereNoel Grandin
we already have one for the insertion point Shaves 2% off load time Change-Id: I86d2d54c0eda3b74fde8929f075f744da4a083f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-20tdf#158556 avoid dynamic_castNoel Grandin
reduces load time by 2% Change-Id: I8b31257baacd49657cccf7cc6bd04408581803c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172102 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-20cid#1608021 silence Overflowed integer argumentCaolán McNamara
Change-Id: Icba77c62877c552b1754dbe4e408e2d0a44d8e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172097 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-19sw: remove duplicated checkXisco Fauli
after 3a961b522a82d41a0a3cd09b7fbb9bde6b79f3d8 "sw: use SAL_RET_MAYBENULL in GetTableBox()" Kudos to M. Stahl for flagging it Change-Id: I44879da9206a1c04869b22c7a7b3bb18955f1953 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172052 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-08-19tdf#161139: add unit test to sw filters passJustin Luth
make CppunitTest_sw_filters_test Change-Id: I6764dfb19ec8af12da44821bf1a55ff300780369 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172051 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2024-08-19tdf#158556 only set header flags onceNoel Grandin
which shaves 5% off the load time. I suspect this is a copy/paste of the similar logic in DomainMapper_Impl::PushPageHeaderFooter where it says // Set both sharing left and first to off so we can import the content regardless tha what value // the "titlePage" or "evenAndOdd" flags are set (which decide what the sharing is set to in the document) I suspect that commit 4b0fa253a4540f5461397815d290586f9ddabe61 Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Date: Tue Nov 28 13:46:21 2023 +0900 tdf#136472 adjust ooxml import to handle first header/footer sufficiently cleaned up the header/footer handling that this is no longer necessary. Change-Id: I05145c0f3706bd100dc200a949b9a05a1600d370 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-19cid#1557694 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1557162 COPY_INSTEAD_OF_MOVE cid#1556896 COPY_INSTEAD_OF_MOVE cid#1556893 COPY_INSTEAD_OF_MOVE cid#1556873 COPY_INSTEAD_OF_MOVE cid#1556872 COPY_INSTEAD_OF_MOVE cid#1556789 COPY_INSTEAD_OF_MOVE cid#1556570 COPY_INSTEAD_OF_MOVE cid#1556519 COPY_INSTEAD_OF_MOVE cid#1556516 COPY_INSTEAD_OF_MOVE cid#1556451 COPY_INSTEAD_OF_MOVE cid#1556396 COPY_INSTEAD_OF_MOVE cid#1556237 COPY_INSTEAD_OF_MOVE cid#1556113 COPY_INSTEAD_OF_MOVE cid#1556094 COPY_INSTEAD_OF_MOVE cid#1555991 COPY_INSTEAD_OF_MOVE cid#1555982 COPY_INSTEAD_OF_MOVE cid#1555885 COPY_INSTEAD_OF_MOVE cid#1555702 COPY_INSTEAD_OF_MOVE cid#1555610 COPY_INSTEAD_OF_MOVE cid#1555450 COPY_INSTEAD_OF_MOVE cid#1555327 COPY_INSTEAD_OF_MOVE cid#1555145 COPY_INSTEAD_OF_MOVE Change-Id: I38cc1a38e8cb2c33f33e0fc3afd34a0fb39e5ec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172028 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-18cid#1556978 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1556976 COPY_INSTEAD_OF_MOVE cid#1556965 COPY_INSTEAD_OF_MOVE cid#1556956 COPY_INSTEAD_OF_MOVE cid#1556953 COPY_INSTEAD_OF_MOVE cid#1556946 COPY_INSTEAD_OF_MOVE cid#1556934 COPY_INSTEAD_OF_MOVE cid#1556897 COPY_INSTEAD_OF_MOVE Change-Id: I6cf90b385042e7ca7d07138c28c0e95f97de8f61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171983 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-08-18tdf#156926 related: Ability to Delete all images in WriterJim Raykowski
Adds the ability to delete all content of a content type, excluding the Headings content type, using the content type's context menu in Writer Navigator. Change-Id: Ie5666b6b9b7ef2f3cdb63957b1b42b236b8674db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170643 Reviewed-by: Jim Raykowski <raykowj@gmail.com> Tested-by: Jenkins
2024-08-17tdf#162304 layoutInCell: native ODT handling from top of PRINT_AREAJustin Luth
Making ODF work the same way that MSO does. Since this was the intention all along, I'm not going to bother with a compat flag for older documents. It is highly unlikely that a native ODF user would have all these: -turned on follow text flow -used "page text area" when trying to orient from top of cell (more likely to use "entire page" if they do associate page<->cell. -set a larger border spacing (since default is a miniscule 0.05cm). -this code-path is only in effect with FROM_TOP, an unlikely combination with "page text area". Change-Id: I979e6e0526102004c56285db6e7479c0ff6d660e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171610 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-17tdf#162211 tdf#153909 layoutInCell vml: don't discard layoutInCellJustin Luth
This is just a clean-up patch, doing for the VML code path what was handled for drawingML This effectively reverts my patch for tdf#153909 commit ad0266eb84eafa32ccc4e0ddf3c6392860bc9b13, but it depends on all the changes made for tdf#162211. Change-Id: I3b5942c406ee73e91cdff1f1f73a2b92e0688474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171609 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-17tdf#91632 doc import layoutInCell: vert page->margin, *->topJustin Luth
The same thing was done early in this series of patches for DOCX Microsoft's layoutInCell is very buggy for vertical orientation. So, instead of making our own implementation just as buggy, instead, alter the document so that the settings match the implementation. That way if MSO ever decides to re-fix layoutInCell, we are in a position to easily avoid the mapping to accommodate a new compat version. make CppunitTest_sw_ww8export4 \ CPPUNIT_TEST_NAME=testTdf91632_layoutInCellD Change-Id: I6d1a6c341dc1fdd51facb965c75f7d2578973eea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171975 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-17tdf#162211 tdf#160077 layoutInCell: use row margin for MSOLayoutJustin Luth
I think the bottom margin functions might be buggy, so I'm glad I don't need to use them (since MSO only does vertical layout against the top). This is only needed for "from top", because the only other choice, "top", is based on the print area, while this function uses GetFrameArea. GetFramePrintArea is invalid, so that can't be used directly. make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf160077_layoutInCell make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf160077_layoutInCellB Before this patch could pass sw.check, I had to fix the following unit test in a previous patch make CppunitTest_sw_layoutwriter2 CPPUNIT_TEST_NAME=testTdf116256 Change-Id: Iac487b94c81ce44165356f447eb37964da1985ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171507 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-17tdf#162211 tdf#158384 layoutInCell: doTextBoxPositioning betterJustin Luth
by simply honouring FollowTextFlow as the comment states. I needed to look into this because of a failing unit test. I can't say I understand why sync needs to lay out two things instead of just laying out one and copying the screen position, but bug 158384 indicated that the wrong value was added, so I looked for alternatives to use instead of nLeftSpace. A better sounding alternative was textbox spacing to border, but that is already taken into account. Then I realized a negative offset was being applied against the cell edge - which is only allowed for bWrapThrough. Unfortunately, that once again breaks the unit test I have been trying to accommodate. I can only assume that the unit test's pressuppositions are false. So I'm changing the unit test to test things that are certain! make CppunitTest_sw_layoutwriter2 CPPUNIT_TEST_NAME=testTdf116256 Given how wonky textbox sync is, I'm not confident that ANYTHING here is actually correct. Change-Id: I2e73b7345b4d4c3da78d62644032cb573dc6821e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171577 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-17tdf#158556 improve FindNumRulePtrNoel Grandin
we dont need to scan the table if the entry does not exist in the map Shaves 2% off the load time of a large DOCX file Change-Id: Idf001487ae4a25a37f63218f1e98dbd6cc2a6ed8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-17cid#1606639 silence Overflowed constantCaolán McNamara
and cid#1606583 silence Overflowed constant Change-Id: I7cbd62b45126d66a4b9eeb2e2b61a7625c177708 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171973 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-17Fix wrong = where == was intendedMike Kaganski
Introduced in commit cd740ff560a88a62bc79f5ea5b92bdadf71ba728. Thanks Caolan for spotting this! Change-Id: Ieb046013f7bd09b539b01b5d360f52a9cb39e245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171783 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-17tdf#161741: LO crashed on redo of header changes: unit testJustin Luth
make CppunitTest_sw_uiwriter8 CPPUNIT_TEST_NAME=testTdf161741 Change-Id: I3f62fa600d4c1392f76fff02d51443ed51729e00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171960 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-16feat(invert): Allow inverted background on initSkyler Grey
Previously for Online there was no way to save the background invert state and reload it. Worse, when someone changed the state it would become the default for new document loads. This patch allows Online to specify whether it wants the background to be inverted, which should allow smooth tab refreshes while also avoiding mingling state from different people. There is a change to online to support this here: https://github.com/CollaboraOnline/online/pull/9652 Change-Id: I8c22c03d3b4589736d48509004f7789dd5166389 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171955 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-16test(invert): ensure background-invert separationSkyler Grey
I0aed702185e642f631854b1f8234355c9e69ff6e made inverted backgrounds separated by view. This change adds a test to make sure that it really works, based on the work in I05486860c5f562c3cfa59b4a7fc492d48913a181 to allow a specific theme to be stated on a per-view basis Change-Id: I3d0c4814cde5cafe069f984fe7904080660f10d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171953 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-08-16tdf#162491 tdf#125032 add hyphenation settings to sidebarLászló Németh
Add .uno:NoBreak to the Character sidebar panel to disable automatic hyphenation for selected words. The icon is enabled only on hyphenated words and words with disabled hyphenation. Add .uno:Hyphenate icon to the Character sidebar panel, with tooltip "Insert Soft Hyphen...", which opens the dialog for (semi-)automatic insertion of soft hyphens. Add paragraph-level hyphenation settings to the Paragraph sidebar panel. Only the toggle button icon "Hyphenation" is visible to enable hyphenation, if the paragraph is not hyphenated. If it's enabled, show all paragraph-level settings. These new sidebar controls allow adjusting paragraph layout and hyphenation quickly, like DTP software do. Note: to add icon to .uno:NoBreak, modify "Properties" of officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu. Note: it's possible, that high resolution icon sizes will need extra dispatcher calls (the draft is attached to the issue in the bug tracker). Change-Id: I292527589ed3a38e4400cfd97ea54cbc7ff56a44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171883 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2024-08-16cid#1557618 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1557535 COPY_INSTEAD_OF_MOVE cid#1557520 COPY_INSTEAD_OF_MOVE cid#1557513 COPY_INSTEAD_OF_MOVE cid#1557503 COPY_INSTEAD_OF_MOVE cid#1557487 COPY_INSTEAD_OF_MOVE cid#1557483 COPY_INSTEAD_OF_MOVE cid#1557479 COPY_INSTEAD_OF_MOVE cid#1557474 COPY_INSTEAD_OF_MOVE cid#1557461 COPY_INSTEAD_OF_MOVE cid#1557446 COPY_INSTEAD_OF_MOVE cid#1557445 COPY_INSTEAD_OF_MOVE cid#1557441 COPY_INSTEAD_OF_MOVE cid#1557435 COPY_INSTEAD_OF_MOVE cid#1557433 COPY_INSTEAD_OF_MOVE cid#1557429 COPY_INSTEAD_OF_MOVE cid#1557375 COPY_INSTEAD_OF_MOVE cid#1557372 COPY_INSTEAD_OF_MOVE cid#1557356 COPY_INSTEAD_OF_MOVE cid#1557350 COPY_INSTEAD_OF_MOVE cid#1557344 COPY_INSTEAD_OF_MOVE cid#1557339 COPY_INSTEAD_OF_MOVE cid#1557332 COPY_INSTEAD_OF_MOVE cid#1557330 COPY_INSTEAD_OF_MOVE cid#1557328 COPY_INSTEAD_OF_MOVE cid#1557323 COPY_INSTEAD_OF_MOVE cid#1557315 COPY_INSTEAD_OF_MOVE cid#1557313 COPY_INSTEAD_OF_MOVE cid#1557304 COPY_INSTEAD_OF_MOVE cid#1557297 COPY_INSTEAD_OF_MOVE cid#1557291 COPY_INSTEAD_OF_MOVE cid#1557290 COPY_INSTEAD_OF_MOVE cid#1557271 COPY_INSTEAD_OF_MOVE cid#1557266 COPY_INSTEAD_OF_MOVE cid#1557262 COPY_INSTEAD_OF_MOVE cid#1557259 COPY_INSTEAD_OF_MOVE cid#1557246 COPY_INSTEAD_OF_MOVE cid#1557242 COPY_INSTEAD_OF_MOVE cid#1557241 COPY_INSTEAD_OF_MOVE cid#1557236 COPY_INSTEAD_OF_MOVE cid#1557228 COPY_INSTEAD_OF_MOVE cid#1557225 COPY_INSTEAD_OF_MOVE cid#1557221 COPY_INSTEAD_OF_MOVE cid#1557217 COPY_INSTEAD_OF_MOVE cid#1557213 COPY_INSTEAD_OF_MOVE cid#1557211 COPY_INSTEAD_OF_MOVE cid#1557209 COPY_INSTEAD_OF_MOVE cid#1557205 COPY_INSTEAD_OF_MOVE cid#1557204 COPY_INSTEAD_OF_MOVE cid#1557193 COPY_INSTEAD_OF_MOVE cid#1556082 COPY_INSTEAD_OF_MOVE Change-Id: I07f195a79a69d4bac0d14317854efc88d6fe94d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171927 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-16related tdf#63967: Ability to Quickly Get Word Count of SectionsJim Raykowski
Using Navigator Adds word count information of headings outline content to the headings content tooltip. Change-Id: I31163d95139cdc1ef770591684e9cb585ed49a8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171920 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-08-16tdf#161741 tdf#161705 undo: delay ClearRedo until Undo finishesJustin Luth
I know NOTHING about the intricacies of Undo/Redo. However, this is my feeble attempt to add some sanity to it. It should not be the responsibility of the caller to know when they are allowed to call ClearRedo. This patch reverts commit 0cd000bb83719982c1fd2265ea040c82af5bf98e author Daniel Arato (NISZ) on Mon May 10 15:41:28 2021 +0200 tdf#141613 sw: avoid possible crash when undoing header creation which was not a sufficient hack. I hope this patch lays a better framework to handle future similar issues. vvv NAIVE OPTIMIST ALERT vvv mbDoing was added with commit 9cb53122e9e098bc8a6bf53c14b18415e369dd6d Author: Frank Schoenheit on Fri Oct 22 15:00:39 2010 +0200 undoapi: more I/SfxUndoManager changes in preparation of new Undo API features and has been untouched since then AFAICS, and there was never any mechanism to change mbDoing. In other words, it has been sitting there doing NOTHING. So, I am taking it over and using it how I imagine it was intended, and how it is documented. Change-Id: I7aa355cc6458ac8ba34ddb9ee73fc850dcbca702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170793 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-16tdf#141466 sw: Fix incorrect output after editing Ruby base textJonathan Clark
Previously, the Asian Phonetic Guide dialog could scramble base text during editing due to incorrect handling of PaM after calling ReplaceRange(). This issue has been fixed. The implementation has also been modified to allow base text deletion. Change-Id: I43350272359c7984459aea1604dae0d3f6428cac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171934 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-08-15tdf#158556 cache SwDocStyleSheetNoel Grandin
so we dont keep creating it again. Shaves 3% off the load time. Change-Id: Id67927f854d55769f76e56c6bc9a9e9bb05eea6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171919 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-15tdf#158556 move m_vIndices to SwNodeNoel Grandin
When we load complex documents we end up with very large amounts of SwNodeIndex objects, and we also need call RemoveNode often, which means we end up scanning tons of objects. So move the linked list from SwNodes to SwNode, so we can scan just the objects that we are interested in. Shaves 10% off the load time of a complex docx file. Change-Id: Id62388dbc7e41fae30acb7910a982710c80e563e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171888 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-15Add asserts to a unit testMike Kaganski
It helped me to easily see which unit test failed, when working on another change, instead of seeing a segfault Change-Id: Id0345f508eac3c60265cd62b8aa20d895c3a1d01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171897 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-15make SfxStringItem hashableNoel Grandin
which shaves some time off loading complex files. Note that this class is often used as a superclass, so I checked all of the subclasses and marked some of them as "does not support hashing" until they can be independently verified to be safe Change-Id: Id4187eda8d6145e89e17dc10c2e3113b7a93da85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-15merge CntUnencodedStringItem into SfxStringItemNoel Grandin
which simplifies the hierarhcy. We never allocate such a thing, we always allocate subclasses, and it has no real meaning by itself. Change-Id: Ie6b716c9ea6ca0efe0ae4f39ac345608c45534f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-15tdf#162480: Make sure to use correct anchor point for text box creationMike Kaganski
In the ODF import, when importing a table, initially a placeholder 1x1 table is created. When this is done from SwView::InsertMedium, frames are created for the table and its single cell at that stage. Then the actual table nodes are created, but frames are not created in parallel, until the table import is finished. Importing a text box, it used to be created anchored at the end of the document, and then the anchor was moved to the correct place. When a text box was anchored to a cell, the process was like this: the text content was inserted in the last paragraph outside of the current table; and then it was moved to the current cell. When this was done from SwView::InsertMedium, creation of the text content also created the frame; then the movement fired client notifications, including the SwFlyAtContentFrame::SwClientNotify, which needs the new anchor frame. With cell other than A1, there was no frames for the new anchor in the table, and that crashed. This change inserts the text content into the correct place from start, which avoids the need to move the anchor later. Co-authored-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: I9dd3a2c5527f3c2dd860244456c617558943453a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171898 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-15Related: cool#9735 sw lok: handle the AnyInput() callback during idle layoutMiklos Vajna
Open the 300 pages bugdoc, paste a oneliner plain text content in a paragraph which is part of a numbered list, observe a 274 ms hang till layout is done for all pages, then we get an updated tile. We already do the layout in two passes: once for the visible area and then an idle pass for the rest of the pages. But we didn't notice that the LOK client has pending input events, so the list of events were like this: debug:20492:20486: SwTransferable::PasteData: finished in 5 ms debug:20492:20486: SwLayAction::InternalAction: finished in 273 ms debug:20492:20486: SwViewShell::PaintTile With this patch, the order of evens is rather like: debug:7541:7535: SwTransferable::PasteData: finished in 4 ms debug:7541:7535: SwViewShell::PaintTile debug:7541:7535: SwLayAction::InternalAction: finished in 261 ms Which means that once a LOK client opts in to provide an any input callback, the end-to-end time from the paste uno command dispatch to receiving the first tile update decreases from 963 ms to 14 ms. Change-Id: Ia9e734f84121b7d87150cb3479fc265ca8ee0292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171885 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-08-15Simplify a bitMike Kaganski
Change-Id: I05a8aa354b68331712768b1d696736d69ce8dacb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171775 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-15tdf#162211 writerfilter: don't discard layoutInCellJustin Luth
I DON'T KNOW IF I REALLY WANT TO SUBMIT THIS PATCH. I'VE ALREADY DECIDED IT IS BEST TO CHANGE THE IMPORT TO MATCH REALITY, AND KILLING layoutInCell CERTAINLY DOES THAT. The Ok button on the UI is the real convincer... although one unit test had beneficial side effects. It is very tempting to turn off "layoutInCell". After all, MSO has rather bizarre exceptions to the rule, and the whole concept in general is competely unnecessary (except to fix their horrible initial implementations). But by discarding layoutInCell, we are going in the opposite direction of Microsoft, who in compat15 (2013+), treats layoutInCell as true regardless of whether it is set to on or off. However, there still is one downside to preserving layoutInCell. In LO's UI, when looking at the properties, it will change the values to enforce layoutInCell, so pressing OK will shift an outlying shape. shape - FRAME/FRAME -fdo68607.docx [same] -test_segfault_while_save.docx [zOrder is fixed somehow] -layout-in-cell-wrapnone-column.docx [same] make CppunitTest_sw_writerfilter_dmapper \ CPPUNIT_TEST_NAME=testLayoutInCellWrapnoneColumn Change-Id: I6d66cb2f14507847e346443d42879a60025bc9d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171437 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-08-15tdf#156211 sw: Fix spurious kashida inserted after undoJonathan Clark
This change fixes an issue presenting as incorrectly-positioned kashida glyphs overlapping Arabic text after certain edit operations. During layout with kashida justification, Writer builds a table of lines that require fallback to whitespace justification. Normally, this table is built sequentially from the first line, but it may be updated out-of-order following certain edit operations. Due to an off-by-one error, if Writer cleared the exclusion for a line immediately before a legitimately-excluded line, Writer would also clear the legitimate exclusion. In such a situation, portions of excluded text would be redrawn with kashida justification, and because that text usually does not have enough free space, the kashida glyphs would be drawn on top of the base text. Change-Id: I204661286531fa6064f7a6adc35f1606e35e5d39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171878 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-08-14tdf#160301 - Add Unit testAdam Seskunas
Change-Id: Icfd8aa7066ea837103a332c3b61950574b7799fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171840 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-08-14Fix typoAndrea Gelmini
Change-Id: I9a61081ad045bcc22e7ab5f89118270674654f2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171865 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-08-14tdf#158556 bypass some more logic for toggle propertiesNoel Grandin
Change-Id: I9004ae8d6a13beb81cd00a227b711baebfdb82a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171852 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-14Disallow closing document during idle layoutMike Kaganski
Similar to commit 99c1bd1a4ef5365d8c26a41c8e858c67e673beb4 (Disallow closing document during generation of preview, 2024-03-11), it may happen that an external process is closes a document that is being in the process of the background layout, leading to use-after-free. The request thread at the crash time, executing XComponent::dispose: swlo.dll!SwNoTextFrame::~SwNoTextFrame() Line 170 swlo.dll!SwNoTextFrame::`scalar deleting destructor'(unsigned int) swlo.dll!SwFrame::DestroyFrame(SwFrame * const pFrame) Line 397 swlo.dll!SwFlyFrame::DeleteCnt() Line 424 swlo.dll!SwFlyFrame::DestroyImpl() Line 358 swlo.dll!SwFlyFreeFrame::DestroyImpl() Line 89 swlo.dll!SwFrame::DestroyFrame(SwFrame * const pFrame) Line 396 swlo.dll!SwLayoutFrame::DestroyImpl() Line 516 swlo.dll!SwFrame::DestroyFrame(SwFrame * const pFrame) Line 396 swlo.dll!SwLayoutFrame::DestroyImpl() Line 540 swlo.dll!SwPageFrame::DestroyImpl() Line 317 swlo.dll!SwFrame::DestroyFrame(SwFrame * const pFrame) Line 396 swlo.dll!SwLayoutFrame::DestroyImpl() Line 540 swlo.dll!SwRootFrame::DestroyImpl() Line 570 swlo.dll!SwFrame::DestroyFrame(SwFrame * const pFrame) Line 396 swlo.dll!std::_Ref_count_resource<SwRootFrame *,void (__cdecl*)(SwFrame *)>::_Destroy() Line 1222 swlo.dll!std::_Ref_count_base::_Decref() Line 1164 swlo.dll!std::_Ptr_base<SwRootFrame>::_Decref() Line 1380 swlo.dll!std::shared_ptr<SwRootFrame>::~shared_ptr<SwRootFrame>() Line 1685 swlo.dll!SwViewShell::~SwViewShell() Line 354 swlo.dll!SwCursorShell::~SwCursorShell() Line 3440 swlo.dll!SwEditShell::~SwEditShell() Line 63 swlo.dll!SwFEShell::~SwFEShell() Line 699 swlo.dll!SwWrtShell::~SwWrtShell() Line 2065 swlo.dll!SwWrtShell::`scalar deleting destructor'(unsigned int) swlo.dll!std::default_delete<SwWrtShell>::operator()(SwWrtShell * _Ptr) Line 3302 swlo.dll!std::unique_ptr<SwWrtShell,std::default_delete<SwWrtShell>>::reset(SwWrtShell * _Ptr) Line 3447 swlo.dll!SwView::~SwView() Line 1196 swlo.dll!SwView::`vector deleting destructor'(unsigned int) sfxlo.dll!SfxViewFrame::ReleaseObjectShell_Impl() Line 1140 sfxlo.dll!SfxViewFrame::~SfxViewFrame() Line 2059 sfxlo.dll!SfxViewFrame::`scalar deleting destructor'(unsigned int) sfxlo.dll!SfxViewFrame::Close() Line 1192 sfxlo.dll!SfxFrame::DoClose_Impl() Line 138 sfxlo.dll!SfxBaseController::dispose() Line 928 fwklo.dll!`anonymous namespace'::XFrameImpl::setComponent(const com::sun::star::uno::Reference<com::sun::star::awt::XWindow> & xComponentWindow, const com::sun::star::uno::Reference<com::sun::star::frame::XController> & xController) Line 1496 fwklo.dll!`anonymous namespace'::XFrameImpl::close(unsigned char bDeliverOwnership) Line 1707 sfxlo.dll!SfxFrame::DoClose() Line 104 sfxlo.dll!SfxViewFrame::Notify(SfxBroadcaster & __formal, const SfxHint & rHint) Line 1820 svllo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 40 sfxlo.dll!`anonymous namespace'::SfxModelListener_Impl::notifyClosing(const com::sun::star::lang::EventObject & __formal) Line 154 sfxlo.dll!SfxBaseModel::close(unsigned char bDeliverOwnership) Line 1511 swlo.dll!SwXTextDocument::close(unsigned char bDeliverOwnership) Line 574 sfxlo.dll!SfxBaseModel::dispose() Line 745 swlo.dll!SwXTextDocument::dispose() Line 561 mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214 mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430 binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny * returnValue, std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny>> * outArguments) Line 239 binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79 binaryurplo.dll!request(void * pThreadSpecificData) Line 84 cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool bReturnWhenNoJob) Line 101 cppu3.dll!cppu_threadpool::ORequestThread::run() Line 165 cppu3.dll!threadFunc(void * param) Line 190 sal3.dll!oslWorkerWrapperFunction(void * pData) Line 67 Main thread, doing an idle layout of the same document: emboleobj.dll!OleComponent::SetExtent(const com::sun::star::awt::Size & aVisAreaSize, __int64 nAspect) Line 1099 emboleobj.dll!OleEmbeddedObject::setVisualAreaSize(__int64 nAspect, const com::sun::star::awt::Size & aSize) Line 138 swlo.dll!SwWrtShell::CalcAndSetScale(svt::EmbeddedObjectRef & xObj, const SwRect * pFlyPrtRect, const SwRect * pFlyFrameRect, const bool bNoTextFramePrtAreaChanged) Line 777 swlo.dll!SwContentNotify::ImplDestroy() Line 926 swlo.dll!SwContentNotify::~SwContentNotify() Line 1037 swlo.dll!SwNoTextFrame::MakeAll(OutputDevice * pRenderContext) Line 584 swlo.dll!SwFrame::OptPrepareMake() Line 412 swlo.dll!SwFrame::OptCalc() Line 1110 swlo.dll!SwLayAction::FormatContent_(const SwContentFrame * pContent, const SwPageFrame * pPage) Line 1969 swlo.dll!SwLayAction::FormatFlyContent(const SwFlyFrame * pFly) Line 1994 swlo.dll!SwObjectFormatter::FormatObj_(SwAnchoredObject & _rAnchoredObj) Line 312 swlo.dll!SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject & _rAnchoredObj, const bool _bCheckForMovedFwd) Line 133 swlo.dll!SwObjectFormatter::FormatObjsAtFrame_(SwTextFrame * _pMasterTextFrame) Line 414 swlo.dll!SwObjectFormatterTextFrame::DoFormatObjs() Line 348 swlo.dll!SwObjectFormatter::FormatObjsAtFrame(SwFrame & _rAnchorFrame, const SwPageFrame & _rPageFrame, SwLayAction * _pLayAction) Line 160 swlo.dll!SwLayAction::FormatContent(SwPageFrame * pPage) Line 1802 swlo.dll!SwLayAction::InternalAction(OutputDevice * pRenderContext) Line 607 swlo.dll!SwLayAction::Action(OutputDevice * pRenderContext) Line 390 swlo.dll!SwLayIdle::SwLayIdle(SwRootFrame * pRt, SwViewShellImp * pI) Line 2372 swlo.dll!SwViewShell::LayoutIdle() Line 827 swlo.dll!sw::DocumentTimerManager::DoIdleJobs(Timer * __formal) Line 176 swlo.dll!sw::DocumentTimerManager::LinkStubDoIdleJobs(void * instance, Timer * data) Line 156 vcllo.dll!Link<Timer *,void>::Call(Timer * data) Line 111 vcllo.dll!Timer::Invoke() Line 75 vcllo.dll!Scheduler::CallbackTaskScheduling() Line 509 vcllo.dll!SalTimer::CallCallback() Line 53 vclplug_winlo.dll!WinSalTimer::ImplHandleElapsedTimer() Line 169 vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 525 vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 581 vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 385 vcllo.dll!Application::Yield() Line 473 vcllo.dll!Application::Execute() Line 361 sofficeapp.dll!desktop::Desktop::Main() Line 1652 vcllo.dll!ImplSVMain() Line 229 vcllo.dll!SVMain() Line 262 sofficeapp.dll!soffice_main() Line 121 soffice.bin!sal_main() Line 51 soffice.bin!main(int argc, char * * argv) Line 49 soffice.bin!invoke_main() Line 79 soffice.bin!__scrt_common_main_seh() Line 288 soffice.bin!__scrt_common_main() Line 331 soffice.bin!mainCRTStartup(void * __formal) Line 17 Change-Id: I92102a9cd11ccde307b070ebc1984eb3d17d65bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171856 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-08-14tdf#162458 doc export: don't change "margin" to "page"Justin Luth
I'm a little baffled at this code. The only thing I can imagine is that at some earlier time it converted TOP of PAGE_PRINT_AREA to FROM_TOP of PAGE. That at least was true of my example document in LO5.3, and I see similar things happening for horizontal. For vertical, in the case of FollowTextFlow, this is exactly backwards anyway, because MSO implements PAGE_FRAME as if it were PAGE_PRINT_AREA, which is the exact opposite of what we are doing here... For horizontal FTF, there doesn't need to be any adjustment. (see tdf#160077) DOC format knows about all 4 valid vertical positions (TOP/CENTER/BOTTOM/FROM_TOP), and all 4 valid horizontal positions (LEFT/CENTER/RIGHT/FROM_LEFT) and DOC format also knows about both hori and vert PAGE_PRINT_AREA, so there is no need to do any adjustment for "margin". For PAGE_FRAME it is irrelevant because that is what it sets anyway, so there is literally no change in that case. make CppunitTest_sw_ww8export CPPUNIT_TEST_NAME=testBnc787942 make CppunitTest_sw_ww8export \ CPPUNIT_TEST_NAME=testTextVerticalAdjustment Change-Id: I201966f00909d4a6e7fcd873582096da259c776d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171842 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2024-08-14use less exception throwing for flow controlNoel Grandin
Change-Id: I289f1a2204af02576a585392b7f428a5dc65cf1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171850 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-14GetMarkStart/GetMarkEnd is hotNoel Grandin
when importing docs with lots of fieldmarks. But once we have computed the one, computing the other is essentially free, so instead of doing the computation twice, return both values when we need both Change-Id: Icdd9d4ed4cf1e6c9b26fdb20507c4f964f9e9f90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171853 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-14tdf#162211 tdf#137590 layoutInCell: vertical escaping with wrapThroughJustin Luth
This patch allows shapes to go "from top" above the cell frame. (This was already working horizontally, and for positive, downward values). In theory, this should not be needed for ODT layout. ODT UI shouldn't allow cell-escaping values to be used. It does not currently affect FRAME/FRAME _shapes_ because those forcefully turn off layoutInCell, but it does affect FRAME/FRAME _images_ whose code path does not forcefully turn off layoutInCell. There are a few more places in the code where AdjustVertRelPos() is called, but most had no matching unit tests. I assume it is probably because we already don't CheckBottom. The following unit tests are affected by this patch PAGE/PAGE -tdf81345.docx (81345_045Original) [big green gradient - fixed] -tdf115883.docx [compat15 - miniscule .03cm offset] image - FRAME/FRAME -tdf135595_HFtableWrap_c12.docx [after round-trip - fixed] -tdf135595_HFtableWrap.odt [footer logo moves up - fixed] -layout-in-cell-2.docx [extremely minor offsets] make CppunitTest_sw_ooxmlexport14 \ CPPUNIT_TEST_NAME=testTdf135595_HFtableWrap These will be affected if layoutInCell is not forced off. shape - FRAME/FRAME -fdo68607.docx -test_segfault_while_save.docx [even zOrder is fixed somehow] -layout-in-cell-wrapnone-column.docx Change-Id: I13b030a2e7117557dd9794c0eb9bd74a0d67b82f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171436 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Justin Luth <jluth@mail.com>
2024-08-14tdf#158556 bypass some logic for toggle propertiesNoel Grandin
hardcode a direct route through most of the logic in SwXStyle. Shaves 20% off the load time. Change-Id: I52ae8b4e870e07893195ce2eaedcf9069dbcae8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171815 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-14Resolves tdf#80054 - Customization for non-printable character colorHeiko Tietze
Change-Id: I82783a49d3a1c2096dcfa7c97a3fce14c555c988 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171814 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-08-13use more concrete UNO type in writerfilterNoel Grandin
Change-Id: I9c4a71b1a32bf42ea54ca9f108ee22d4eabc205c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171470 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-13cid#1557699 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1557696 COPY_INSTEAD_OF_MOVE cid#1557695 COPY_INSTEAD_OF_MOVE cid#1557690 COPY_INSTEAD_OF_MOVE cid#1557671 COPY_INSTEAD_OF_MOVE cid#1557661 COPY_INSTEAD_OF_MOVE cid#1557626 COPY_INSTEAD_OF_MOVE cid#1557624 COPY_INSTEAD_OF_MOVE cid#1557622 COPY_INSTEAD_OF_MOVE cid#1557618 COPY_INSTEAD_OF_MOVE cid#1557617 COPY_INSTEAD_OF_MOVE cid#1557607 COPY_INSTEAD_OF_MOVE cid#1557559 COPY_INSTEAD_OF_MOVE cid#1557538 COPY_INSTEAD_OF_MOVE Change-Id: I8bcd61f21e6b5284d641ff8c6bd09008c2458baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171837 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-13Fix SectionPropertyMap::ApplyProperties_Noel Grandin
after commit 1e8ace631fb8518cea3fdf94b54e73616d7229c5 Author: Noel Grandin <noelgrandin@gmail.com> Date: Fri Aug 9 12:38:54 2024 +0200 use more concrete UNO type in writerfilter where I forgot to remove unnecessary logic, so we ended up setting the properties twice Change-Id: Ie1e5aae3ff199c3bec4bf95b0d660461552acb60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171827 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-13tdf#158556 flatten SwStyleBase_Impl a littleNoel Grandin
less pointer chasing Change-Id: I117880dcfaef730f1d19b6b3b4b1f5d8188e0c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171817 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>