sw/source/core/doc/docbm.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 755330cbaf8b0c924cbe46ac62986576b523e3d0 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Aug 5 10:45:32 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Aug 5 20:35:04 2024 +0200 cid#1616049 Use of auto that causes a copy and cid#1616044 Use of auto that causes a copy Change-Id: Idb8e7abb72c5a3b2492f48bd617c0f297bb200da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171478 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index a2f7dc94b314..80be3e7e346d 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1366,8 +1366,8 @@ namespace sw::mark return nullptr; // we found our first candidate covering the position ... auto pMark = *itCurrent; - const auto aMarkStart = pMark->GetMarkStart(); - auto aMarkEnd = pMark->GetMarkEnd(); + const SwPosition aMarkStart = pMark->GetMarkStart(); + SwPosition aMarkEnd = pMark->GetMarkEnd(); // ... however we still need to check if there is a smaller/'more inner' one with the same start position for(++itCurrent; itCurrent != itEnd; ++itCurrent) { @@ -1376,12 +1376,12 @@ namespace sw::mark // start and thus can not be more 'inner' than our previous // match, so we are done. break; - auto aCurrentMarkEnd = (*itCurrent)->GetMarkEnd(); - if(rPos < aCurrentMarkEnd && aCurrentMarkEnd <= aMarkEnd) + const SwPosition& rCurrentMarkEnd = (*itCurrent)->GetMarkEnd(); + if(rPos < rCurrentMarkEnd && rCurrentMarkEnd <= aMarkEnd) { // both covering the position and more inner/smaller => use this one instead pMark = *itCurrent; - aMarkEnd = aCurrentMarkEnd; + aMarkEnd = rCurrentMarkEnd; } } return dynamic_cast<Fieldmark*>(pMark);