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


On 05/12/2013 07:25 PM, julien2412 wrote:
cppcheck reported this:
<error file="svx/source/accessibility/svxrectctaccessiblecontext.cxx"
line="612" id="incorrectLogicOperator" severity="style" msg="Logical
disjunction always evaluates to true: nIndex &gt;= 0 || nIndex &lt; 0."/>

Indeed we have in this file that:
     610 void SvxRectCtlAccessibleContext::checkChildIndex( long nIndex )
throw( lang::IndexOutOfBoundsException )
     611 {
     612     if( nIndex < 0 || nIndex >= getAccessibleChildCount() )
     613         throw lang::IndexOutOfBoundsException();
     614 }

and that!
     883 sal_Int32 SAL_CALL
SvxRectCtlChildAccessibleContext::getAccessibleChildCount( void ) throw(
RuntimeException )
     884 {
     885     return 0;
     886 }

And this last one is like this since 2002!

What should be done here?

Unless Cppcheck does whole-program-analysis (does it?), this is a false positive. SvxRectCtlAccessibleContext::getAccessibleChildCount is virtual, and from just looking at svxrectctaccessiblecontext.cxx one cannot determine that there cannot be any overrides of it.

Stephan

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.