basegfx/source/polygon/b2dpolygontools.cxx | 58 +++++++++++++--------------- basegfx/source/polygon/b3dpolygontools.cxx | 17 +++----- include/basegfx/polygon/b2dpolygontools.hxx | 4 - include/basegfx/polygon/b3dpolygontools.hxx | 2 vcl/source/window/builder.cxx | 4 - 5 files changed, 38 insertions(+), 47 deletions(-)
New commits: commit e7b1f30159a25848a4ffa3ad6df024556d372bb5 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 28 09:06:28 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Sep 28 13:25:05 2023 +0200 cid#1545247 COPY_INSTEAD_OF_MOVE Change-Id: I921d2971c76b9a1d4b1fde7531ad0e96f5f3428e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157357 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e052f9d25a04..6974cdce9ccd 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -468,11 +468,9 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr m_sHelpRoot = m_sHelpRoot.copy(0, nIdx); m_sHelpRoot += "/"; - OUString sUri = sUIDir + sUIFile; - try { - xmlreader::XmlReader reader(sUri); + xmlreader::XmlReader reader(sUIDir + sUIFile); handleChild(pParent, nullptr, reader); } commit 984dfa1f478db52c2adf8e77a15687b6fecc176b Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 28 09:04:26 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Sep 28 13:24:58 2023 +0200 cid#1545233 sidestep COPY_INSTEAD_OF_MOVE Change-Id: I93b8225b7ae2fdb4ea5fc371ce278f00d3dec33f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157356 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 56b286403671..b3f43669ddf4 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1232,8 +1232,8 @@ namespace basegfx::utils void applyLineDashing( const B2DPolygon& rCandidate, const std::vector<double>& rDotDashArray, - std::function<void(const basegfx::B2DPolygon& rSnippet)> aLineTargetCallback, - std::function<void(const basegfx::B2DPolygon& rSnippet)> aGapTargetCallback, + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rLineTargetCallback, + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rGapTargetCallback, double fDotDashLength) { const sal_uInt32 nPointCount(rCandidate.count()); @@ -1244,18 +1244,14 @@ namespace basegfx::utils fDotDashLength = std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); } - if(fTools::lessOrEqual(fDotDashLength, 0.0) || (!aLineTargetCallback && !aGapTargetCallback) || !nPointCount) + if(fTools::lessOrEqual(fDotDashLength, 0.0) || (!rLineTargetCallback && !rGapTargetCallback) || !nPointCount) { // parameters make no sense, just add source to targets - if(aLineTargetCallback) - { - aLineTargetCallback(rCandidate); - } + if (rLineTargetCallback) + rLineTargetCallback(rCandidate); - if(aGapTargetCallback) - { - aGapTargetCallback(rCandidate); - } + if (rGapTargetCallback) + rGapTargetCallback(rCandidate); return; } @@ -1326,8 +1322,8 @@ namespace basegfx::utils while(fTools::less(fDotDashMovingLength, fEdgeLength)) { // new split is inside edge, create and append snippet [fLastDotDashMovingLength, fDotDashMovingLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - const bool bHandleGap(!bIsLine && aGapTargetCallback); + const bool bHandleLine(bIsLine && rLineTargetCallback); + const bool bHandleGap(!bIsLine && rGapTargetCallback); if(bHandleLine || bHandleGap) { @@ -1344,12 +1340,12 @@ namespace basegfx::utils if(bHandleLine) { - implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); + implHandleSnippet(aSnippet, rLineTargetCallback, aFirstLine, aLastLine); } if(bHandleGap) { - implHandleSnippet(aSnippet, aGapTargetCallback, aFirstGap, aLastGap); + implHandleSnippet(aSnippet, rGapTargetCallback, aFirstGap, aLastGap); } aSnippet.clear(); @@ -1362,8 +1358,8 @@ namespace basegfx::utils } // append closing snippet [fLastDotDashMovingLength, fEdgeLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - const bool bHandleGap(!bIsLine && aGapTargetCallback); + const bool bHandleLine(bIsLine && rLineTargetCallback); + const bool bHandleGap(!bIsLine && rGapTargetCallback); if(bHandleLine || bHandleGap) { @@ -1394,8 +1390,8 @@ namespace basegfx::utils while(fTools::less(fDotDashMovingLength, fEdgeLength)) { // new split is inside edge, create and append snippet [fLastDotDashMovingLength, fDotDashMovingLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - const bool bHandleGap(!bIsLine && aGapTargetCallback); + const bool bHandleLine(bIsLine && rLineTargetCallback); + const bool bHandleGap(!bIsLine && rGapTargetCallback); if(bHandleLine || bHandleGap) { @@ -1408,12 +1404,12 @@ namespace basegfx::utils if(bHandleLine) { - implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); + implHandleSnippet(aSnippet, rLineTargetCallback, aFirstLine, aLastLine); } if(bHandleGap) { - implHandleSnippet(aSnippet, aGapTargetCallback, aFirstGap, aLastGap); + implHandleSnippet(aSnippet, rGapTargetCallback, aFirstGap, aLastGap); } aSnippet.clear(); @@ -1426,8 +1422,8 @@ namespace basegfx::utils } // append snippet [fLastDotDashMovingLength, fEdgeLength] - const bool bHandleLine(bIsLine && aLineTargetCallback); - const bool bHandleGap(!bIsLine && aGapTargetCallback); + const bool bHandleLine(bIsLine && rLineTargetCallback); + const bool bHandleGap(!bIsLine && rGapTargetCallback); if(bHandleLine || bHandleGap) { @@ -1451,28 +1447,28 @@ namespace basegfx::utils // append last intermediate results (if exists) if(aSnippet.count()) { - const bool bHandleLine(bIsLine && aLineTargetCallback); - const bool bHandleGap(!bIsLine && aGapTargetCallback); + const bool bHandleLine(bIsLine && rLineTargetCallback); + const bool bHandleGap(!bIsLine && rGapTargetCallback); if(bHandleLine) { - implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); + implHandleSnippet(aSnippet, rLineTargetCallback, aFirstLine, aLastLine); } if(bHandleGap) { - implHandleSnippet(aSnippet, aGapTargetCallback, aFirstGap, aLastGap); + implHandleSnippet(aSnippet, rGapTargetCallback, aFirstGap, aLastGap); } } - if(bIsClosed && aLineTargetCallback) + if(bIsClosed && rLineTargetCallback) { - implHandleFirstLast(aLineTargetCallback, aFirstLine, aLastLine); + implHandleFirstLast(rLineTargetCallback, aFirstLine, aLastLine); } - if(bIsClosed && aGapTargetCallback) + if(bIsClosed && rGapTargetCallback) { - implHandleFirstLast(aGapTargetCallback, aFirstGap, aLastGap); + implHandleFirstLast(rGapTargetCallback, aFirstGap, aLastGap); } } diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 3b3779d7460a..7c92f5ddcea5 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -173,7 +173,7 @@ namespace basegfx::utils void applyLineDashing( const B3DPolygon& rCandidate, const std::vector<double>& rDotDashArray, - std::function<void(const basegfx::B3DPolygon& rSnippet)> aLineTargetCallback, + const std::function<void(const basegfx::B3DPolygon& rSnippet)>& rLineTargetCallback, double fDotDashLength) { const sal_uInt32 nPointCount(rCandidate.count()); @@ -184,14 +184,11 @@ namespace basegfx::utils fDotDashLength = std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); } - if(fTools::lessOrEqual(fDotDashLength, 0.0) || !aLineTargetCallback || !nPointCount) + if(fTools::lessOrEqual(fDotDashLength, 0.0) || !rLineTargetCallback || !nPointCount) { // parameters make no sense, just add source to targets - if(aLineTargetCallback) - { - aLineTargetCallback(rCandidate); - } - + if (rLineTargetCallback) + rLineTargetCallback(rCandidate); return; } @@ -259,7 +256,7 @@ namespace basegfx::utils aSnippet.append(interpolate(aCurrentPoint, aNextPoint, fDotDashMovingLength / fEdgeLength)); - implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); + implHandleSnippet(aSnippet, rLineTargetCallback, aFirstLine, aLastLine); aSnippet.clear(); } @@ -294,13 +291,13 @@ namespace basegfx::utils { if(bIsLine) { - implHandleSnippet(aSnippet, aLineTargetCallback, aFirstLine, aLastLine); + implHandleSnippet(aSnippet, rLineTargetCallback, aFirstLine, aLastLine); } } if(bIsClosed) { - implHandleFirstLast(aLineTargetCallback, aFirstLine, aLastLine); + implHandleFirstLast(rLineTargetCallback, aFirstLine, aLastLine); } } diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx index eff5f06a9cff..d21d0bb63bfe 100644 --- a/include/basegfx/polygon/b2dpolygontools.hxx +++ b/include/basegfx/polygon/b2dpolygontools.hxx @@ -207,8 +207,8 @@ namespace basegfx::utils BASEGFX_DLLPUBLIC void applyLineDashing( const B2DPolygon& rCandidate, const std::vector<double>& rDotDashArray, - std::function<void(const basegfx::B2DPolygon& rSnippet)> aLineTargetCallback, - std::function<void(const basegfx::B2DPolygon& rSnippet)> aGapTargetCallback = std::function<void(const basegfx::B2DPolygon&)>(), + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rLineTargetCallback, + const std::function<void(const basegfx::B2DPolygon& rSnippet)>& rGapTargetCallback = std::function<void(const basegfx::B2DPolygon&)>(), double fDotDashLength = 0.0); BASEGFX_DLLPUBLIC void applyLineDashing( const B2DPolygon& rCandidate, diff --git a/include/basegfx/polygon/b3dpolygontools.hxx b/include/basegfx/polygon/b3dpolygontools.hxx index 2bdddbc3371c..2f890809cf8d 100644 --- a/include/basegfx/polygon/b3dpolygontools.hxx +++ b/include/basegfx/polygon/b3dpolygontools.hxx @@ -64,7 +64,7 @@ namespace basegfx::utils void applyLineDashing( const B3DPolygon& rCandidate, const std::vector<double>& rDotDashArray, - std::function<void(const basegfx::B3DPolygon& rSnippet)> aLineTargetCallback, + const std::function<void(const basegfx::B3DPolygon& rSnippet)>& rLineTargetCallback, double fDotDashLength = 0.0); BASEGFX_DLLPUBLIC void applyLineDashing( const B3DPolygon& rCandidate,