From 167f4edc54bca5f62f098dcff2bff3cce4a51c58 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Sat, 23 Jan 2021 20:43:43 +0000 Subject: basegfx::utils::applyLineDashing simplify !aLineTargetCallBack checks cppcheck points out that there's an early check and return for !aLineTargetCallback: if(fTools::lessOrEqual(fDotDashLength, 0.0) || !aLineTargetCallback || !nPointCount) { .... return; } so we don't need to test it later. Change-Id: I93fead38ced03ad52c6a81701902cf9deda3bb58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109847 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basegfx/source/polygon/b3dpolygontools.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'basegfx/source/polygon') diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 19f885b2e826..1282ddbd216e 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -251,9 +251,7 @@ namespace basegfx::utils while(fTools::less(fDotDashMovingLength, fEdgeLength)) { // new split is inside edge, create and append snippet [fLastDotDashMovingLength, fDotDashMovingLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - - if(bHandleLine) + if(bIsLine) { if(!aSnippet.count()) { @@ -274,9 +272,7 @@ namespace basegfx::utils } // append snippet [fLastDotDashMovingLength, fEdgeLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - - if(bHandleLine) + if(bIsLine) { if(!aSnippet.count()) { @@ -297,15 +293,13 @@ namespace basegfx::utils // append last intermediate results (if exists) if(aSnippet.count()) { - const bool bHandleLine(bIsLine && aLineTargetCallback); - - if(bHandleLine) + if(bIsLine) { implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); } } - if(bIsClosed && aLineTargetCallback) + if(bIsClosed) { implHandleFirstLast(aLineTargetCallback, aFirstLine, aLastLine); } -- cgit