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 /sw | |
parent | b226928c6d5d094359b970b64a063b243d4fc84c (diff) |
cppcheck: redundantCondition [part2]
Change-Id: I23e8a4834fa7858adb292ce0a4dfa5dab1ab5f00
Diffstat (limited to 'sw')
-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 |
10 files changed, 13 insertions, 24 deletions
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; |