sc/source/core/tool/interpr1.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 05299b4205fa0960c3b2ed55a8c4963ee76238be Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jun 22 19:56:15 2022 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Thu Jun 23 16:14:12 2022 +0200 crashtesting: assert in rtl_uString_iterateCodePoints with forum-en-32401.ods probably since: commit 78b7e5f76e72647e0cab662ad2c9342d4538704f Date: Thu Nov 23 18:21:19 2017 +0100 tdf#97198 Make Calc function SEARCH work with UniCode non-BMP characters. Change-Id: I538c034820e606ba4397f42567dd3087f14129fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136296 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 13745246a8b2..dbffd939d53d 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -9046,12 +9046,12 @@ void ScInterpreter::ScFind() { sal_Int32 nIdx = 0; nCnt = 0; - while ( nIdx <= nPos ) + while ( nIdx < nPos ) { sStr.iterateCodePoints( &nIdx ); ++nCnt; } - PushDouble( static_cast<double>(nCnt) ); + PushDouble( static_cast<double>(nCnt + 1) ); } } } @@ -9445,12 +9445,12 @@ void ScInterpreter::ScSearch() { sal_Int32 nIdx = 0; sal_Int32 nCnt = 0; - while ( nIdx <= nPos ) + while ( nIdx < nPos ) { sStr.iterateCodePoints( &nIdx ); ++nCnt; } - PushDouble( static_cast<double>(nCnt) ); + PushDouble( static_cast<double>(nCnt + 1) ); } } }