editeng/source/accessibility/AccessibleEditableTextPara.cxx | 2 +- include/comphelper/sequence.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 8d279e8c4fbef0599d4d84c98695871fb5b42275 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Jul 14 15:08:56 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Jul 15 11:11:08 2024 +0200 cid#1607843 Use of auto that causes a copy and cid#1555160 Use of auto that causes a copy Change-Id: I2e2056ddbfb2d11d288a5b2df273e8bc049387fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170455 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 1c784db88ef3..19620ea093a0 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1236,7 +1236,7 @@ namespace accessibility // create sorted sequences according to index array uno::Sequence<beans::PropertyValue> aNewValues( nLength ); std::transform(indices.begin(), indices.end(), aNewValues.getArray(), - [&aRes](sal_Int32 index) { return aRes[index]; }); + [&aRes](sal_Int32 index) -> const beans::PropertyValue& { return aRes[index]; }); return aNewValues; } diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx index 30c7d00e4b42..4a9d132c271e 100644 --- a/include/comphelper/sequence.hxx +++ b/include/comphelper/sequence.hxx @@ -300,7 +300,7 @@ namespace comphelper { css::uno::Sequence< typename M::key_type > ret( static_cast<sal_Int32>(map.size()) ); std::transform(map.begin(), map.end(), ret.getArray(), - [](const auto& i) { return i.first; }); + [](const auto& i) -> const typename M::key_type& { return i.first; }); return ret; } @@ -309,7 +309,7 @@ namespace comphelper { css::uno::Sequence< typename M::mapped_type > ret( static_cast<sal_Int32>(map.size()) ); std::transform(map.begin(), map.end(), ret.getArray(), - [](const auto& i) { return i.second; }); + [](const auto& i) -> const typename M::mapped_type& { return i.second; }); return ret; }
