summaryrefslogtreecommitdiff
path: root/basegfx/source/polygon
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2021-01-23 20:43:43 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-31 11:32:37 +0100
commit167f4edc54bca5f62f098dcff2bff3cce4a51c58 (patch)
tree566dce76ee8e6425da6a9980d0685e8f03f55df7 /basegfx/source/polygon
parent7aaf6a3120f0a5ac4487468f6aa3d00bdcd3a573 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basegfx/source/polygon')
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx14
1 files changed, 4 insertions, 10 deletions
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);
}