summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/control/field2.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index b08bd78814d7..c415b04795e4 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1343,7 +1343,7 @@ void DateField::ImplDateSpinArea( bool bUp )
for ( sal_Int8 i = 1; i <= 3; i++ )
{
nPos = aText.indexOf( aDateSep, nPos );
- if ( nPos >= (sal_Int32)aSelection.Max() )
+ if (nPos < 0 || nPos >= (sal_Int32)aSelection.Max())
{
nDateArea = i;
break;