Created attachment 179679 [details] document to reproduce the issue Editing: Crash when deleting a piece of text with change tracking enabled, but hidden After opening it in Writer, select the following piece of text, and press Delete: "either contributed [...] or funded" -> Crash. In a debug build, it crashes with the following assert: sw/source/core/inc/drawfont.hxx:122: SwDrawTextInfo::SwDrawTextInfo(const SwViewShell*, OutputDevice&, const SwScriptInfo*, const rtl::OUString&, TextFrameIndex, TextFrameIndex, sal_uInt16, bool, const vcl::text::TextLayoutCache*): Assertion `(nLen == TextFrameIndex(COMPLETE_STRING)) ? (nIdx.get() < rText.getLength()) : (nIdx + nLen).get() <= rText.getLength()' failed.
For me, it crashes if I remove 'either contributed by volunteers'
Reproduced in Version: 7.4.0.0.alpha0+ / LibreOffice Community Build ID: 8e4453c2117b6c3bb15be6b949a0a8a43df66647 CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded
Also reproduced in Version: 6.4.0.0.alpha1+ Build ID: 9bc848cf0d301aa57eabcffa101a1cf87bad6470 CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; Locale: es-ES (es_ES.UTF-8); UI-Language: en-US Calc: threaded
To check after the fix is in: 1. Select the following piece of text, and press Delete: "either contributed [...] or funded" 2. Press CTRL+Z It currently doesn't restore properly (on non-debug build); comment is lost. But maybe it's related to the assert.
sorry, i was too busy to answer properly on IRC. some more tips for debugging: * the text frame is formatted in SwTextFrame::Format - set a break there and check that when it is called following the delete, the GetPara()->GetReformat() shows the deleted text range, and that it matches the still visible portions in GetMergedPara() - if this looks correct, the problem is in the formatting - if it looks wrong, the problem is before, in (missing) invalidations * SwTextFrame::SwClientNotify should receive invalidations * SwTextFormatter::BuildPortions contains a loop that builds the text portions (SwLinePortion subclasses) for a single line of text (SwLineLayout) * see this article for some docs on the text formatting https://wiki.openoffice.org/wiki/Writer/Text_Formatting
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/515bf5d4afa3a8ed413fd6f17f66fa98b6dbf29e tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/571e546bcc76e21f16a9f2929caa48c7abd8055a tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden It will be available in 7.3.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/3b539b30c3a6559d6b4cf32c2b02fc5d81a0b794 tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden It will be available in 7.2.8. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-7-2-7": https://git.libreoffice.org/core/commit/01e587b4888e12f38ed66f6057e00dbceec025bb tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden It will be available in 7.2.7. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Assert is gone Version: 7.4.0.0.alpha1+ / LibreOffice Community Build ID: 7e2d26ef0ed47bf01d7396aa7c749062f9bdde98 CPU threads: 8; OS: Mac OS X 12.3.1; UI render: Skia/Metal; VCL: osx Locale: nl-NL (nl_NL.UTF-8); UI: en-US Calc: threaded