basegfx/source/polygon/b2dpolygontools.cxx | 19 +++++++------------ basegfx/source/polygon/b3dpolygontools.cxx | 11 ++++------- desktop/source/lib/init.cxx | 2 +- sfx2/source/doc/guisaveas.cxx | 2 +- sfx2/source/doc/objserv.cxx | 4 ++-- 5 files changed, 15 insertions(+), 23 deletions(-)
New commits: commit 9c3133fc335ff88adb1780f09d34f9907b1ccb8f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Nov 9 15:26:00 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Nov 9 20:21:51 2024 +0100 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.mcnam...@collabora.com> 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); } commit 6e9f865789e6c4fabe35c0eb28302217c5c5b9d8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Nov 9 15:21:23 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Nov 9 20:21:43 2024 +0100 cid#1634574 COPY_INSTEAD_OF_MOVE and cid#1634579 COPY_INSTEAD_OF_MOVE cid#1634583 COPY_INSTEAD_OF_MOVE cid#1634586 COPY_INSTEAD_OF_MOVE Change-Id: I24f4f0edf90546fe89ebecf0652f27298b5dd2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176311 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3f20dc65ec04..a0f73fd49f8a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7280,7 +7280,7 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis, SolarMutexGuard aGuard; svl::crypto::SigningContext aSigningContext; - aSigningContext.m_xCertificate = xCertificate; + aSigningContext.m_xCertificate = std::move(xCertificate); return pObjectShell->SignDocumentContentUsingCertificate(aSigningContext); } diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index a9b51afca983..0b093707b6d8 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1924,7 +1924,7 @@ bool SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::cons bFoundCert = true; SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell(); svl::crypto::SigningContext aSigningContext; - aSigningContext.m_xCertificate = xCert; + aSigningContext.m_xCertificate = std::move(xCert); bool bSigned = pDocShell->SignDocumentContentUsingCertificate(aSigningContext); if (bSigned && pDocShell->HasValidSignatures()) { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 369ae57be6d8..1af4ddbcb902 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -581,7 +581,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) { svl::crypto::SigningContext aSigningContext; - aSigningContext.m_xCertificate = xCertificate; + aSigningContext.m_xCertificate = std::move(xCertificate); bHaveWeSigned |= SignDocumentContentUsingCertificate(aSigningContext); // Reload to show how the PDF actually looks like after signing. This also @@ -2198,7 +2198,7 @@ bool SfxObjectShell::ResignDocument(uno::Sequence< security::DocumentSignatureIn if (xCert.is()) { svl::crypto::SigningContext aSigningContext; - aSigningContext.m_xCertificate = xCert; + aSigningContext.m_xCertificate = std::move(xCert); bSignSuccess &= SignDocumentContentUsingCertificate(aSigningContext); } }