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


Hello,

Cppchecks reports this : 
core/editeng/source/accessibility/AccessibleStaticTextBase.cxx
346     duplicateExpression     style   Same expression on both sides of '&&'.

Here are the lines :
    342     void AccessibleStaticTextBase_Impl::CorrectTextSegment(
TextSegment&    aTextSegment,
    343                                                             int            
nPara   ) const
    344     {
    345         // Keep 'invalid' values at the TextSegment
    346         if( aTextSegment.SegmentStart != -1 &&
    347             aTextSegment.SegmentStart != -1 )
    348         {
    349             // #112814# Correct TextSegment by paragraph offset
    350             sal_Int32 nOffset(0);
    351             int i;
    352             for(i=0; i<nPara; ++i)
    353                 nOffset += GetParagraph(i).getCharacterCount();
    354 
    355             aTextSegment.SegmentStart += nOffset;
    356             aTextSegment.SegmentEnd += nOffset;
    357         }
    358     }

It's been there since the initial import in 2010.

Should it be just replaced by this :
          if( aTextSegment.SegmentStart != -1 &&
               aTextSegment.SegmentEnd != -1 )

or is it not so obvious ?

Julien.



--
View this message in context: 
http://nabble.documentfoundation.org/Same-expression-on-both-sides-of-on-editeng-source-accessibility-AccessibleStaticTextBase-cxx-tp3704737p3704737.html
Sent from the Dev mailing list archive at Nabble.com.

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.