diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2015-06-14 14:04:07 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2015-06-14 14:04:07 +0200 |
commit | 4d8cccbdacc58ee2def5cc38a4ef92734414aac2 (patch) | |
tree | 61683669576367bb3d60dd9f34417d539feff3af | |
parent | b226928c6d5d094359b970b64a063b243d4fc84c (diff) |
cppcheck: redundantCondition [part2]
Change-Id: I23e8a4834fa7858adb292ce0a4dfa5dab1ab5f00
-rw-r--r-- | svx/source/svdraw/gradtrns.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/htmltbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/layact.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/stacking.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/core/ProgressBarHelper.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterExportPropMapper.cxx | 4 |
22 files changed, 30 insertions, 43 deletions
diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx index 552ccb1f9145..ba6957014e26 100644 --- a/svx/source/svdraw/gradtrns.cxx +++ b/svx/source/svdraw/gradtrns.cxx @@ -335,7 +335,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad case css::awt::GradientStyle_RADIAL : case css::awt::GradientStyle_SQUARE : { - if(!bMoveSingle || (bMoveSingle && !bMoveFirst)) + if(!bMoveSingle || !bMoveFirst) { const basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY()); const basegfx::B2DPoint aOffset(aEndPos - aTopLeft); @@ -370,7 +370,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad aEndPos -= aOffset; } - if(!bMoveSingle || (bMoveSingle && bMoveFirst)) + if(!bMoveSingle || bMoveFirst) { basegfx::B2DVector aFullVec(aStartPos - aEndPos); const basegfx::B2DPoint aBottomLeft(aRange.getMinX(), aRange.getMaximum().getY()); @@ -431,7 +431,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad case css::awt::GradientStyle_ELLIPTICAL : case css::awt::GradientStyle_RECT : { - if(!bMoveSingle || (bMoveSingle && !bMoveFirst)) + if(!bMoveSingle || !bMoveFirst) { const basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY()); const basegfx::B2DPoint aOffset(aEndPos - aTopLeft); @@ -466,7 +466,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad aEndPos -= aOffset; } - if(!bMoveSingle || (bMoveSingle && bMoveFirst)) + if(!bMoveSingle || bMoveFirst) { basegfx::B2DVector aFullVec(aStartPos - aEndPos); const basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY()); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 75575da53690..d0d6e70af045 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2405,7 +2405,7 @@ void SdrCropViewHdl::CreateB2dIAObject() SdrMarkView* pView = pHdlList ? pHdlList->GetView() : 0; SdrPageView* pPageView = pView ? pView->GetSdrPageView() : 0; - if(!pPageView || (pPageView && pView->areMarkHandlesHidden())) + if(!pPageView || pView->areMarkHandlesHidden()) { return; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 104f48bee47d..fa8192b4b7cf 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1339,7 +1339,7 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != aOldStretchXVals+i ) break; // same value already attained once; algo is looping, exit - if (fFactor < 1.0 || (fFactor >= 1.0 && nCurrStretchX != 100)) + if (fFactor < 1.0 || nCurrStretchX != 100) { nCurrStretchX = sal::static_int_cast<sal_uInt16>(nCurrStretchX*fFactor); nCurrStretchY = sal::static_int_cast<sal_uInt16>(nCurrStretchY*fFactor); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 4601f4377dd3..4475e2595acc 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -888,7 +888,7 @@ static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl if ( pBox ) pBox->Enable(); } - else if ( pBox && ( pDocSh || ( !pDocSh && !ppFontList ))) + else if ( pBox && ( pDocSh || !ppFontList )) { // Disable box only when we have a SfxObjectShell and didn't get a font list OR // we don't have a SfxObjectShell and no current font list. diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 1dc1d432ced2..1ca85a523cfc 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -231,10 +231,7 @@ SwFlyFrameFormat* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, } eAnchorId = aAnch.GetAnchorId(); - if ( FLY_AT_PAGE != eAnchorId || - ( FLY_AT_PAGE == eAnchorId && - ( !pAnchor || - aAnch.GetPageNum() == 0 ) ) ) + if ( FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.GetPageNum() == 0) { aAnch.SetAnchor( &rAnchPos ); } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 324af8688742..155dee47db2b 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -263,9 +263,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, if ( (aAbsNew < aAbsIdx && aAbsNew > aPrevPos) || (aAbsIdx == aAbsNew && (sal_uLong(&rCurTOXMark) > sal_uLong(pTOXMark) && - (!pNew || - (pNew && (aPrevPos < aAbsIdx || - sal_uLong(pNew) < sal_uLong(pTOXMark)))))) || + (!pNew || aPrevPos < aAbsIdx || sal_uLong(pNew) < sal_uLong(pTOXMark) ) )) || (aPrevPos == aAbsNew && aAbsIdx != aAbsNew && sal_uLong(pTOXMark) > sal_uLong(pNew)) ) { @@ -287,9 +285,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, if ( (aAbsNew > aAbsIdx && aAbsNew < aNextPos) || (aAbsIdx == aAbsNew && (sal_uLong(&rCurTOXMark) < sal_uLong(pTOXMark) && - (!pNew || - (pNew && (aNextPos > aAbsIdx || - sal_uLong(pNew) > sal_uLong(pTOXMark)))))) || + (!pNew || aNextPos > aAbsIdx || sal_uLong(pNew) > sal_uLong(pTOXMark)) )) || (aNextPos == aAbsNew && aAbsIdx != aAbsNew && sal_uLong(pTOXMark) < sal_uLong(pNew)) ) { diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 7ed7668f10db..e50c7d166aab 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -501,7 +501,7 @@ void SwHTMLTableLayout::AutoLayoutPass1() if( nColSpan < nColSkip ) nColSkip = nColSpan; - if( !pCnts || (pCnts && !pCnts->IsPass1Done(nPass1Done)) ) + if( !pCnts || !pCnts->IsPass1Done(nPass1Done) ) { // The cell is empty or it's content was not edited if( nColSpan < nMinColSpan ) diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 904678877bbf..e2b67e7925ac 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1683,7 +1683,7 @@ bool SwLayAction::FormatContent( const SwPageFrm *pPage ) // all the time because the page height gets adjusted. // The same applies if the user wants to continue working and at least one // paragraph has been processed. - if ( (!pTab || (pTab && !bInValid)) ) + if (!pTab || !bInValid) { CheckIdleEnd(); // OD 14.04.2003 #106346# - consider interrupt formatting. diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index c60cb742e3b6..20fbfa9b89a0 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1828,8 +1828,7 @@ sal_uInt16 SwFrm::GetVirtPageNum() const pMod->GetInfo( aInfo ); if ( aInfo.GetPage() ) { - if( !pVirtPage || ( pVirtPage && aInfo.GetPage()-> - GetPhyPageNum() > pVirtPage->GetPhyPageNum() ) ) + if( !pVirtPage || aInfo.GetPage()->GetPhyPageNum() > pVirtPage->GetPhyPageNum() ) { pVirtPage = aInfo.GetPage(); pFrm = aInfo.GetFrm(); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 537a0f11e059..ffa7845b7f73 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -525,7 +525,7 @@ Size SwFrm::ChgSize( const Size& aNewSize ) void SwFrm::InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind ) { OSL_ENSURE( pParent, "No parent for insert." ); - OSL_ENSURE( (!pBehind || (pBehind && pParent == pBehind->GetUpper())), + OSL_ENSURE( (!pBehind || pParent == pBehind->GetUpper()), "Frame tree is inconsistent." ); mpUpper = pParent; @@ -560,7 +560,7 @@ void SwFrm::InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind ) void SwFrm::InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore ) { OSL_ENSURE( pParent, "No Parent for Insert." ); - OSL_ENSURE( (!pBefore || (pBefore && pParent == pBefore->GetUpper())), + OSL_ENSURE( (!pBefore || pParent == pBefore->GetUpper()), "Frame tree is inconsistent." ); mpUpper = pParent; diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 2b9fa877f9d7..6719a3e02458 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -970,8 +970,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, // Soll ein </P> geschrieben wenrden rInfo.bOutPara = bPara && - ( rHWrt.bCfgOutStyles || - (!rHWrt.bCfgOutStyles && bHasParSpace) ); + ( rHWrt.bCfgOutStyles || bHasParSpace ); // wenn kein End-Tag geschrieben werden soll, es loeschen if( bNoEndTag ) diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index e3dd39a8e1bc..387e28f23bed 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -166,7 +166,7 @@ void SwModule::StateOther(SfxItemSet &rSet) { bool bDisable = false; SfxViewShell* pCurrView = SfxViewShell::Current(); - if( !pCurrView || (pCurrView && !pCurrView->ISA(SwView)) ) + if( !pCurrView || !pCurrView->ISA(SwView) ) bDisable = true; SwDocShell *pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current()); if ( bDisable || diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 155e394e143d..d3d519ad570f 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -220,9 +220,7 @@ void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt ) if ( !( (nKey == KEY_Z || nKey == KEY_Y) && rKeyCode.IsMod1()) ) { bool bIsProtected = mrSidebarWin.IsProtected(); - if ( !bIsProtected || - ( bIsProtected && - !EditEngine::DoesKeyChangeText(rKeyEvt)) ) + if ( !bIsProtected || !EditEngine::DoesKeyChangeText(rKeyEvt) ) { bDone = GetTextView() && GetTextView()->PostKeyEvent( rKeyEvt ); } @@ -284,7 +282,7 @@ void SidebarTextControl::MouseButtonDown( const MouseEvent& rMEvt ) SvtSecurityOptions aSecOpts; bool bExecuteMod = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK); - if ( !bExecuteMod || (bExecuteMod && rMEvt.GetModifier() == KEY_MOD1)) + if ( !bExecuteMod || (rMEvt.GetModifier() == KEY_MOD1)) { const EditView& aEV = GetTextView()->GetEditView(); const SvxFieldItem* pItem = aEV.GetFieldUnderMousePointer(); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 61398c80b9d1..a210d2613909 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1525,7 +1525,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_GOTO_REFERENCE: { SwField *pField = rSh.GetCurField(); - if ( !pField || (pField && pField->GetTypeId() != TYP_GETREFFLD) ) + if ( !pField || (pField->GetTypeId() != TYP_GETREFFLD) ) rSet.DisableItem(nWhich); } break; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index ec74be984cd7..8df17d3e5102 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -2296,7 +2296,7 @@ void Content::insert( */ // ==> Complain on PUT, continue on MKCOL. - if ( !bTransient || ( bTransient && !bCollection ) ) + if ( !bTransient || !bCollection ) { ucb::UnsupportedNameClashException aEx( OUString( "Unable to write without overwrite!" ), diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 70f84047aa7c..d74cc7ced9ae 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -2443,7 +2443,7 @@ void Content::insert( */ // ==> Complain on PUT, continue on MKCOL. - if ( !bTransient || ( bTransient && !bCollection ) ) + if ( !bTransient || !bCollection ) { #undef ERROR ucb::UnsupportedNameClashException aEx( diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index da01c318a9b6..bc7a2c9965cd 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1061,11 +1061,9 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, DBG_ASSERT( !aTotalComponents.aComponentList.empty(), "Printer::GetPreparedMetaFile empty component" ); - DBG_ASSERT( !aTotalComponents.aBounds.IsEmpty() || - (aTotalComponents.aBounds.IsEmpty() && aTotalComponents.aComponentList.size() == 1), + DBG_ASSERT( !aTotalComponents.aBounds.IsEmpty() || (aTotalComponents.aComponentList.size() == 1), "Printer::GetPreparedMetaFile non-output generating actions must be solitary"); - DBG_ASSERT( !aTotalComponents.bIsFullyTransparent || - (aTotalComponents.bIsFullyTransparent && aTotalComponents.aComponentList.size() == 1), + DBG_ASSERT( !aTotalComponents.bIsFullyTransparent || (aTotalComponents.aComponentList.size() == 1), "Printer::GetPreparedMetaFile fully transparent actions must be solitary"); } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 7d01ba35778a..6d8c6d07784a 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -966,7 +966,7 @@ void Dialog::EndAllDialogs( vcl::Window* pParent ) while ( pModDialog ) { pTempModDialog = pModDialog->mpPrevExecuteDlg; - if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, true ) ) ) + if(!pParent || pParent->IsWindowOrChild(pModDialog,true)) { pModDialog->EndDialog( RET_CANCEL ); pModDialog->PostUserEvent( Link<>() ); diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 0059b5577baa..8f2e7bbea7d0 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -636,7 +636,7 @@ bool Window::IsTopWindow() const return false; // topwindows must be frames or they must have a borderwindow which is a frame - if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || (mpWindowImpl->mpBorderWindow && !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) ) + if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) ) return false; ImplGetWinData(); diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index 6ecfeaab65d5..c8bd5b064e84 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -567,7 +567,7 @@ void GtkSalMenu::NativeCheckItem( unsigned nSection, unsigned nItemPos, MenuItem else { // By default, all checked items are checkmark buttons. - if ( bCheck || ( !bCheck && pCurrentState != NULL ) ) + if (bCheck || pCurrentState != NULL) pCheckValue = g_variant_new_boolean( bCheck ); } diff --git a/xmloff/source/core/ProgressBarHelper.cxx b/xmloff/source/core/ProgressBarHelper.cxx index f8a44452939d..719ab804e3ad 100644 --- a/xmloff/source/core/ProgressBarHelper.cxx +++ b/xmloff/source/core/ProgressBarHelper.cxx @@ -68,7 +68,7 @@ void ProgressBarHelper::SetValue(sal_Int32 nTempValue) { if (xStatusIndicator.is() && (nReference > 0)) { - if ((nTempValue >= nValue) && (!bStrict || (bStrict && (nTempValue <= nReference)))) + if ((nTempValue >= nValue) && (!bStrict || (nTempValue <= nReference))) { // #91317# no progress bar with values > 100% if (nTempValue > nReference) diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index fa9375738ff5..8dd4b0266576 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -532,14 +532,14 @@ void XMLPageMasterExportPropMapper::ContextFilter( aHeaderBuffer.ContextFilter( rPropState ); aFooterBuffer.ContextFilter( rPropState ); - if( pPMHeaderHeight && (!pPMHeaderDynamic || (pPMHeaderDynamic && getBOOL( pPMHeaderDynamic->maValue ))) ) + if( pPMHeaderHeight && (!pPMHeaderDynamic || getBOOL( pPMHeaderDynamic->maValue )) ) lcl_RemoveState( pPMHeaderHeight ); if( pPMHeaderMinHeight && pPMHeaderDynamic && !getBOOL( pPMHeaderDynamic->maValue ) ) lcl_RemoveState( pPMHeaderMinHeight ); if( pPMHeaderDynamic ) lcl_RemoveState( pPMHeaderDynamic ); - if( pPMFooterHeight && (!pPMFooterDynamic || (pPMFooterDynamic && getBOOL( pPMFooterDynamic->maValue ))) ) + if( pPMFooterHeight && (!pPMFooterDynamic || getBOOL( pPMFooterDynamic->maValue )) ) lcl_RemoveState( pPMFooterHeight ); if( pPMFooterMinHeight && pPMFooterDynamic && !getBOOL( pPMFooterDynamic->maValue ) ) lcl_RemoveState( pPMFooterMinHeight ); |