cppcheck: redundantCondition [part1]
Change-Id: I21c5340e7b5ec09248b08aa76f43acf883c56cd8
This commit is contained in:
parent
01a189abcd
commit
b226928c6d
@ -831,7 +831,7 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
|
||||
if ( pWindow_->GetDocument().isInVBAMode() )
|
||||
{
|
||||
SbModule* pMod = StarBASIC::GetActiveModule();
|
||||
if ( !pMod || ( pMod && ( !pMod->GetName().equals(pWindow_->GetName()) ) ) )
|
||||
if ( !pMod || !pMod->GetName().equals(pWindow_->GetName()))
|
||||
{
|
||||
bStop = false;
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt
|
||||
SbModuleRef xModule;
|
||||
// Only reparse modules if ScriptDocument source is out of sync
|
||||
// with basic's Module
|
||||
if ( !pMod || ( pMod && pMod->GetSource() != aOUSource ) )
|
||||
if ( !pMod || pMod->GetSource() != aOUSource )
|
||||
{
|
||||
xModule = new SbModule( rModName );
|
||||
xModule->SetSource32( aOUSource );
|
||||
@ -432,7 +432,7 @@ bool HasMethod (
|
||||
SbModuleRef xModule;
|
||||
// Only reparse modules if ScriptDocument source is out of sync
|
||||
// with basic's Module
|
||||
if ( !pMod || ( pMod && pMod->GetSource() != aOUSource ))
|
||||
if ( !pMod || pMod->GetSource() != aOUSource )
|
||||
{
|
||||
xModule = new SbModule( rModName );
|
||||
xModule->SetSource32( aOUSource );
|
||||
|
@ -302,8 +302,7 @@ namespace basegfx
|
||||
{
|
||||
OSL_PRECOND( !mbIsFinished,
|
||||
"ImplPolygon::intersect(): called on already finished polygon!" );
|
||||
OSL_PRECOND( !isFinishingEdge
|
||||
|| (isFinishingEdge && &rEvent.getRect() == &rActiveEdge.getRect()),
|
||||
OSL_PRECOND( !isFinishingEdge || &rEvent.getRect() == &rActiveEdge.getRect(),
|
||||
"ImplPolygon::intersect(): inconsistent ending!" );
|
||||
|
||||
const B2DPoint aIntersectionPoint( rEvent.getPos(),
|
||||
|
@ -1628,7 +1628,7 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
|
||||
SbxDataType eVarType = refVar->GetType();
|
||||
SbxDataType eValType = refVal->GetType();
|
||||
|
||||
if ( !( !bVBA|| ( bVBA && refVar->GetType() != SbxEMPTY ) ) || !refVar->CanWrite() )
|
||||
if ( !( !bVBA || refVar->GetType() != SbxEMPTY ) || !refVar->CanWrite() )
|
||||
return false;
|
||||
|
||||
if ( eValType != SbxOBJECT )
|
||||
@ -1825,7 +1825,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
|
||||
|
||||
// Getting in here causes problems with objects with default properties
|
||||
// if they are SbxEMPTY I guess
|
||||
if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) )
|
||||
if ( !bHandleDefaultProp || eValType == SbxOBJECT )
|
||||
{
|
||||
// activate GetOject for collections on refVal
|
||||
SbxBase* pObjVarObj = refVal->GetObject();
|
||||
@ -3842,7 +3842,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
|
||||
}
|
||||
}
|
||||
// consider index-access for UnoObjects
|
||||
else if( pElem->GetType() == SbxOBJECT && !pElem->ISA(SbxMethod) && ( !bVBAEnabled || ( bVBAEnabled && !pElem->ISA(SbxProperty) ) ) )
|
||||
else if( pElem->GetType() == SbxOBJECT && !pElem->ISA(SbxMethod) && ( !bVBAEnabled || !pElem->ISA(SbxProperty) ) )
|
||||
{
|
||||
pPar = pElem->GetParameters();
|
||||
if ( pPar )
|
||||
|
@ -885,8 +885,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
|
||||
bool bPropExisted =
|
||||
( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldVal );
|
||||
|
||||
if( ! bPropExisted ||
|
||||
( bPropExisted && fOldVal != fVal ))
|
||||
if( ! bPropExisted || fOldVal != fVal )
|
||||
{
|
||||
GetPropertySet()->setPropertyValue( "TextRotation" , uno::makeAny( fVal ));
|
||||
bChangedOtherwise = true;
|
||||
|
@ -505,8 +505,7 @@ bool DataPointItemConverter::ApplySpecialItem(
|
||||
bool bPropExisted =
|
||||
( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldValue );
|
||||
|
||||
if( ! bPropExisted ||
|
||||
( bPropExisted && fOldValue != fValue ))
|
||||
if( ! bPropExisted || fOldValue != fValue )
|
||||
{
|
||||
GetPropertySet()->setPropertyValue( "TextRotation" , uno::makeAny( fValue ));
|
||||
bChanged = true;
|
||||
|
@ -459,8 +459,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
|
||||
bool bPropExisted =
|
||||
(GetPropertySet()->getPropertyValue("TextRotation") >>= fOldValue);
|
||||
|
||||
if (!bPropExisted ||
|
||||
(bPropExisted && fOldValue != fValue))
|
||||
if (!bPropExisted || fOldValue != fValue)
|
||||
{
|
||||
GetPropertySet()->setPropertyValue("TextRotation", uno::makeAny(fValue));
|
||||
bChanged = true;
|
||||
|
@ -186,8 +186,7 @@ bool TitleItemConverter::ApplySpecialItem(
|
||||
bool bPropExisted =
|
||||
( GetPropertySet()->getPropertyValue( "TextRotation" ) >>= fOldVal );
|
||||
|
||||
if( ! bPropExisted ||
|
||||
( bPropExisted && fOldVal != fVal ))
|
||||
if( ! bPropExisted || fOldVal != fVal )
|
||||
{
|
||||
GetPropertySet()->setPropertyValue( "TextRotation" , uno::makeAny( fVal ));
|
||||
bChanged = true;
|
||||
|
@ -265,7 +265,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
|
||||
{
|
||||
aName = aName.copy(0, (aName.getLength()-(aFilenameExtension.getLength()+1)));
|
||||
sal_Unicode nChar = aName.toChar();
|
||||
if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
|
||||
if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || (nChar < '0' || nChar > '9')) )
|
||||
{
|
||||
aRow.push_back(new ORowSetValueDecorator(aName));
|
||||
bNewRow = true;
|
||||
@ -280,7 +280,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
|
||||
if (aURL.getExtension().isEmpty())
|
||||
{
|
||||
sal_Unicode nChar = aURL.getBase()[0];
|
||||
if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
|
||||
if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || (nChar < '0' || nChar > '9') ) )
|
||||
{
|
||||
aRow.push_back(new ORowSetValueDecorator(OUString(aURL.getBase())));
|
||||
bNewRow = true;
|
||||
|
@ -296,7 +296,7 @@ private:
|
||||
const bool bTextureActive(mrProcessor.getGeoTexSvx().get() || mrProcessor.getTransparenceGeoTexSvx().get());
|
||||
mbUseTex = bTextureActive && (mbHasTexCoor || mbHasInvTexCoor || mrProcessor.getSimpleTextureActive());
|
||||
const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx().get());
|
||||
const bool bNeedNrmOrCol(!bUseColorTex || (bUseColorTex && mrProcessor.getModulate()));
|
||||
const bool bNeedNrmOrCol(!bUseColorTex || mrProcessor.getModulate());
|
||||
mbUseNrm = bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getNormalIndex() && SCANLINE_EMPTY_INDEX != rB.getNormalIndex();
|
||||
mbUseCol = !mbUseNrm && bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getColorIndex() && SCANLINE_EMPTY_INDEX != rB.getColorIndex();
|
||||
|
||||
|
@ -398,7 +398,7 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
|
||||
delete pGraphicBrush;
|
||||
pGraphicBrush = 0;
|
||||
}
|
||||
else if ( !pGraphicBrush || (pGraphicBrush && !(*pBrushItem == *pGraphicBrush)) )
|
||||
else if ( !pGraphicBrush || !(*pBrushItem == *pGraphicBrush) )
|
||||
{
|
||||
delete pGraphicBrush;
|
||||
pGraphicBrush = static_cast<SvxBrushItem*>(pBrushItem->Clone());
|
||||
|
@ -320,7 +320,7 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const
|
||||
case XLS_TOKEN( oleObjects ):
|
||||
if ( getCurrentElement() == XLS_TOKEN( controls ) )
|
||||
{
|
||||
if( aMceState.empty() || ( !aMceState.empty() && aMceState.back() == MCE_STARTED ) )
|
||||
if( aMceState.empty() || aMceState.back() == MCE_STARTED )
|
||||
{
|
||||
if ( getCurrentElement() == XLS_TOKEN( oleObjects ) ) importOleObject( rAttribs );
|
||||
else
|
||||
|
@ -3107,7 +3107,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
|
||||
if (aCell.maBaseCell.meType == CELLTYPE_FORMULA)
|
||||
{
|
||||
ScFormulaCell* pFormulaCell = aCell.maBaseCell.mpFormula;
|
||||
if (!bIsMatrix || (bIsMatrix && bIsFirstMatrixCell))
|
||||
if (!bIsMatrix || bIsFirstMatrixCell)
|
||||
{
|
||||
if (!mpCompileFormulaCxt)
|
||||
{
|
||||
|
@ -556,7 +556,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
|
||||
{
|
||||
ScRange aDelRange;
|
||||
bool bIsDel = rViewData.GetDelMark( aDelRange );
|
||||
if ( (!bIsDel || (bIsDel && aMarkRange != aDelRange)) &&
|
||||
if ( (!bIsDel || aMarkRange != aDelRange) &&
|
||||
bNewMarked &&
|
||||
nNewMarkCount > 0 &&
|
||||
!IsSameMarkCell() )
|
||||
|
@ -545,7 +545,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor
|
||||
|
||||
const bool bEndRowEmpty = pDoc->IsBlockEmpty( nTab, nStartCol, nEndRow, nEndCol, nEndRow );
|
||||
const bool bEndColEmpty = pDoc->IsBlockEmpty( nTab, nEndCol, nStartRow, nEndCol, nEndRow );
|
||||
bool bRow = ( ( nStartRow != nEndRow ) && ( bEndRowEmpty || ( !bEndRowEmpty && !bEndColEmpty ) ) );
|
||||
bool bRow = ( ( nStartRow != nEndRow ) && ( bEndRowEmpty || !bEndColEmpty ) );
|
||||
bool bCol = ( ( nStartCol != nEndCol ) && ( bEndColEmpty || nStartRow == nEndRow ) );
|
||||
|
||||
// find an empty row for entering the result
|
||||
|
@ -175,7 +175,7 @@ void AnnotationTextWindow::KeyInput( const KeyEvent& rKeyEvt )
|
||||
if ( !( (nKey == KEY_Z || nKey == KEY_Y) && rKeyCode.IsMod1()) )
|
||||
{
|
||||
bool bIsProtected = mpAnnotationWindow->IsProtected();
|
||||
if (!bIsProtected || (bIsProtected && !EditEngine::DoesKeyChangeText(rKeyEvt)) )
|
||||
if (!bIsProtected || !EditEngine::DoesKeyChangeText(rKeyEvt) )
|
||||
|
||||
bDone = mpOutlinerView->PostKeyEvent( rKeyEvt );
|
||||
}
|
||||
|
@ -717,7 +717,7 @@ void SfxDispatcher::DoDeactivate_Impl(bool bMDI, SfxViewFrame* pNew)
|
||||
for (size_t n=0; n<xImp->aChildWins.size();)
|
||||
{
|
||||
SfxChildWindow *pWin = pWorkWin->GetChildWindow_Impl( (sal_uInt16) ( xImp->aChildWins[n] & 0xFFFF ) );
|
||||
if (!pWin || (pWin && pWin->GetAlignment() == SfxChildAlignment::NOALIGNMENT))
|
||||
if (!pWin || pWin->GetAlignment() == SfxChildAlignment::NOALIGNMENT)
|
||||
xImp->aChildWins.erase(xImp->aChildWins.begin()+n);
|
||||
else
|
||||
n++;
|
||||
|
@ -1016,7 +1016,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
|
||||
{
|
||||
EnableControl_Impl(m_pSearchBtn);
|
||||
EnableControl_Impl(m_pReplaceBtn);
|
||||
if (!bWriter || (bWriter && !m_pNotesBtn->IsChecked()))
|
||||
if (!bWriter || !m_pNotesBtn->IsChecked())
|
||||
{
|
||||
EnableControl_Impl(m_pSearchAllBtn);
|
||||
EnableControl_Impl(m_pReplaceAllBtn);
|
||||
@ -1416,7 +1416,7 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd )
|
||||
{
|
||||
EnableControl_Impl(m_pSearchBtn);
|
||||
EnableControl_Impl(m_pReplaceBtn);
|
||||
if (!bWriter || (bWriter && !m_pNotesBtn->IsChecked()))
|
||||
if (!bWriter || !m_pNotesBtn->IsChecked())
|
||||
{
|
||||
EnableControl_Impl(m_pSearchAllBtn);
|
||||
EnableControl_Impl(m_pReplaceAllBtn);
|
||||
|
@ -209,7 +209,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
|
||||
{
|
||||
case css::awt::GradientStyle_LINEAR :
|
||||
{
|
||||
if(!bMoveSingle || (bMoveSingle && !bMoveFirst))
|
||||
if(!bMoveSingle || !bMoveFirst)
|
||||
{
|
||||
basegfx::B2DVector aFullVec(aEndPos - aStartPos);
|
||||
|
||||
@ -245,7 +245,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
|
||||
}
|
||||
}
|
||||
|
||||
if(!bMoveSingle || (bMoveSingle && bMoveFirst))
|
||||
if(!bMoveSingle || bMoveFirst)
|
||||
{
|
||||
const basegfx::B2DVector aFullVec(aEndPos - aStartPos);
|
||||
const basegfx::B2DPoint aBottomLeft(aRange.getMinX(), aRange.getMaximum().getY());
|
||||
@ -278,7 +278,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
|
||||
}
|
||||
case css::awt::GradientStyle_AXIAL :
|
||||
{
|
||||
if(!bMoveSingle || (bMoveSingle && !bMoveFirst))
|
||||
if(!bMoveSingle || !bMoveFirst)
|
||||
{
|
||||
basegfx::B2DVector aFullVec(aEndPos - aCenter);
|
||||
const basegfx::B2DVector aOldVec(basegfx::B2DPoint(aCenter.getX(), aRange.getMaximum().getY()) - aCenter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user