cppcheck: fix some redundantCondition warnings

Change-Id: If53d33fb4d9ca9dc1babb9043bd07c5d29fe74c2
Reviewed-on: https://gerrit.libreoffice.org/18353
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet 2015-09-05 13:15:15 +02:00
parent d417059dae
commit f0208db49d
5 changed files with 7 additions and 8 deletions

View File

@ -956,7 +956,7 @@ bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
{ {
if( rOp.GetType() == SbxEMPTY ) if( rOp.GetType() == SbxEMPTY )
{ {
if ( !bVBAInterop || ( bVBAInterop && ( eOp != SbxNOT ) ) ) if ( !bVBAInterop || ( eOp != SbxNOT ) )
goto Lbl_OpIsEmpty; goto Lbl_OpIsEmpty;
} }
if( Get( aL ) ) switch( eOp ) if( Get( aL ) ) switch( eOp )
@ -1185,7 +1185,7 @@ Lbl_OpIsDouble:
{ {
if( rOp.GetType() == SbxEMPTY ) if( rOp.GetType() == SbxEMPTY )
{ {
if ( !bVBAInterop || ( bVBAInterop && ( eOp != SbxNEG ) ) ) if ( !bVBAInterop || ( eOp != SbxNEG ) )
goto Lbl_OpIsEmpty; goto Lbl_OpIsEmpty;
} }
if( Get( aL ) ) if( Get( aL ) )

View File

@ -105,7 +105,7 @@ namespace {
int nGuidLen = GetStringFromClassID( *guidList[nInd], &pSubKey[23], 38 ); int nGuidLen = GetStringFromClassID( *guidList[nInd], &pSubKey[23], 38 );
BOOL bLocalSuccess = FALSE; BOOL bLocalSuccess = FALSE;
if ( nGuidLen && nGuidLen == 38 ) if ( nGuidLen == 38 )
{ {
if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, pSubKey, &hKey ) ) if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, pSubKey, &hKey ) )
{ {

View File

@ -557,8 +557,7 @@ void sharp()
if (infile->fp != NULL) if (infile->fp != NULL)
{ {
name = (infile->progname != NULL) ? infile->progname : infile->filename; name = (infile->progname != NULL) ? infile->progname : infile->filename;
if (sharpfilename == NULL || if (sharpfilename == NULL || (!streq(name, sharpfilename)))
(sharpfilename != NULL && !streq(name, sharpfilename)))
{ {
if (sharpfilename != NULL) if (sharpfilename != NULL)
free(sharpfilename); free(sharpfilename);

View File

@ -3684,7 +3684,7 @@ bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2)
aCell1.aAreaLink.Compare( aCell2.aAreaLink ) ) || aCell1.aAreaLink.Compare( aCell2.aAreaLink ) ) ||
!aCell1.bHasAreaLink ) !aCell1.bHasAreaLink )
{ {
if (!aCell1.bHasAnnotation || (aCell1.bHasAnnotation && false/*IsAnnotationEqual(aCell1.xCell, aCell2.xCell)*/)) // no longer compareable if (!aCell1.bHasAnnotation)
{ {
if ((((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.bIsAutoStyle == aCell2.bIsAutoStyle)) || if ((((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.bIsAutoStyle == aCell2.bIsAutoStyle)) ||
((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.nStyleIndex == -1))) && ((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.nStyleIndex == -1))) &&

View File

@ -7270,11 +7270,11 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace )
else else
{ {
FastAttributeList *pLRSpaceAttrList = FastSerializerHelper::createAttrList(); FastAttributeList *pLRSpaceAttrList = FastSerializerHelper::createAttrList();
if((0 != rLRSpace.GetTextLeft()) || ((0 == rLRSpace.GetTextLeft()) && rLRSpace.IsExplicitZeroMarginValLeft())) if((0 != rLRSpace.GetTextLeft()) || (rLRSpace.IsExplicitZeroMarginValLeft()))
{ {
pLRSpaceAttrList->add( FSNS( XML_w, ( bEcma ? XML_left : XML_start ) ), OString::number( rLRSpace.GetTextLeft() ) ); pLRSpaceAttrList->add( FSNS( XML_w, ( bEcma ? XML_left : XML_start ) ), OString::number( rLRSpace.GetTextLeft() ) );
} }
if((0 != rLRSpace.GetRight()) || ((0 == rLRSpace.GetRight()) && rLRSpace.IsExplicitZeroMarginValRight())) if((0 != rLRSpace.GetRight()) || (rLRSpace.IsExplicitZeroMarginValRight()))
{ {
pLRSpaceAttrList->add( FSNS( XML_w, ( bEcma ? XML_right : XML_end ) ), OString::number( rLRSpace.GetRight() ) ); pLRSpaceAttrList->add( FSNS( XML_w, ( bEcma ? XML_right : XML_end ) ), OString::number( rLRSpace.GetRight() ) );
} }