summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-06-14 13:35:37 +0200
committerNoel Grandin <noel@peralex.com>2015-06-15 11:56:55 +0200
commit5a2e09989a4b9746a56f15fe7499067a4327fbae (patch)
tree846226a33613d2de8621717ced337328649d1155
parent7eac94da23f2f4460252eae5fa073fd1d833ba99 (diff)
cppcheck:redundantCondition
Change-Id: Ib8b6342d1da526df6104125ded546b3f053c448b
-rw-r--r--accessibility/source/standard/vclxaccessiblebox.cxx2
-rw-r--r--basctl/source/basicide/basidesh.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx2
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx2
-rw-r--r--editeng/source/items/numitem.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx6
-rw-r--r--sc/source/ui/view/viewfun2.cxx4
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx2
-rw-r--r--svl/source/items/stylepool.cxx3
9 files changed, 13 insertions, 12 deletions
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index 1e801a86e8fb..a20bcf0c4ce9 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -182,7 +182,7 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
sText = xText->getText();
pList->UpdateSelection_Acc(sText, m_bIsDropDownBox);
#if defined WNT
- if (m_bIsDropDownBox || ( !m_bIsDropDownBox && m_aBoxType==COMBOBOX))
+ if (m_bIsDropDownBox || m_aBoxType==COMBOBOX)
NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
#endif
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index b31d18c2607c..2501cdb55159 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -831,7 +831,7 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
if ( pWindow_->GetDocument().isInVBAMode() )
{
SbModule* pMod = StarBASIC::GetActiveModule();
- if ( !pMod || !pMod->GetName().equals(pWindow_->GetName()))
+ if ( !pMod || !pMod->GetName().equals(pWindow_->GetName()) )
{
bStop = false;
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 53a10788f67b..4ccf50582a40 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1628,7 +1628,7 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
SbxDataType eVarType = refVar->GetType();
SbxDataType eValType = refVal->GetType();
- if ( !( !bVBA || refVar->GetType() != SbxEMPTY ) || !refVar->CanWrite() )
+ if ( ( bVBA && ( eVarType == SbxEMPTY ) ) || !refVar->CanWrite() )
return false;
if ( eValType != SbxOBJECT )
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 36cf6e4f540f..f75db5a41e68 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -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 || (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;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index f99fff5f9203..c25121471652 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -398,7 +398,7 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
delete pGraphicBrush;
pGraphicBrush = 0;
}
- else if ( !pGraphicBrush || !(*pBrushItem == *pGraphicBrush) )
+ else if ( !pGraphicBrush || (*pBrushItem != *pGraphicBrush) )
{
delete pGraphicBrush;
pGraphicBrush = static_cast<SvxBrushItem*>(pBrushItem->Clone());
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index fc84b22bd337..3095affdc11a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2876,8 +2876,10 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
sal_Int32 nFndPos = -1;
do {
nFndPos = rTxt.indexOf( sTmp, nFndPos + 1);
- not_suffix = (bWasWordDelim && (nSttWdPos >= nFndPos + sTmp.getLength()));
- } while ( nFndPos != -1 && (!(left_wildcard || (!left_wildcard && (!nFndPos || IsWordDelim( rTxt[ nFndPos - 1 ])))) || not_suffix));
+ if (nFndPos == -1)
+ break;
+ not_suffix = bWasWordDelim && (nSttWdPos >= (nFndPos + sTmp.getLength()));
+ } while ( (!left_wildcard && nFndPos && !IsWordDelim( rTxt[ nFndPos - 1 ])) || not_suffix );
if ( nFndPos != -1 )
{
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 40e85e942c09..991995636e5d 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -545,8 +545,8 @@ 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 || !bEndColEmpty ) );
- bool bCol = ( ( nStartCol != nEndCol ) && ( bEndColEmpty || nStartRow == nEndRow ) );
+ bool bRow = ( nStartRow != nEndRow ) && ( bEndRowEmpty || !bEndColEmpty );
+ bool bCol = ( nStartCol != nEndCol ) && ( bEndColEmpty || nStartRow == nEndRow );
// find an empty row for entering the result
SCROW nInsRow = nEndRow;
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index bf7fb8a41efe..587f815e73e1 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -177,7 +177,7 @@ void AnnotationTextWindow::KeyInput( const KeyEvent& rKeyEvt )
bool bIsProtected = mpAnnotationWindow->IsProtected();
if (!bIsProtected || !EditEngine::DoesKeyChangeText(rKeyEvt) )
- bDone = mpOutlinerView->PostKeyEvent( rKeyEvt );
+ bDone = mpOutlinerView->PostKeyEvent( rKeyEvt );
}
if (bDone)
{
diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx
index 301572d03579..31fbaf3119ec 100644
--- a/svl/source/items/stylepool.cxx
+++ b/svl/source/items/stylepool.cxx
@@ -408,8 +408,7 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet&
if( !rSet.GetPool()->IsItemFlag(pItem->Which(), SfxItemPoolFlags::POOLABLE ) )
bNonPoolable = true;
if ( !xFoundIgnorableItems.get() ||
- ( xFoundIgnorableItems.get() &&
- xFoundIgnorableItems->Put( *pItem ) == 0 ) )
+ (xFoundIgnorableItems->Put( *pItem ) == 0 ) )
{
pCurNode = pCurNode->findChildNode( *pItem );
}