sc/source/ui/unoobj/cellsuno.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
New commits: commit 9efb19a6ad39bdd0d744adec3390ab274c90be2e Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Apr 12 14:33:55 2022 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Tue Apr 12 17:06:37 2022 +0200 bail out of the loop when the item is found Change-Id: If0816f38eeeb3330738ab40bc8a72f1e14575c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132904 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index b7b5b4dce748..70873df00568 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -8819,7 +8819,6 @@ rtl::Reference<ScCellRangeObj> ScCellFormatsObj::GetObjectByIndex_Impl(tools::Lo { //! access the AttrArrays directly !!!! - rtl::Reference<ScCellRangeObj> pRet; if (pDocShell) { ScDocument& rDoc = pDocShell->GetDocument(); @@ -8837,14 +8836,14 @@ rtl::Reference<ScCellRangeObj> ScCellFormatsObj::GetObjectByIndex_Impl(tools::Lo ScRange aNext( nCol1, nRow1, nTab, nCol2, nRow2, nTab ); if ( aNext.aStart == aNext.aEnd ) - pRet = new ScCellObj( pDocShell, aNext.aStart ); + return new ScCellObj( pDocShell, aNext.aStart ); else - pRet = new ScCellRangeObj( pDocShell, aNext ); + return new ScCellRangeObj( pDocShell, aNext ); } ++nPos; } } - return pRet; + return {}; } // XIndexAccess