[Libreoffice-commits] core.git: xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jan 13 10:02:36 UTC 2019


 xmloff/source/draw/animationimport.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 7b95484915e476bba5af96ad27c4a6aae16c72b9
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Dec 30 15:30:29 2018 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sun Jan 13 11:02:15 2019 +0100

    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 <matteo.casalin at yahoo.com>

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 ) );
 


More information about the Libreoffice-commits mailing list