[Libreoffice] cppcheck : Same expression on both sides of '!='
Julien Nabet
serval2412 at yahoo.fr
Sun May 8 14:01:20 PDT 2011
Le 07/05/2011 16:01, Julien Nabet a écrit :
> Hello,
>
> Here are 2 examples of "Same expression on both sides of '!='" I found :
> [sc/source/core/tool/rangeutl.cxx:507] ->
> [sc/source/core/tool/rangeutl.cxx:507]: (style) Same expression on
> both sides of '!='
> [sc/source/core/tool/rangeutl.cxx:534] ->
> [sc/source/core/tool/rangeutl.cxx:534]: (style) Same expression on
> both sides of '!='
>
> Is it a special "C++ thing" (like overloading operator) or is there a
> problem here ?
>
Hello,
Here are the context for both of the cppcheck warnings :
497 if( nOffset >= 0 )
498 {
499 sal_Int32 nIndex = IndexOf( sToken, ':', 0, cQuote );
500 String aUIString(sToken);
501
502 if( nIndex < 0 )
503 {
504 if ( aUIString.GetChar(0) == (sal_Unicode) '.' )
505 aUIString.Erase( 0, 1 );
506 bResult = ((rRange.aStart.Parse( aUIString,
const_cast<ScDocument*> (pDocument), eConv) & SCA_VALID) == SCA_VALID);
507 if (!bResult && eConv != eConv)
508 bResult = ((rRange.aStart.Parse(
509 aUIString,
const_cast<ScDocument*>(pDocument), eConv) & SCA_VALID) == SCA_VALID);
510 rRange.aEnd = rRange.aStart;
511 }
512 else
513 {
514 if ( aUIString.GetChar(0) == (sal_Unicode) '.' )
515 {
516 aUIString.Erase( 0, 1 );
517 --nIndex;
518 }
519
520 if ( nIndex < aUIString.Len() - 1 &&
521 aUIString.GetChar((xub_StrLen)nIndex + 1)
== (sal_Unicode) '.' )
522 aUIString.Erase( (xub_StrLen)nIndex + 1, 1 );
523
524 bResult = ((rRange.Parse(aUIString,
const_cast<ScDocument*> (pDocument), eConv) & SCA_VALID) == SCA_VALID);
525
526 // #i77703# chart ranges in the file format contain
both sheet names, even for an external reference sheet.
527 // This isn't parsed by ScRange, so try to parse
the two Addresses then.
528 if (!bResult)
529 {
530 bResult = ((rRange.aStart.Parse(
aUIString.Copy(0, (xub_StrLen)nIndex), const_cast<ScDocument*>(pDocument),
531 eConv) & SCA_VALID) ==
SCA_VALID) &&
532 ((rRange.aEnd.Parse(
aUIString.Copy((xub_StrLen)nIndex+1), const_cast<ScDocument*>(pDocument),
533 eConv) & SCA_VALID) == SCA_VALID);
534 if (!bResult && eConv != eConv)
535 {
536 bResult = ((rRange.aStart.Parse(
aUIString.Copy(0, (xub_StrLen)nIndex), const_cast<ScDocument*>(pDocument),
Julien.
More information about the LibreOffice
mailing list