cui/source/dialogs/hyphen.cxx | 2 +- sc/source/filter/xml/xmlcelli.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
New commits: commit 3fbb307b970f41605a80c6ea3cbea0c9af9eb638 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Apr 17 09:17:43 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Apr 17 14:19:31 2023 +0200 tdf#151560 don't crash on loading dubious fods Change-Id: Ib41b3a95dd3829e8d3eca61621257fdd416bd8dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150499 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 0d0a81ebade6..a14424edace9 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1482,7 +1482,7 @@ bool ScXMLTableRowCellContext::IsPossibleErrorString() const return false; else if(mbNewValueType && mbErrorValue) return true; - return mbPossibleErrorCell || (mbCheckWithCompilerForError && + return mbPossibleErrorCell || (mbCheckWithCompilerForError && maStringValue && GetScImport().GetFormulaErrorConstant(*maStringValue) != FormulaError::NONE); } commit a6cd712ddeb1fc3a9cc5568d5e2f4eac9f8fcc2f Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Apr 15 20:25:36 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Apr 17 14:19:17 2023 +0200 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 <fit...@ubuntu.com> (cherry picked from commit 7584e403d57097ed4cc2d827d68895ec35cf805f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150331 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> 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;