summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/rangeutl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 1fbf0074f3c8..38305f698c71 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -394,7 +394,7 @@ sal_Int32 ScRangeStringConverter::IndexOfDifferent(
sal_Int32 nIndex = nOffset;
sal_Bool bExitLoop = false;
- while( !bExitLoop && (nIndex < nLength) )
+ while( !bExitLoop && (nIndex >= 0 && nIndex < nLength) )
{
bExitLoop = (rString[ nIndex ] != cSearchChar);
if( !bExitLoop )