summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-05 22:42:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-06 08:25:21 +0200
commit16ce815df3c782fecb56f3112169189d956a200e (patch)
treebe27706348545dd5df63ded316964c75db60c2d7
parente718817f0efc01c440271cc709c8e4eb28ff5c0d (diff)
cppcheck: knownConditionTrueFalse
Change-Id: I231113eaf3117e13ed18de906e3787643abe9335 Reviewed-on: https://gerrit.libreoffice.org/38423 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx4
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx3
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx4
-rw-r--r--sw/source/core/docnode/node2lay.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx4
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx16
6 files changed, 13 insertions, 20 deletions
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index e40f17c8a3cb..14276926db69 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -892,7 +892,7 @@ namespace basegfx
&& (aCutFlags & (CutFlagValue::START2|CutFlagValue::END2)))
{
// same startpoint?
- if(!bFinished && (aCutFlags & (CutFlagValue::START1|CutFlagValue::START2)) == (CutFlagValue::START1|CutFlagValue::START2))
+ if((aCutFlags & (CutFlagValue::START1|CutFlagValue::START2)) == (CutFlagValue::START1|CutFlagValue::START2))
{
if(rEdge1Start.equal(rEdge2Start))
{
@@ -946,7 +946,7 @@ namespace basegfx
if(!bFinished && (aCutFlags & CutFlagValue::LINE))
{
- if(!bFinished && (aCutFlags & CutFlagValue::START1))
+ if((aCutFlags & CutFlagValue::START1))
{
// start1 on line 2 ?
if(isPointOnEdge(rEdge1Start, rEdge2Start, rEdge2Delta, &fCut2))
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index f385dfbc2114..bf10764fff4a 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -465,8 +465,7 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber (
{
// A display number value of 0 indicates the primary screen.
// Find out which screen number that is.
- if (nDisplayNumber <= 0)
- nScreenNumber = Application::GetDisplayExternalScreen();
+ nScreenNumber = Application::GetDisplayExternalScreen();
}
// We still have to determine the number of screens to decide
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 6bb769e1cdc4..15abeb022ff1 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1112,8 +1112,8 @@ namespace svgio
// create fill
basegfx::B2DPolyPolygon aPath(rPath);
const bool bNeedToCheckClipRule(SVGTokenPath == mrOwner.getType() || SVGTokenPolygon == mrOwner.getType());
- const bool bClipPathIsNonzero(!bIsLine && bNeedToCheckClipRule && mbIsClipPathContent && FillRule_nonzero == maClipRule);
- const bool bFillRuleIsNonzero(!bIsLine && bNeedToCheckClipRule && !mbIsClipPathContent && FillRule_nonzero == getFillRule());
+ const bool bClipPathIsNonzero(bNeedToCheckClipRule && mbIsClipPathContent && FillRule_nonzero == maClipRule);
+ const bool bFillRuleIsNonzero(bNeedToCheckClipRule && !mbIsClipPathContent && FillRule_nonzero == getFillRule());
if(bClipPathIsNonzero || bFillRuleIsNonzero)
{
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index a1a8f0664ff4..ee852d8f3cf0 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -143,7 +143,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, bool bSearc
{
SwNodeIndex aTmp( *rNode.EndOfSectionNode(), +1 );
pNd = GoPreviousWithFrame( &aTmp );
- if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() )
+ if( pNd && rNode.GetIndex() > pNd->GetIndex() )
pNd = nullptr; // Do not go over the limits
bMaster = false;
}
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 68120c772a25..7b5b3e80efcc 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -405,9 +405,7 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit&, rEdit, void )
//ShortNameEdit
if(!bNotFound)
{
- bool bEnable = !bNotFound;
- bEnable &= !bIsDocReadOnly;
- m_pInsertBtn->Enable(bEnable);
+ m_pInsertBtn->Enable(!bIsDocReadOnly);
}
}
}
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index ac9d0c427b25..06ce235374c1 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -1089,13 +1089,10 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
OutputDevice*pOutDev = Application::GetDefaultDevice();
if ( pOutDev )
{
- if ( !bOwnCtrl && !sTitle.isEmpty() )
- {
- // Adjust Y based on height of Title
- ::tools::Rectangle aRect;
- aRect = pOutDev->GetTextRect( aRect, sTitle );
- nY = nY + ( aRect.GetHeight() / 2 );
- }
+ // Adjust Y based on height of Title
+ ::tools::Rectangle aRect;
+ aRect = pOutDev->GetTextRect( aRect, sTitle );
+ nY = nY + ( aRect.GetHeight() / 2 );
}
else
{
@@ -1119,9 +1116,8 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
}
sal_Int16 nH = aFM.Ascent + aFM.Descent;
- if ( !bOwnCtrl && !sTitle.isEmpty() )
- // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
- nY = nY + ( nH / 8); // how do I test this
+ // offset y based on height of font ( not sure if my guess at the correct calculation is correct here )
+ nY = nY + ( nH / 8); // how do I test this
}
xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
}