Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On Sat, 2013-03-16 at 14:03 -0700, julien2412 wrote:
Hello,

Scan coverity detected this: 
CID 988424 (#1 of 1): Logically dead code (DEADCODE)dead_error_line:
Execution cannot reach this expression "nExtBuInd + nExtParaNibble <
aStyleTextProp9->size()" inside statement "if (nExtParaNibble && nExtB...". 

Indeed, we have these lines:
   5026     if ( nExtParaPos )
   5027     {
   5028         sal_uInt32 nExtBuInd = nMask & 0x3c00;
   5029         sal_uInt32  nExtParaNibble = 0;
   5030         if ( nExtBuInd )
   5031             nExtBuInd = ( aSet.mnFlags & 0x3c00 ) >> 10;
   5032         if ( nExtBuInd < aStyleTextProp9.size() )
   5033         {
   5034             if ( nExtParaNibble && ( ( nExtBuInd + nExtParaNibble )
< aStyleTextProp9.size() ) )
   5035                 nExtBuInd += nExtParaNibble;

(see
http://opengrok.libreoffice.org/xref/core/filter/source/msfilter/svdfppt.cxx#5026)

Any idea what should be done?

Git doesn't seem able to track back to where this code was really
originally written across the old version control file moves and
removes. But throwing some key words into google I can find the original
code, and can determine it happened with
"StyleTextProp with empty text PPT import (bnc#485630) [Thorsten]" which
appeared to get merged to OpenOffice.org from ooo-build in Jun 2009.

The original code it was based on was originally a loop where multiple
properties were read and it made sense to increment nExtParaNibble
between properties. Now it doesn't.

So, yeah, all lines with nExtParaNibble in them or depend on those lines
or exist only to set that value can be removed as it enters the
condition as 0, and gets useless set to non 0 after exiting the
condition.

C.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.