summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-11-09 15:26:00 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-11-09 20:21:51 +0100
commit9c3133fc335ff88adb1780f09d34f9907b1ccb8f (patch)
treef6b00aef8658cdc530534e702cec6c4cfe5a47a4 /basegfx/source
parent6e9f865789e6c4fabe35c0eb28302217c5c5b9d8 (diff)
cid#1634585 Use of auto that causes a copy
and cid#1634580 Use of auto that causes a copy cid#1634578 Use of auto that causes a copy Change-Id: Iad2ec6285b1eb923f3f30e8b18ee577d53ca140b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176312 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx19
-rw-r--r--basegfx/source/polygon/b3dpolygontools.cxx11
2 files changed, 11 insertions, 19 deletions
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 0483d13ee9c8..f1b9c169f345 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -1130,22 +1130,17 @@ namespace basegfx::utils
pGapTarget->clear();
}
- // provide callbacks as lambdas
- const auto rLineCallback(
- nullptr == pLineTarget
- ? std::function<void(const basegfx::B2DPolygon&)>()
- : [&pLineTarget](const basegfx::B2DPolygon& rSnippet){ pLineTarget->append(rSnippet); });
- const auto rGapCallback(
- nullptr == pGapTarget
- ? std::function<void(const basegfx::B2DPolygon&)>()
- : [&pGapTarget](const basegfx::B2DPolygon& rSnippet){ pGapTarget->append(rSnippet); });
-
// call version that uses callbacks
applyLineDashing(
rCandidate,
rDotDashArray,
- rLineCallback,
- rGapCallback,
+ // provide callbacks as lambdas
+ (!pLineTarget
+ ? std::function<void(const basegfx::B2DPolygon&)>()
+ : [&pLineTarget](const basegfx::B2DPolygon& rSnippet){ pLineTarget->append(rSnippet); }),
+ (!pGapTarget
+ ? std::function<void(const basegfx::B2DPolygon&)>()
+ : [&pGapTarget](const basegfx::B2DPolygon& rSnippet){ pGapTarget->append(rSnippet); }),
fDotDashLength);
}
diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx
index 2f4ed7f7d691..5f0b8c84ed9b 100644
--- a/basegfx/source/polygon/b3dpolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolygontools.cxx
@@ -103,17 +103,14 @@ namespace basegfx::utils
pLineTarget->clear();
}
- // provide callback as lambda
- const auto rLineCallback(
- nullptr == pLineTarget
- ? std::function<void(const basegfx::B3DPolygon&)>()
- : [&pLineTarget](const basegfx::B3DPolygon& rSnippet){ pLineTarget->append(rSnippet); });
-
// call version that uses callbacks
applyLineDashing(
rCandidate,
rDotDashArray,
- rLineCallback,
+ // provide callback as lambda
+ (!pLineTarget
+ ? std::function<void(const basegfx::B3DPolygon&)>()
+ : [&pLineTarget](const basegfx::B3DPolygon& rSnippet){ pLineTarget->append(rSnippet); }),
fDotDashLength);
}