summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-04-15 20:25:36 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-04-17 14:19:51 +0200
commit8ecccc379477def5085743d2b024bb99eba0ebc8 (patch)
tree265f0931155d69343e1293450e398bf45754405c
parentbump product version to 7.5.3.1.0+ (diff)
downloadcore-8ecccc379477def5085743d2b024bb99eba0ebc8.tar.gz
core-8ecccc379477def5085743d2b024bb99eba0ebc8.zip
Resolves: tdf#153958 Hyphenation crashes with -Alte...
nPos2 is 0 due to the -, so aLeft is empty, nPos is set to 0 then incremented to 1, aLeft.replaceFirst is run after its end pos so crashes/asserts. Presumably we can do nothing meaningful here so skip if nPos2 is 0 Change-Id: I09754c4b2567fe5c1b4c36de0b36ee99f575244d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150327 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 7584e403d57097ed4cc2d827d68895ec35cf805f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150502 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--cui/source/dialogs/hyphen.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index cc6666d7de8c..259ec5d03395 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -161,7 +161,7 @@ OUString SvxHyphenWordDialog::EraseUnusableHyphens_Impl()
// 2) remove all hyphenation positions from the start that are not considered by the core
const std::u16string_view aSearchRange( aTxt.subView( 0, nPos1 ) );
size_t nPos2 = aSearchRange.rfind( '-' ); // the '-' position the core will use by default
- if (nPos2 != std::u16string_view::npos )
+ if (nPos2 != std::u16string_view::npos && nPos2 != 0)
{
OUString aLeft( aSearchRange.substr( 0, nPos2 ) );
nPos = 0;