summaryrefslogtreecommitdiffstats
path: root/sw/CppunitTest_sw_core_text.mk
Commit message (Collapse)AuthorAgeFilesLines
* tdf#148683 sw: fix crash on deleting text with redlining enabled, but hiddenMiklos Vajna2022-06-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression from commit 32902f66e7749b2d06d13f50416be5323a0c0ea9 (sw_redlinehide: make layout based Show/Hide mode the default, 2018-11-30), deleting some text in the middle of the paragraph with the bugdoc results in an assertion failure in the SwDrawTextInfo ctor. Normally this doesn't happen on text deletion as we already have a mechanism for truncating no longer needed lines in SwTextFrame::Format_(), though that only checks the length of the current line. Fix the problem by extending this mechanism to also check the remaining lines: if change tracking is on and the total of all line lengths is more than the string length of the text frame, then time to re-calculate. It seems this is not needed in practice when redlining is disabled, though we might want to enable this for the non-redline case as well in the future. (cherry picked from commit 515bf5d4afa3a8ed413fd6f17f66fa98b6dbf29e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133684 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133693 (cherry picked from commit 3b539b30c3a6559d6b4cf32c2b02fc5d81a0b794) Change-Id: Iede03e11daceb3c2b614a301e21560b075a60c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133888 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
* tdf#128736 sw ContinuousEndnotes: fix use-after-free on text frame joinMiklos Vajna2019-11-151-0/+68
Regression from commit 61cf196631a2a846e0d3b8b83c0805cf4d1d14b2 (sw ContinuousEndnotes: fix moving them to the previous page, 2019-10-25), the problem was that the SwFootnoteFrame::mpReference was not updated on frame split. This meant that by the time the frame was joined, SwTextFrame::JoinFrame() thought that the follow has no footnotes, so the footnote reference was not updated, resulting in a dangling pointer. Fix the problem by going back to using bEnd for endnotes (both the Word compat and the normal case), this means that SwTextFrame::ConnectFootnote() will invoke SwFootnoteBossFrame::ChangeFootnoteRef(), fixing the dangling pointer. Then fix the original problem differently: similar to the in-section endnotes, just remove + append them, this makes sure that the endnotes (in the Word compat case) move to a previous page on page delete. (cherry picked from commit 0e0bad1a6a3affa2b3fd82cc3834ae03ea7bc1d5) Change-Id: Ia1b8e54b4a0b0f385c703f8e7016011c3ac57a03 Reviewed-on: https://gerrit.libreoffice.org/82808 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>