sw/source/uibase/docvw/edtwin2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 02bae444860ae8b5627330b051d4b9a911697856 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue May 27 15:40:55 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed May 28 00:48:46 2025 +0200 if nTextLen is 0 this loop never ends seen in crash report as: [ admin ] ERR Aborted resource consuming doc | wsd/AdminModel.cpp:802 program/libuno_sal.so.3 void rtl::str::stringbuffer_insert<_rtl_uString, char16_t>(_rtl_uString**, int*, int, char16_t const*, int) sal/rtl/strtmpl.hxx:1262 program/../program/libswlo.so SwEditWin::RequestHelp(HelpEvent const&) sw/source/uibase/docvw/edtwin2.cxx:464 program/libmergedlo.so (anonymous namespace)::LOKPostAsyncEvent(void*, void*) sfx2/source/view/lokhelper.cxx:1203 program/../program/libswlo.so SwXTextDocument::postMouseEvent(int, int, int, int, int, int) include/rtl/ref.hxx:125 program/libmergedlo.so doc_postMouseEvent desktop/source/lib/init.cxx:5595 Change-Id: I43b33ec0ac29ea1a8bb02ec58d3191b0b8d3d7e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185919 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 11b3b3d4d9d1..b776c8ddc483 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -459,7 +459,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) OUStringBuffer sStrBuffer(sName); sal_Int32 nTextLen = sText.getLength(); sal_Int32 nNameLen = sName.getLength(); - if (nNameLen > nTextLen) + if (nTextLen > 0 && nNameLen > nTextLen) { for (sal_Int32 i = nTextLen - 1; i < nNameLen; i += nTextLen) sStrBuffer.insert(i + 1, std::u16string_view(u" "));