From 7b95484915e476bba5af96ad27c4a6aae16c72b9 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sun, 30 Dec 2018 15:30:29 +0100 Subject: Base loops on getToken index, not on numer of tokens Change-Id: I5dea52157b42749bcd1925bd7a9fcefad1dc857f Reviewed-on: https://gerrit.libreoffice.org/66224 Tested-by: Jenkins Reviewed-by: Matteo Casalin --- xmloff/source/draw/animationimport.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 6402d130f26e..ccf3dfb39325 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -476,11 +476,8 @@ Sequence< Any > AnimationsImportHelperImpl::convertValueSequence( XMLTokenEnum e // fill the sequence Any* pValues = aValues.getArray(); - sal_Int32 nIndex; - for( nIndex = 0; nElements && (nIndex >= 0); nElements-- ) - { + for (sal_Int32 nIndex = 0; nIndex >= 0; ) *pValues++ = convertValue( eAttributeName, rValue.getToken( 0, ';', nIndex ) ); - } } return aValues; @@ -556,8 +553,7 @@ Any AnimationsImportHelperImpl::convertTiming( const OUString& rValue ) // fill the sequence Sequence< Any > aValues( nElements ); Any* pValues = aValues.getArray(); - sal_Int32 nIndex = 0; - while( (nElements--) && (nIndex >= 0) ) + for (sal_Int32 nIndex = 0; nIndex >= 0; ) *pValues++ = convertTiming( rValue.getToken( 0, ';', nIndex ) ); aAny <<= aValues; @@ -578,8 +574,7 @@ Sequence< double > AnimationsImportHelperImpl::convertKeyTimes( const OUString& if( nElements ) { double* pValues = aKeyTimes.getArray(); - sal_Int32 nIndex = 0; - while( (nElements--) && (nIndex >= 0) ) + for (sal_Int32 nIndex = 0; nIndex >= 0; ) *pValues++ = rValue.getToken( 0, ';', nIndex ).toDouble(); } @@ -598,8 +593,7 @@ Sequence< TimeFilterPair > AnimationsImportHelperImpl::convertTimeFilter( const if( nElements ) { TimeFilterPair* pValues = aTimeFilter.getArray(); - sal_Int32 nIndex = 0; - while( (nElements--) && (nIndex >= 0) ) + for (sal_Int32 nIndex = 0; nIndex >= 0; ) { const OUString aToken( rValue.getToken( 0, ';', nIndex ) ); -- cgit