[Libreoffice-commits] core.git: basegfx/source
Dr. David Alan Gilbert (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jan 31 10:33:14 UTC 2021
basegfx/source/polygon/b3dpolygontools.cxx | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
New commits:
commit 167f4edc54bca5f62f098dcff2bff3cce4a51c58
Author: Dr. David Alan Gilbert <dave at treblig.org>
AuthorDate: Sat Jan 23 20:43:43 2021 +0000
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jan 31 11:32:37 2021 +0100
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 at collabora.co.uk>
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);
}
More information about the Libreoffice-commits
mailing list