From a3f8a1c1df3e57b541e76156179f81972e845814 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 4 Jul 2015 20:13:25 +0100 Subject: coverity#1309263 Improper use of negative value and coverity#1309264 Improper use of negative value Change-Id: I496e92211b9ca0a7a27a7f00d17cff428cb3b42b --- oox/source/vml/vmlshape.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'oox/source/vml/vmlshape.cxx') diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 2c2f6eb4a685..41f4ebd6dd71 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -317,11 +317,14 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS sal_Int32 id = 0; sal_Int32 idPos = sLinkChainName.indexOf("_x"); sal_Int32 seq = 0; - sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos); - if( idPos >= 0 && idPos < seqPos ) + if (idPos >= 0) { - id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32(); - seq = sLinkChainName.copy(seqPos+2).toInt32(); + sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos); + if (idPos < seqPos) + { + id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32(); + seq = sLinkChainName.copy(seqPos+2).toInt32(); + } } OUString s_mso_next_textbox; -- cgit