diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-11-06 14:52:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-06 14:52:50 +0000 |
commit | 8f25d823a8d5488ae4880ae009a026f6fc07f611 (patch) | |
tree | a31e4913b558c4c136090d89c021a9f6001fcfcb /writerfilter | |
parent | 8050da9683e859c59ed0b74b1e040a59b888aeac (diff) |
check for return of -1 from getToken
as demonstrated by ooo91883-1.doc
Change-Id: I11a7f0747334f4cecbfd34c9353598d875be02c2
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index e1515d40b810..aaea9e0a5713 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1161,12 +1161,14 @@ util::DateTime lcl_DateStringToDateTime( const OUString& rDateTime ) nIndex = 0; aDateTime.Year = sal_uInt16( sDate.getToken( 0, '-', nIndex ).toInt32() ); aDateTime.Month = sal_uInt16( sDate.getToken( 0, '-', nIndex ).toInt32() ); - aDateTime.Day = sal_uInt16( sDate.copy( nIndex ).toInt32() ); + if (nIndex != -1) + aDateTime.Day = sal_uInt16( sDate.copy( nIndex ).toInt32() ); nIndex = 0; aDateTime.Hours = sal_uInt16( sTime.getToken( 0, ':', nIndex ).toInt32() ); aDateTime.Minutes = sal_uInt16( sTime.getToken( 0, ':', nIndex ).toInt32() ); - aDateTime.Seconds = sal_uInt16( sTime.copy( nIndex ).toInt32() ); + if (nIndex != -1) + aDateTime.Seconds = sal_uInt16( sTime.copy( nIndex ).toInt32() ); return aDateTime; } |