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

Julien Nabet serval2412 at yahoo.fr
Mon May 13 10:30:06 PDT 2013


 vcl/source/control/field.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b12ef43863228c5b2f5b2c189e309f2228237120
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun May 12 15:36:30 2013 +0200

    cppcheck: fix arrayIndexThenCheck in vcl
    
    Change-Id: Id7258dd35c131c2c8151bc5e0f97076241e6d10f
    Reviewed-on: https://gerrit.libreoffice.org/3868
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index c035678..87043dd 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -201,7 +201,7 @@ static bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue,
     {
         // check if string is equivalent to zero
         sal_Int16 nIndex = bNegative ? 1 : 0;
-        while( aStr[nIndex] == '0' && nIndex < aStr.getLength() )
+        while (nIndex < aStr.getLength() && aStr[nIndex] == '0')
             ++nIndex;
         if( nIndex < aStr.getLength() )
         {


More information about the Libreoffice-commits mailing list