summaryrefslogtreecommitdiff
path: root/sw/qa
AgeCommit message (Collapse)AuthorFilesLines
2022-03-09CppunitTest_sw_ooxmlexport4: avoid mustTestImportOf()Miklos Vajna1-19/+8
Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: Idcd5b5a2171d9e261f614bbdc1ca69b7feb9fa01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131223 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-07tdf#147414 sw_redlinehide: fix cursor position after AutoCorrectMichael Stahl1-0/+30
Change-Id: Ia06cd4e1a74a21788e4d0ddb5f0481e8a144d863 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131147 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-07tdf#147310 sw_redlinehide: recreate frames for whole table deletedMichael Stahl1-0/+46
SwUndoDelete calls MakeFrames with end being end node of the table, but it needs to be the following node (with a frame). (regression from commit 723728cd358693b8f4bc9d913541aa4479f2bd48) Change-Id: Id0974c8349be5aef9630822738eae9462bbcb4f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131112 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-07do not pass XComponentContext to officecfg::...::get() callsLuboš Luňák2-11/+4
It's used only for the ConfigurationWrapper singleton, so it's used only the first time and then ignored. It also causes calls to comphelper::getProcessComponentContext() for every single invocation despite the value not being needed, and the calls may not be cheap (it's ~5% CPU during ODS save because relatively frequent calls to officecfg::Office::Common::Save::ODF::DefaultVersion::get()). Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07sw_redlinehide: more issues with SwEditWin Surrounding functionsMichael Stahl2-4/+4
.. and SwEditWinUIObject. These need to work with TextFrameIndex. Add some functions to SwCursorShell to make it possible. Change-Id: I884c4822a0e7ecf254ea09a893762e1e6d539534 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131042 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-07tdf#140077 sw_redlinehide: fix crash on SplitNode()Michael Stahl1-0/+38
The problem is that CutImpl() was called with nLen=0 and so returned without sending any hint to SwTextFrame. Then the MergedPara gets recreated, but the problem is that the SwParaPortion is never invalidated so it still contains the portions of the previous merged paragraph, and painting it will crash. But it turns out that there isn't a hint that would actually work here; instead, generalise a condition in SwTextNode::SplitContentNode() to simply throw away the portions. (regression from commit eb92dc08f2abf5ed088da0d736266f213adf00de) Change-Id: I06091ca695ea9180b32e61ddb88ce64fbf20443e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131039 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-04Removed executable bits on rtf filesAndrea Gelmini1-0/+0
Change-Id: I4b12bd5d399efa037bb84699572c8c9bfb07e459 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130977 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2022-03-04sw clearing breaks: initial layout supportMiklos Vajna2-0/+59
- add a SwTextFly::GetMaxBottom() to know which fly frame has the largest bottom position from the current paragraph - add a SwBreakPortion::m_eClear to track if the break portion is a clearing break - consider height of breaking clear portions in SwLineLayout::CalcLine() - increase the break portion height in SwBreakPortion::Format() if this is a clearing break and we have a fly frame that has a large enough bottom position, so the next line can "jump down", below the fly frame (so the line can be full width, which is the whole point of a clearing break) Change-Id: Ia21984b9cf9d04287cc19f98495c5b44b880020a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130961 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-04sw layout xml dump: improve handling of number portions at the startMiklos Vajna1-8/+10
It's quite tricky to visit each portion exactly once. The "table" of portions is an SwParaPortion, a row is an SwLineLayout, which contains SwLinePortion instances. But SwLineLayout inherits from SwTextPortion (which is a LinePortion), so depending on if e.g. the paragraph starts with a numbering portion (not a text portion) or with plain text (is a text portion), the first portion in a line is the line layout itself or not. The old behavior was to explicitly dump the first portion of the line as an SwLinePortion, but this way e.g. the expand string of leading number portions were not visible. Change this to moving all the loops to SwFrame::dumpAsXml(), and then not recursing in para portions / line layouts, this allows reaching e.g. SwFieldPortion::dumpAsXml() for leading number portions. Change-Id: I813fdece0e4d6b7116112e15ec866046862beeeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130941 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-03tdf#135413: sw: Add UItestXisco Fauli2-0/+25
Change-Id: Ic22042b604ac7228ac0368c7c0a3324c1863679b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130940 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-03CppunitTest_sw_uiwriter*: Remove unused includesXisco Fauli4-69/+0
After a2a2e07996a0e49164663eaec5d79481bf7bb3e0 < sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5 > and 06f19fc07991ee233a870e98a9115deffa8abf6d < sw: split CppunitTest_sw_uiwriter4 into uiwriter4 and uiwriter6 > Change-Id: I28d4034917b660e3da7d5ae381500100ea33f0f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130931 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-03tdf#107494: sw: move UITest to CppUnittestXisco Fauli3-81/+50
Change-Id: I32e9f3daf866f0598889594b106383db22590d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130895 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-03sw clearing breaks: include this in the UNO API text portion enumMiklos Vajna1-0/+31
Which is how UNO API clients (e.g. ODT export) will be able to read RES_TXTATR_LINEBREAK. Change-Id: I44d2058fd8b4a4fefce3dacc49d3bb3da6060756 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130903 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-02tdf#146171 DOCX: fix loss of change tracking, if no dateLászló Németh3-2/+20
was specified, or it was specified as zero date (e.g. in a LO DOCX export). DateTime attribute w:date is optional in w:ins/w:del according to the OOXML standard. Not specified w:date was imported as invalid zero date "0-00-00T00:00:00Z" resulting loss of change tracking data completely during an ODF roundtrip. Import this invalid zero date as Epoch time to avoid losing change tracking data. Change-Id: If8442db9aa5e41c470827545c36c64f598887101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130885 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-02sw: split CppunitTest_sw_uiwriter4 into uiwriter4 and uiwriter6Xisco Fauli2-1845/+1922
Similar to a2a2e07996a0e49164663eaec5d79481bf7bb3e0 < sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5 > it already had 126 tests Change-Id: Ia98a97ca621289c6b089f570bff3a1330a08efa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130883 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-02ofz#45140 just discard document where import has hopelessly failedCaolán McNamara1-0/+0
Change-Id: Ic772402f99cd68abf24c79f2cf2270692f21aa53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130844 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-02sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5Miklos Vajna2-2852/+2946
My build with 16G ram now regularly fails with: g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.opensuse.org/> for instructions. make[1]: *** [solenv/gbuild/LinkTarget.mk:341: workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter3.o] Error 4 make[1]: *** Deleting file 'workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter3.o' make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:299: build] Error 2 And it seems uiwriter2 is the larger uiwriter suite in sw, so split that into 2. Change-Id: Iba029af2f5bb3f1196707bc13b5e32fefa7e58c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130842 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2022-03-02add a layout test to exercise UXTSORELCaolán McNamara1-0/+9
Change-Id: I57b29dd7d73c08bdbf227676c4ce9034aabf418a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130493 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-02sw clearing breaks: add UNO API to insert this with custom clear / char propsMiklos Vajna1-0/+3
- if (character) properties are specified when the text content itself is inserted, then format the anchor ("dummy") character like that - add the ability to specify a clear type (none/left/right/all) on the line break object itself before insertion Change-Id: I219a1031e53c2e0368ff329d45b7e3fff0934038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130818 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-02tdf#69648 tdf#119234 sw: fix at-char group textbox positionAttila Bakos (NISZ)2-0/+42
in case of it has at-page relative position. This fixes missing or invisible text content of shapes. Note: the remaining problem (original DOCX resaved in MSO 2016) was fixed at tdf#119234. Partial regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: I5c9af0d9a50e4251d3017862ad1fc94eca7d40c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129796 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-01sw clearing breaks: add UNO API to insert thisMiklos Vajna1-0/+32
This only allows the clear=all break type, the others are not yet handled. Change-Id: Id4981b3cc0a8faca2166ad93827ae547f5539095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130741 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-01Fix typosAndrea Gelmini1-1/+1
Change-Id: I9a98bac7c570f25ff7d77df98e93aaeed2665038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130720 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-01protect frame from triggering deleting itselfCaolán McNamara2-0/+354
LIBREOFFICE-N4LA0OHZ Change-Id: I0d24277665a317f047b286fe0f0878b3814ded65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130766 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-01tdf#147126 sw: fix missing as_char anchoring of group textboxesAttila Bakos (NISZ)4-11/+144
which resulted lost (invisible) text content before implementing its support now. Cleanup to SwTextBoxHelper by removing its unneeded functions. testFDO78590 was commented out temporarily because it has a pure VML groupshape inside and it's converted to WPG during the test run resulting crash on reopening, because lack of its support in DocumentContentOperationsManager, trying to convert the content to a text frame inside a text frame. Regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: Ic6ce3549d390ae763044f54e991f390677704396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129627 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-01Fix flaky test on Win64Mike Kaganski1-21/+13
Obviously the left values are unstable; they were excluded on macOS, and they fail exactly on the same lines for me locally on Win64 build. So just test that the values are restored after delete and undo. Change-Id: I63dc50d223edb052a0ada200189cef94c2e0f8e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130738 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-28uitest: simplify tests even moreXisco Fauli2-18/+4
- No need to open the dialog to click the cancel button - Avoid repeated calls to document.DrawPage.getByIndex(0). Similar to 26298f29e9d36313be527b785a9bb96089582037 this might fix the different failures these tests sometimes have Change-Id: I4e175b6c5d48c4651e5877ec2a72c4858b590321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-28uitest: remove duplicated testsXisco Fauli2-58/+0
They are pretty much the same as the other one in the same file Besides, the 'with self.assertRaises(IndexOutOfBoundsException)' nonsense Change-Id: I0ad9aaf80721eb49080d94a34deb43b0bc39724c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130718 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-28tdf#146962 sw: hide deleted row at deletion in Hide ChangesLászló Németh1-0/+46
In Hide Changes mode, deleting table rows with change tracking wasn't applied on the table layout immediately, only using Show Changes and Hide Changes again. Now the deleted row removed from the table instead leaving an empty table row (except the last row of a wholly deleted table). See also commit 95213407dfcbf34056037d60243ff915340d1a2e "tdf#146622 sw crash fix: don't delete already deleted rows". Change-Id: I864957cafa38e631a65db0670c7b566cb689f4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130701 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-02-25tdf#143239 sw: layout: invalidate fly position when moving off pageMichael Stahl2-0/+66
It's possible that flags on the fly are all valid when it is moved off page when SwLayAction::FormatContent() returns and then it may not be positioned again, keeping its (wrong) position on the old page and will appear to be invisible unless you click on it. (regression from commits c799de145f7e289f31e3669646e5bd12814e6c5e and eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf) Change-Id: If07d5af7b47eb288bef71d1b9e3459197b50fdc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130535 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-25uitest: introduce wait_until_file_is_availableXisco Fauli6-0/+18
For export - import tests See https://gerrit.libreoffice.org/c/core/+/124654/5/sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py#91 Change-Id: I3c2537a43cc69067355f18162d6463e268420090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130530 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-25tdf#142423: sw_uiwriter3: Add unittestXisco Fauli1-0/+5
Change-Id: I9b0b53a171689b7b67030010700c6bd7c6dfe4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130521 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-25uitest: remove debug optionXisco Fauli1-1/+0
it does nothing Change-Id: I6fa67aa42b1de6199cbb49100624826f5b3b77d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130524 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-25tdf#146597 sw: fix freezing with GroupShapeAttila Bakos (NISZ)2-0/+6
in case it is anchored to character and wrap is none. Regression from 8da3586cff9cc11cf5db985d19851f21f0d42eb8 "tdf#141220 sw: fix textbox popped out of off-page shape". Note: This is a backport-compatible fix made also for the 7.3 backport. There will be a less urgent 7.4-only fix for its unresolved group case soon. Change-Id: I421c85e2dd16ad2649bc299fc4733d462be8d7b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130478 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-02-25sw HTML export: allow setting filter data keys from the cmdlineMiklos Vajna1-0/+33
For example to produce bitmaps for shape that look better with hidpi: soffice --convert-to 'html:HTML (StarWriter):{"ShapeDPI":{"type":"long","value":"192"}}' test.odt Change-Id: I2654f894d0c20b2cab381e8c6688ec7b13c6e11f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130509 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-24uitest: check the value and not the textXisco Fauli1-1/+1
This fails for me with AssertionError: '90%' != '90\xa0%' - 90% + 90 % Change-Id: Ieec52a4aff721705451a0545eb606c97235b1248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130507 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-24sw: prevent footnote frame against delete while it's movedMichael Stahl1-0/+0
Change-Id: Ifebe53956ca0a7d3653469256c895a666cfffbf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130439 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-23CppunitTest_sw_ooxmlexport3: avoid mustTestImportOf()Miklos Vajna1-20/+10
Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I51a86924de2a6f3eb1a492d60890d6f413d4f6ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130392 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-23sw HTML export: handle LeadingTabWidth without FilterOptionsMiklos Vajna1-0/+25
LeadingTabWidth is meant to be useful for plain HTML as well, but the old code only considered it when FilterOptions was set (typically to enable th XHTML mode). Thanks Stephan Bergmann for noticing that the u"" SAL_NEWLINE_STRING "\xa0\xa0 test" form would not work with MSVC. Change-Id: I89a8b266d9a0f543f6022d82cf043bda4e6e639f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130360 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-02-22Removed executable bits on data filesAndrea Gelmini1-0/+0
Change-Id: Ifcdae0106380de978c608f46e82155c6c9eed20b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130292 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-21sw HTML export, XHTML mode: fix lost </li> when last list item is not numberedMiklos Vajna1-0/+42
This went wrong in 013a4f1f5c9ea5fb511568c53a7e76d1b365a65d (sw XHTML export: fix handling of list labels, 2021-05-13), where we started to assume that in case the last paragraph of a list is not numbered, then the entire list is not numbered. This lead to loosing the </li> for an <li> in case the list starts with a numbered paragraph, but ends with a non-numbered one. Fix the problem by (if necessary) looking back till the start of the list to see if any paragraph is numbered: that ensures that the <li> and </li> is always in sync. This fixes the new problem and keeps the old problem fixed at the same time. Change-Id: I7d347b37a40dcc727c2080bf8279e33c3ad147e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130287 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-02-18Remove some unused includesMiklos Vajna1-1/+0
See tdf#42949 for motivation. Change-Id: Ieddb3d76a960d4b87cd2a1e89bce3fcbe0fce7e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130113 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-17reenable this layout test againCaolán McNamara1-2/+4
Change-Id: Icaedc8b25301be54fc2c99e829fca5907fcd86d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130075 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-17svtools: fix lost replacement non-rendered graphic when updating it failsMiklos Vajna2-0/+70
This is similar to commit 8780fa41dcd164af244742461f4e57a4bcf4c7a4 (svtools: fix lost replacement grpahic when updating it via OLE fails, 2018-10-30), but that case was when we already had an old mpImpl->pGraphic, the updated failed and then we already lost the old one but didn't have a new one. Here what happened is that in case tools -> update -> update-all was used for an OLE object which had bad native data but a good preview, then the result was bad preview, depending on if you first scrolled to the OLE object to trigger rendering (good) or not (bad). The reason for this is that scrolling to the object calls GetGraphic(), which sets mpImpl->pGraphic using GetReplacement(bUpdate=false), which works, but svt::EmbeddedObjectRef::UpdateReplacement() calls GetReplacement(bUpdate=true). That explains why the update breaks the preview, but not when scrolling to it first. Fix the problem by improving svt::EmbeddedObjectRef::GetReplacement(): if getting an updated graphic fails, try to get a non-updated graphic. The result is that GetGraphic() after an UpdateReplacement() not only always return a non-nullptr Graphic, but also it's no longer of type None. Change-Id: I8e5ff4aaaefdc58e032b325bb4001f2a604ccc8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130086 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-02-17tdf#147196: Fix crash in editeng when applying title case formatMichael Warner1-0/+34
Fixes a possiblity of crashing when applying title case format using the edit engine. Change-Id: I4f44f635a1c96b021c084bb5bb973180744e56e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129888 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-17Refetch in case SwTextNode::InsertItem causes it to be deletedCaolán McNamara1-0/+0
Change-Id: Ie189ae4d37ffc33e58bb405f2521d1ae02a9997b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130072 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-16sw: layout: allow keep-with-next paragraph with fly to move backMichael Stahl2-0/+198
The problem is that a paragraph that has the fo:keep-with-next="always" and also a fly anchored at-char or at-para with style:flow-with-text="true" will never move to the previous page, even with space available. In SwContentFrame::MakeAll() it will first MoveBwd() and then go into the special case "if ( bKeep && bMoveable )" which calls Calc() on the next frame. But this fails to move the next frame because of SwFlowFrame::IsPrevObjMove() finding the fly with a mis-matching mpVertPosOrientFrame - that will not be fixed until the first SwContentFrame::MakeAll() is done and SwObjectFormatter::FormatObjsAtFrame() is called. But SwContentFrame::MakeAll() first detects that the frame is not on the same page as the next one despite bKeep, so it MoveFwd() again. This happens already in OOo 3.3. IsJoinLocked() should be a reasonably good heuristic for "is the previous frame being formatted". Change-Id: I86996dcb3d0c46fcb99ec9ad463569abbb8b99f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130033 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-16tdf#146622 sw crash fix: don't delete already deleted rowsLászló Németh1-0/+53
Delete tables and rows removed also tables and table rows with tracked row deletion/insertion. This resulted not only lost change tracking, but a crashing Undo. Crash regression from commit 99059a1ececa3621c2fe46fabdd79eed9d626c42 "tdf#143359 sw: track deletion of empty table rows". Non-tracked deletion of the tracked row changes was a temporary solution for the missing UI of tracked row changes, implemented in commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Note: UI was added in commit f348440e17debacbcba9153e238e010e8c020bdc "tdf#146120 sw: show tracked table changes with different color", commit 95c003d75e0f8b255344715a35358072b5eba99d "tdf#146145 sw: 1-click Accept/Reject of table row changes", commit 84fbb3398f7486f00e7b7dea415e1ea2510a9535 "tdf#146144 sw: add tooltip to table rows with change tracking", commit eebe4747d2d13545004937bb0267ccfc8ab9d63f "tdf#144270 sw: manage tracked table (row) deletion/insertion", commit f481c2c8e74bded11fac754e493560391229dbcd "tdf#144057 sw track changes: hide deleted table rows" and commit 23846867ea32667ccf328c36142394dd6aaee8ba "tdf#147182 sw: accept/reject all changes of a table selection". Change-Id: I384b750b0d3626fa8b3f256c7eaf5b93f382e4e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129958 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-02-16CppunitTest_sw_ooxmlexport2: avoid mustTestImportOf()Miklos Vajna1-28/+28
Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I68841addb024a45bc3a98e5fdb2994f0eacfadc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129977 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-15tdf#146848: sw_uiwriter3: Add unittestXisco Fauli1-0/+32
Change-Id: I6460a99ce31cbbcba0498a6caaaac3b304a5134e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129966 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-15sw HTML export: add a new LeadingTabWidth optionMiklos Vajna1-0/+36
This is a simple way to not loose indentation done with tabs (e.g. source code) during the HTML export. A more complex way would be ask the layout for the tab portion width, ask VCL what's the size of an nbsp glyph and then act accordingly, which is is not done here. Change-Id: I2a5c0512e9e5541e55e10f29952679bf05d63f1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129974 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins