[Libreoffice-commits] core.git: sc/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Tue Apr 17 06:17:11 UTC 2018
sc/source/core/data/dpcache.cxx | 6 +++---
sc/source/core/data/markmulti.cxx | 2 --
sc/source/ui/app/inputhdl.cxx | 5 +----
sc/source/ui/view/printfun.cxx | 6 ++----
4 files changed, 6 insertions(+), 13 deletions(-)
New commits:
commit 821371fb453f880240efa71ac3f556831be161d9
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Mon Apr 16 21:02:14 2018 +0200
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 at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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);
}
}
More information about the Libreoffice-commits
mailing list