cui/source/dialogs/SpellDialog.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 25a251d3c0c3dcf41874dfb2a13f24c423e1e388
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Oct 18 16:47:20 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Oct 19 09:34:55 2023 +0200

    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/+/158047
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 692c8e4512d1..1da34447f779 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -2000,7 +2000,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;
             }

Reply via email to