diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-04-12 14:33:55 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-04-12 17:06:37 +0200 |
commit | 9efb19a6ad39bdd0d744adec3390ab274c90be2e (patch) | |
tree | 331da12c0268bffa15989a9de28d202964ebf639 /sc | |
parent | 48e277ad1d3fc0a8f7cb3e3cf356e15f6102a17f (diff) |
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.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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 |