diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 9e3a7bc277a7..13cdcb3ca53b 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -2564,6 +2564,20 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString ) } +static bool lcl_isBlanks( const OUString& rStr ) +{ + if (rStr.isEmpty()) + return false; + + for (sal_Int32 i = rStr.getLength(); i-- > 0; ) + { + if (rStr[i] != ' ') + return false; + } + return true; +} + + /** * Analyze string in the middle * All gone => true @@ -2665,8 +2679,9 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, sal_uInt16 nS (nNumericsCnt == 3 && // or 3 numbers (nStringPos == 3 || // and 4th string particle (nStringPos == 4 && nSign)) && // or 5th if signed - sStrArray[nStringPos-2].indexOf('/') == -1))) // and not 23/11/1999 - // that was not accepted as date yet + lcl_isBlanks(sStrArray[nStringPos-2])))) // and not 23/11/1999 + // that was not accepted as date yet, + // nor anything else than blanks after integer. { SkipBlanks(rString, nPos); if (nPos == rString.getLength())