From 50bbd1aefe0c78c254a18cc6e1dfeaf5c6858112 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 3 Jun 2013 14:51:24 +0200 Subject: Fix ooo51302-1.ods: check for special index value of -1 Change-Id: I3fbb700300d18a878cbf23c94e35bc69f864824b --- sc/source/core/tool/rangeutl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 054c61f1b605..1fbf0074f3c8 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -374,7 +374,7 @@ sal_Int32 ScRangeStringConverter::IndexOf( sal_Bool bQuoted = false; sal_Bool bExitLoop = false; - while( !bExitLoop && (nIndex < nLength) ) + while( !bExitLoop && (nIndex >= 0 && nIndex < nLength) ) { sal_Unicode cCode = rString[ nIndex ]; bExitLoop = (cCode == cSearchChar) && !bQuoted; -- cgit