[Libreoffice-commits] core.git: writerfilter/source
Caolán McNamara
caolanm at redhat.com
Wed Nov 6 15:53:54 CET 2013
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 8f25d823a8d5488ae4880ae009a026f6fc07f611
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 6 14:52:42 2013 +0000
check for return of -1 from getToken
as demonstrated by ooo91883-1.doc
Change-Id: I11a7f0747334f4cecbfd34c9353598d875be02c2
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index e1515d4..aaea9e0 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;
}
More information about the Libreoffice-commits
mailing list