summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2023-02-14UBSan needs SwFlowFrame RTTI to be public nowStephan Bergmann
...for CppunitTest_sw_core_layout_flycnt newly introduced in 995198bfff4ae8abaf2129fe99d9f8ef899a4f25 "sw floattable: handle table-in-fly in SwFrame::GetNextFlyLeaf()" Change-Id: If006a912d365642181b0bc80dc21c55d42214e87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146967 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-14sw: document SwAuthorityFieldMiklos Vajna
Its invariant was already documented, but it wasn't mentioned that the UI's bibliography entry is called an authority field internally. Change-Id: I55a946a5bdb59e8d6e1def54b16d0c986e531c34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146942 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-14tdf#153592 writerfilter: don't defer breaks into shapes/commentsJustin Luth
When starting a pargraph, we already had a clause to avoid deferring page and column breaks when we were in a shape or a comment. These clauses are also necessary in the other sections of the code where we defer these breaks. The provided test proves the two shape cases in lcl_utext. I just took IsInComments along for the ride, as it certainly would apply in that case as well. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf153592_columnBreaks ooxmlexport4's testTdf81345_045Original proves that it is also needed in lcl_text. However, it is such a complex document that I wasn't confident that a unit test would be stable enough. Change-Id: I2de15341d3e756bf47fcd85b868a849c8a2419cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146939 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-13Fix typoAndrea Gelmini
Change-Id: I587c742957da0bb40ff858180f27b62549ebadbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146912 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-02-13tdf#152605 (tdf#137968) "heading level" -> "outline level"Seth Chaiklin
Reformulate error messages for headings whose outline levels are not in sequence. UX cleanup: Add missing periods to error messages. Change-Id: I62b8f7af79460b644fae20dd521a160907605b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146807 Reviewed-by: Seth Chaiklin <sdc.blanco@youmail.dk> Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-02-13tdf#153499 Add missing colons to labels with buddy controlsSeth Chaiklin
Change-Id: I1260503e12516b3b29d34a317ca3a58cc314b608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146920 Reviewed-by: Seth Chaiklin <sdc.blanco@youmail.dk> Tested-by: Jenkins
2023-02-13sw floattable: handle table-in-fly in SwFrame::GetNextFlyLeaf()Miklos Vajna
Trying to lay out a split fly that contains a table resulted in a stack overflow. The reason for this was that SwObjectFormatter::FormatObjsAtFrame_() has a loop that will format all objects of the current fly frame, but we managed to anchor the follow fly into itself. Fix the problem by improving SwFrame::GetNextFlyLeaf(), somewhat based on how SwFrame::GetNextSctLeaf() has special cases for tables. This way once we split the fly frame, we'll try to move the follow anchor frame to the next page's body frame, and not to a child of the follow fly itself. Also add a first floattable testcase, we can already assert that the table is split correctly. Do this in a separate suite for now, since the pool's default SwFormatFlySplit is only created once, so SwFormatFlySplit::SetForce(false) doesn't have the wanted effect. The anchor's text is still on both pages, should be on page 2 only. Change-Id: Ie2ce75dbace5d9716008351aedb6a8989036badb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146854 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-13tdf#152964: sw: move UItest to CppUnittestXisco Fauli
Change-Id: I9470bce1350a87d5773674b55148b64b02997210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146902 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-13sw: use try/finally to reset the changes in OptionsTreeDialogXisco Fauli
Otherwise it might affect other tests if it hits an assert Change-Id: I16b818edc0f4414937f28b8459d06712c7db9eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146896 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-13sw: use try/finally to reset the changes in OptionsTreeDialogXisco Fauli
Otherwise it might affect other tests if it hits an assert Change-Id: Iee4ee4964640114126c2ec404df567598668ed99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146894 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-13sw: use try/finally to reset the changes in OptionsTreeDialogXisco Fauli
Otherwise it might affect other tests if it hits an assert Change-Id: I987d5b4493d599a7ad21c916464efca52f24f548 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146897 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-13tdf#143148 Use pragma once instead of include guard in swbuldi
Change-Id: I9b4d2ccb608ceaafb3ee71a34831ce9cb69db6f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146729 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-02-13Fix typo, improve code readability, fix commentParis Oplopoios
Change-Id: I7221222e8c84ee40e4edaec5325565dae4193aff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145825 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-12Fix typoAndrea Gelmini
Change-Id: I8ab5346e38b6eac508018aced86339d6342224a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146832 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-12Fix typoAndrea Gelmini
Change-Id: I28253e80065c690dca45658111a2cd54857b186a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146833 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-12tdf#152605 "heading level"->"outline level" and other tip correctionsSeth Chaiklin
Change-Id: I3751b8586ffe47233f3cd27602bcb5cad4d9ecb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146797 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-02-11tdf#152605 change "heading level" to "outline level" in UISeth Chaiklin
This patch addresses extended tips in the UI that refer to a heading or chapter level, with the aim to remove this kind of terminology. In many cases, tooltips are added, and extended tips are corrected. Also, add "Outline" in front of "level" in the UI for Caption Options and AutoCaption. Change-Id: Idcf16892599913af31372b89d180251c86945d21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146622 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-02-11sw wrtsh1: cleanup unused pointerJustin Luth
Having a separate pCurRule was made useless by commit 3234a9deaa8db760bbd7dbb6414aa3e8f9993c34 Author: Vladimir Glazounov <vg@openoffice.org> Date: Mon Feb 21 15:07:41 2005 +0000 INTEGRATION: CWS swqcore05 (1.40.82); FILE MERGED Change-Id: I5fe0c7b09245acd9376d46b448708f29594a7266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146824 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-11tdf#147892 DOCX: fix corrupt export at para marker revision historyLászló Németh
OOXML export of tracked deletion of tracked paragraph insertion resulted invalid document.xml, because change tracking history of paragraph markers isn't supported by OOXML. Export the tracked deletion of the last run of paragraphs without history (tracked insertion). This way w:p/w:pPr/w:rPr contains only w:del or w:ins, not both of them (with broken tag order). Note: it's possible to optimize the fix to keep the change tracking history of the characters of the last run of the paragraph, except the paragraph marker. Regression from commit eeee19b3fcf8b0374c361c7f6c285fd5c89b5a2f "tdf#142387 DOCX track changes: export w:del in w:ins". Minimal unit test document was created by Miklós Vajna. Change-Id: I425f4d63c8c6ac29ccd807c1574748c7b9b39e80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146782 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-02-11sw: rename getFieldmarkFor() to getInnerFieldmarkFor()Justin Luth
The same change was made for getBookmarkFor() in https://gerrit.libreoffice.org/c/core/+/145412 Because otherwise it's quite confusing that we have a For() and an At() which could only be differentiated by a code read. Also improve getInnerFieldmarkFor() a tiny bit, so we process the first hit only once. Suggested at <https://gerrit.libreoffice.org/c/core/+/145348/1#message-286262286f234823b390e8f962e3ba11f5fa71b2>. Change-Id: I47e815eea0b8ac0df4957ac0d224acb6c5975b8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145486 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-10tdf#153205 related: Improve selection mode control icon updateJim Raykowski
This patch makes the status bar selection mode control icon change to adding selection when the mouse is used to select text while the ctrl key is pressed and the mouse is moving, which is the behaviour when the mouse is not moving and selection begins. It also makes the icon show the correct mode when doing DnD. Change-Id: I9aeb47301ab3c8b9be2159186bcc8c8ede7bf3de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146726 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-02-10tdf#153205 related: Fix selection problems caused by cursor shellJim Raykowski
push pop during insert state update This patch renames the SelectHiddenRange function to IsInHiddenRange and modifies it to take a bool argument that when true selects the hidden range if the current cursor position is in a hidden range. When the argument is false, the hidden range is not selected if the current cursor position is in a hidden range. This makes using cursor push pop unnecessary when all that is wanted to know is if the current cursor position is in a hidden range. Change-Id: I622dfaf8e73c5b432bb74a48d36433ff755542b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146725 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-02-10tdf#153341: sw_htmlimport: Add unittestXisco Fauli
Change-Id: I048a95a3bb36981f5f2d3d243021952b34529075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146753 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-10tdf#153244: sw: Add UItestXisco Fauli
Change-Id: I8e992d84171aa4ee10f24b754214965ffb70645e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146749 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-09tdf#153042 doc/x/rtf: pre-emptive unit tests for numbering tabstopJustin Luth
These existing unit tests need to have a tabstop in the front. Although different versions of MS Word can handle similar situations differently (regardless of compatibility settings - i.e. buggy) in these cases they are all rendered the same way by Word 2003/2010/2019. make CppunitTest_sw_rtfimport CPPUNIT_TEST_NAME=testTdf78506 make CppunitTest_sw_rtfimport CPPUNIT_TEST_NAME=testTdf116265 In this one, LO's chapter numbering defaults to none-numbering followed by a tabstop. The tabstop should not be there/never become visible. make CppunitTest_sw_ww8export3 CPPUNIT_TEST_NAME=testPresetDash For this added test, older versions of Word 2010/2003 don't show a tabstop. According to MS Word 2019 however, this should have a tabstop in the front. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf153042_largeTab ... but this nearly identical file does not display with any tabstop, and looks the same in all versions of Word. make CppunitTest_sw_ooxmlexport18 CPPUNIT_TEST_NAME=testTdf153042_noTab Change-Id: I59d904ef7dd37b694b02f57d6743ee5b232b42a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146731 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-09sw: fix crash in SwModule::InsertLabXisco Fauli
Seen in https://crashreport.libreoffice.org/stats/crash_details/e17357e9-d5e2-4eee-868e-ecf72e04dc41 Change-Id: I32f239249e72b6644b3a38d4dd9bbae65f7bede0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146692 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-09make default selected table style to Default Table Style for only onlineMert Tumer
unfortunately when the table has a style sw/qa/uitest/writer_tests4/tdf115573.py fails because tables that have pre-applied style resets the style of the elements in their cells when a new row is inserted and the ui test above relies on that. For now this is LOK only Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I2f60376fc2d929498aef45259a5ef291922ccdcd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132124 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146723 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-02-09sw: change inserttable style option default to 1Mert Tumer
Right now it is default to NONE in the list if the user explicitly choses otherwise but that does not align with inserttable option on the toolbar there it is defaulted to "Default Table Style" 1 means "Default Table Style" Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I1db19f0292ac6775653b0db3f2860fea9e3b0adf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131971 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146722 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-02-09use new baseclass member insteadCaolán McNamara
Change-Id: I8a1855f24370c250d0d9aecd583fa47ffaa03afb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146686 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-09sw: call FormatEmpty() in SwTextFrame::Format() for split fly mastersMiklos Vajna
The problem was that the text in the anchor frame of a split fly frame was duplicated on the old page and the new page as well. The reason for this seems to be that the master has no content and the follow has all the content (this is wanted), but then there is no code to explicitly clear the master. In other cases the master always gets some new content where portion building for that new content starts by throwing away the old portions. Once SwTextFrame::Format() and SwTextFrame::FormatEmpty() explicitly checks for these master anchors, the unwanted text in the master anchor disappears. An extra tweak is needed in SwTextFrame::PaintEmpty() to even hide the paragraph marker: this frame is empty but has a follow frame, so we should not show a paragraph marker there. Finally introduce a SwTextFrame::HasNonLastSplitFlyDrawObj() to be able to check for this "empty master anchor for split fly" case at a single place. With this <https://bugs.documentfoundation.org/attachment.cgi?id=185144> from <https://bugs.documentfoundation.org/show_bug.cgi?id=61594> gets laid out reasonably: the position is not perfect but we detect that only 1 para of the text frame fits page 1, we create a 2nd page and we correctly move exactly the text frame's 2nd para to page 2. Change-Id: I871bba2de5b829e667d5cfb1cbe0ba4cc2274edd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146680 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-09sw floattable: fix cid#1520804Miklos Vajna
GetFrameRstHeight() already assumes the m_pFrame is non-nullptr, so no need to check for this. The logic in the block will be necessary elsewhere as well, I'll extract that to a function in a follow-up change, so let's just do a minimal fix here. Change-Id: I6cb2a44e629c273f473278d61607705a2b9a7a4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146679 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-09sw: fix undo comment of FN_UPDATE_TEXT_FORMFIELDMiklos Vajna
It's an update, not an insert. One has to dispatch .uno:TextFormField, then move inside the formfield with the cursor finally dispatch .uno:UpdateTextFormField to see this in action. Change-Id: Id9e3c7b9d08582cbf83f64ff04c97dff5cbb88f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146671 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-08tdf#153423 tdf#150197: use getToken in proper orderJustin Luth
This fixes a LO 7.5 regression from my commit 727c5ed30f68abc28bb04531b25a1df30810760f getToken steps along the string and consumes it, so these needed to remain in the same order as they had been originally. Dumb thing to overlook. Change-Id: I483980eafb7deb0c224063ad41616bb21ddb2191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146672 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-08Revert "tdf#148360 doc import: add NO_NUMBERING_SHOW_FOLLOWBY(true)"Justin Luth
This reverts commit 2405a36f3bcd43f80371ccaed47f7523ff0d8757 which was backported to 7.4.1. This solves the regression report for DOC in tdf#153042. The problem is that the tab-without-numbering is displaying in cases where it shouldn't (i.e. when the tabstop position matches the first line indent). Although the patch itself is fine (DOC should do the same thing as DOCX) the feature is incomplete, even for DOCX/RTF. So just remove DOC from this mix - especially since there seem to be a LOT more instances of DOC files that need the incomplete aspect. Once it is proven to work OK for DOCX, we can add DOC back in. Change-Id: I3c550fc2ca29cf1490ec0a5e3979a6acbd102385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146670 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-08htmlexport: close li mark not only in xhtmlSzymon Kłos
As commented in sw/source/filter/html/htmlatr.cxx:766 "// OutHTML_NumberBulletListEnd() will end a list item" We have to do it also in HTML not only XHTML so node will be closed and we get correct structure. This is followup for: commit 2466b9fcf20ee61f6fc621298011c0efaa55e7c6 Author: Miklos Vajna <vmiklos@collabora.com> Date: Mon Feb 21 16:38:51 2022 +0100 sw HTML export, XHTML mode: fix lost </li> when last list item is not numbered Change-Id: I99baa59b437572b157df8057445cf6c741f936b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143508 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146651 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-02-08editeng: remove SvxLRSpaceItem::nTxtLeftMichael Stahl
Several parts of SvxLRSpaceItem appear to maintain an invariant of the 3 members nTxtLeft/nLeftMargin/nFirstLineOffset: nLeftMargin is either equal to nTxtLeft if nFirstLineOffset is positive, otherwise equal to nTxtLeft + nFirstLineOffset. But not every part maintains it: there are functions SetLeftValue() and SetLeft() which simply write into nLeftMargin regardless, and a constructor that takes 3 separate numbers without any checks. The constructor calls violate the invariant in 2 ways: nTxtLeft is simply set to 0 (many cases), and one case in OutlineView::OutlineView() that sets nTxtLeft to 2000 but the other 2 at 0. Another odd thing is that the UNO services that expose SvxLRSpaceItem either expose a property for MID_L_MARGIN or for MID_TXT_LMARGIN but never both. It looks like there are 2 distinct usages of SvxLRSpaceItem: for anything that's applied to paragraphs, all 3 members are used; for anything else, nTxtLeft is unused. Try to simplify this by removing the nTxtLeft member, instead GetTextLeft() simply calculates it. Also assert in SetLeftValue()/SetLeft() that nFirstLineOffset is 0. Change-Id: Ida900c6ff04ef78e92e8914beda1cc731a695b06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146643 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-08sw layout xml dump: show offset of text framesMiklos Vajna
This can be non-zero for follows in case a text frame is split into a master and follows. Also handle offset/follow of text frames when showing frame text, so only the relevant substring is shown in split frames. Change-Id: Ic3cb6daacf3a1771652afc9b64312585a8258a25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146648 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-08CppunitTest_sw_htmlexport: avoid preTest() magic in ...Miklos Vajna
... testExportOfImagesWithSkipImagesEnabled. Set the filter option explicitly, rather than inferring it from the test name. Change-Id: I931711f394b41916a640bd3be974337d61491928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146640 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-08svx: don't access m_aOutRect directly - go through methodsTomaž Vajngerl
Change-Id: If37d6fd7108d1289f838bd3f81ae9b500c8ddb5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146601 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-02-07cid#1520798 Use after freeCaolán McNamara
since: commit 441d0b0fb2eef890a465c061a3d68a07c4a51832 Date: Fri Jan 27 19:03:35 2023 -0500 tdf#151548 sw content controls: actually gotoFormatContentControl Change-Id: I0460023c2f89a3a151c01a8f844513df39a35855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146638 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-07cid#1520799 Unchecked dynamic_castCaolán McNamara
and cid#1520801 Unchecked dynamic_cast Change-Id: I03a0fdde1da3a9f10699b35455fa2f79ff00a494 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146635 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-07tdf#153083 writerfilter,sw: DOCX locale-dependent TOC \t style names, 3Michael Stahl
The import crashed on fdo85740-1.docx with an unhandled exception. This is because it mapped the TOC style "Table of Figures" from "table of figures", but the ApplyStyleSheetsImpl() actually uses the converted name "Drawing" instead, so "Table of Figures" didn't exist. (regression from commit ca71482237d31703454062b8b2f544a8bacd2831) It turns out that once that is fixed, the DOCX export needs to convert "Drawing" back to "Table of Figures" in the TOC field. Change-Id: I4858c79dd74154b229b7568610c0b8ba7b3e2b6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146610 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-07sw floattable: fix cid#1520800Miklos Vajna
Only SwFrame::GetLeaf() calls this, but it only does so when we're in an at-para anchored fly frame, so we can require that this succeeds. Change-Id: I6c99bc2ea1ab4f338a536272ccce13fd22b30246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146612 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-07tdf#153083 writerfilter,sw: consolidate StyleName->StyleId in msfilterMichael Stahl
Turns out there was already a function MSWordStyles::CreateStyleId() doing the same thing as FilterChars(), presumably better. Change-Id: Idd0129c753841b86bd026e1300aa57a56721c89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146609 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-07Resolves tdf#153127 - Separate book from other modes in print previewHeiko Tietze
Change-Id: I1573034b9df0f199f2b71e640051cad19fa6d220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146587 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-02-07Resolves tdf#148441 - Hide viewlayout in statusbar in preview modeHeiko Tietze
Change-Id: I255ad3b952d7b424e9ff0475798bbe0cfc57ef9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146004 Tested-by: Jenkins Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
2023-02-07sw: fix anchoring in SwFrame::GetNextFlyLeaf()Miklos Vajna
The core of this change is in SwFrame::GetNextFlyLeaf(), which used to assume that there is a next frame after the fly's anchor, but it's perfectly valid to not have such a frame. Instead if a fly is split, then also split its anchor, so effectively only the last follow of such anchor hosts content, all the others are empty and only serve as an anchor of a non-last member of a split fly frame chain. Once this anchoring is changed, adjustments are needed at other places, so a sample split fly frame (2 paragraphs, 1st para on first page, 2nd para on second page) is still layout out correctly: - SwAnchoredObject::FindAnchorCharFrame(): return the right follow text frame for follow flys. This is needed because flys have to be anchored to masters, and then this function can find the frame that's used for positioning. - SwFlyFrame::Format(): get the rectangle of the correct body frame, otherwise we would get the bottom of the 1st body frame instead of the 2nd body frame for the follow fly, leading to a negative height of the follow fly frame. - SwToContentAnchoredObjectPosition::CalcPosition(): position against the right follow text frame, similar to SwAnchoredObject::FindAnchorCharFrame(). - SwTextFrame::AdjustFollow_(): don't join a master with its follow if there is a split fly frame anchored in the master. The assumption is that first the fly has to be moved away, then we can do such a join. - Introduce a SwTextFrame::GetSplitFlyDrawObjs() to avoid copy&paste in SwTextFrame::AdjustFollow_() & SwTextFormatter::FormatLine(). With this, a sample split fly frame is split to two pages with correct anchors if SW_FORCE_FLY_SPLIT=1 is set. The anchor frame has duplicated text on the 1st and 2nd page still, though. Towards an initial working layout for multi-page fly frames. Change-Id: Ie99b13c2e318ec63f69c8a47bbc604771509e24a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146607 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-07sw: use try/finally to reset the changes in OptionsTreeDialogXisco Fauli
Otherwise it might affect other tests if it hits an assert Change-Id: Ic8e35f6f9f029ea6ae4620946edb69ca7a6618bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146591 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-07lok: don't pretty print html for onlineSzymon Kłos
followup for "lok: don't limit line length in HTMLWriter" Pretty printing makes html more readable for human but introduces lots of new line marks which are later interpreted in the client as a valid new lines in the document content. This was causing multiplying the line breaks when inserting hyperlinks where we read current selection's content and then we pass it back to the core as link's content (with added new lines). This change needs cypress change to not contain "\n" at the beginning of some content read from the document. This also afects copying from the online document to clipboard. Change-Id: I2b17d62398d947fcf1d3fb1ed6005c3063d114f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136893 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141479 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-02-07tdf#153244 apply caption optionsSzymon Kłos
Change-Id: I2aa53a85ab9f38ddf74caac85047235ea85a40af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146590 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>