[Libreoffice-commits] core.git: svx/source sw/source ucb/source vcl/source vcl/unx xmloff/source
Julien Nabet
serval2412 at yahoo.fr
Sun Jun 14 05:05:27 PDT 2015
svx/source/svdraw/gradtrns.cxx | 8 ++++----
svx/source/svdraw/svdhdl.cxx | 2 +-
svx/source/svdraw/svdotext.cxx | 2 +-
svx/source/tbxctrls/tbcontrl.cxx | 2 +-
sw/source/core/doc/doclay.cxx | 5 +----
sw/source/core/doc/doctxm.cxx | 8 ++------
sw/source/core/doc/htmltbl.cxx | 2 +-
sw/source/core/layout/layact.cxx | 2 +-
sw/source/core/layout/trvlfrm.cxx | 3 +--
sw/source/core/layout/wsfrm.cxx | 4 ++--
sw/source/filter/html/htmlatr.cxx | 3 +--
sw/source/uibase/app/apphdl.cxx | 2 +-
sw/source/uibase/docvw/SidebarTxtControl.cxx | 6 ++----
sw/source/uibase/shells/textsh1.cxx | 2 +-
ucb/source/ucp/webdav-neon/webdavcontent.cxx | 2 +-
ucb/source/ucp/webdav/webdavcontent.cxx | 2 +-
vcl/source/gdi/print2.cxx | 6 ++----
vcl/source/window/dialog.cxx | 2 +-
vcl/source/window/stacking.cxx | 2 +-
vcl/unx/gtk/window/gtksalmenu.cxx | 2 +-
xmloff/source/core/ProgressBarHelper.cxx | 2 +-
xmloff/source/style/PageMasterExportPropMapper.cxx | 4 ++--
22 files changed, 30 insertions(+), 43 deletions(-)
New commits:
commit 4d8cccbdacc58ee2def5cc38a4ef92734414aac2
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Jun 14 14:04:07 2015 +0200
cppcheck: redundantCondition [part2]
Change-Id: I23e8a4834fa7858adb292ce0a4dfa5dab1ab5f00
diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx
index 552ccb1..ba69570 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 75575da..d0d6e70 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 104f48b..fa8192b 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 4601f43..4475e25 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 1dc1d43..1ca85a5 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 324af86..155dee4 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 7ed7668..e50c7d1 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 9046788..e2b67e7 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 c60cb74..20fbfa9 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 537a0f1..ffa7845 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 2b9fa87..6719a3e 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 e3dd39a..387e28f 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 155e394..d3d519a 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 61398c8..a210d26 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 ec74be9..8df17d3 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 70f8404..d74cc7c 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 da01c31..bc7a2c9 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 7d01ba3..6d8c6d0 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 0059b55..8f2e7bb 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 6ecfeaa..c8bd5b0 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 f8a4445..719ab80 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 fa93757..8dd4b02 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 );
More information about the Libreoffice-commits
mailing list