summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-18 16:47:20 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-11-24 21:58:22 +0100
commit9324eb0ddbf312bdbd2448576189deaaf74d738e (patch)
treed0c64475269a875eb73b61ecf48c668b7fc9340a
parent70ccb4e299c147e6ea44ea22bebc9c7f5617cc3d (diff)
crashreporting: svx::SentenceEditWindow_Impl::CreateSpellPortions()
cui/source/dialogs/SpellDialog.cxx:2005 aRet[ aRet.size() - 1 ].sText += aLeftOverText; presumably aRet is empty() here a) don't bother appending if aLeftOverText is empty() b) don't crah if aRet is empty() and aLeftOverText is not Change-Id: Ie9a9585f572d8afb17183b479fb6f2cce5952aa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158124 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit e7e5b43c4906d9f0e199f689addc29aa98916e6e)
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 204a0b308a2e..58558b660c6e 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1973,7 +1973,7 @@ svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions() const
aPortion2.sText = aLeftOverText.makeStringAndClear();
aRet.push_back( aPortion2 );
}
- else
+ else if (!aLeftOverText.isEmpty() && !aRet.empty())
{ // we just need to append the left-over text to the last portion (which had no errors)
aRet[ aRet.size() - 1 ].sText += aLeftOverText;
}