From bbe02c2212a24a1984c951b0d32001b54cf307a0 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Thu, 21 Feb 2013 19:04:05 -0600 Subject: coverity#705444 Improper use of negative value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie3b7634e099de5c8b9a4a77daf47c6038dade370 Reviewed-on: https://gerrit.libreoffice.org/2320 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/chart/SchXMLTools.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 5752fad35afa..9d95a61fa60c 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -96,9 +96,8 @@ sal_Int32 lcl_getBuildIDFromGenerator( const ::rtl::OUString& rGenerator ) //returns -1 if nothing found sal_Int32 nBuildId = -1; const OUString sBuildCompare( "$Build-" ); - sal_Int32 nEnd = -1; - sal_Int32 nBegin = rGenerator.indexOf( sBuildCompare, nEnd ); - if( nBegin != -1 ) + sal_Int32 nBegin = rGenerator.indexOf( sBuildCompare ); + if( nBegin >= 0 ) { OUString sBuildId( rGenerator.copy( nBegin + sBuildCompare.getLength() ) ); nBuildId = sBuildId.toInt32(); -- cgit