summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-04-16 21:02:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-17 08:16:33 +0200
commit821371fb453f880240efa71ac3f556831be161d9 (patch)
tree18d952a838f2ff96168cf6059e897b1cb216779b /sc
parent0f166ef5240ee155bf2544e6bc3c985b1e3bf646 (diff)
cppcheck: identicalInnerCondition in sc
and remove a related known condition dpcache.cxx Change-Id: I6069849c33ea03eff61a55eb790ce6a8aad3d915 Reviewed-on: https://gerrit.libreoffice.org/53005 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/dpcache.cxx6
-rw-r--r--sc/source/core/data/markmulti.cxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx5
-rw-r--r--sc/source/ui/view/printfun.cxx6
4 files changed, 6 insertions, 13 deletions
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index e32563fd1503..4ee0035d5fcb 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -779,10 +779,10 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
if (bMatch && bMatchWholeCell
&& (nStart != 0 || nEnd != aCellStr.getLength()))
bMatch = false; // RegExp must match entire cell string
- if (bRealWildOrRegExp)
- bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch);
+
+ bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch);
}
- if (!bRealWildOrRegExp)
+ else
{
if (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL)
{
diff --git a/sc/source/core/data/markmulti.cxx b/sc/source/core/data/markmulti.cxx
index 7e81f70c36d4..52d8cb3cc07e 100644
--- a/sc/source/core/data/markmulti.cxx
+++ b/sc/source/core/data/markmulti.cxx
@@ -393,7 +393,6 @@ ScMultiSelIter::ScMultiSelIter( const ScMultiSel& rMultiSel, SCCOL nCol ) :
{
pRowSegs.reset( new ScFlatBoolRowSegments);
pRowSegs->setFalse( 0, MAXROW );
- if ( bHasMarks1 )
{
ScMarkArrayIter aMarkIter( &rMultiSel.aRowSel );
SCROW nTop, nBottom;
@@ -401,7 +400,6 @@ ScMultiSelIter::ScMultiSelIter( const ScMultiSel& rMultiSel, SCCOL nCol ) :
pRowSegs->setTrue( nTop, nBottom );
}
- if ( bHasMarks2 )
{
ScMarkArrayIter aMarkIter( &aIter->second );
SCROW nTop, nBottom;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 5ac088044ac6..b609e6e22e8e 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3446,10 +3446,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
}
if( bUsed && bFormulaMode && nCode == KEY_BACKSPACE )
{
- if (bFormulaMode)
- UseFormulaData();
- else
- UseColData();
+ UseFormulaData();
}
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index c1f11cdc8a56..082572aa52ad 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1374,8 +1374,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
{
ScDocumentUniquePtr pBorderDoc(new ScDocument( SCDOCMODE_UNDO ));
pBorderDoc->InitUndo( pDoc, 0,0, true,true );
- if (pBorderData)
- pBorderDoc->ApplyAttr( 0,0,0, *pBorderData );
+ pBorderDoc->ApplyAttr( 0,0,0, *pBorderData );
ScTableInfo aTabInfo;
pBorderDoc->FillInfo( aTabInfo, 0,0, 0,0, 0,
@@ -1390,8 +1389,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
aOutputData.SetUseStyleColor( bUseStyleColor );
- if (pBorderData)
- aOutputData.DrawFrame(*pDev);
+ aOutputData.DrawFrame(*pDev);
}
}