diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-03 22:59:04 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-09 16:58:06 +0200 |
commit | fca94779872b8ba0b0583d0b7068f1a46beb88c5 (patch) | |
tree | c3dd200a046d3c6e54cba570f7661b9c1068ed1b /sc/source/ui/unoobj/dispuno.cxx | |
parent | d05eb786d408af883500404229b89ffa0d7cde16 (diff) |
Simplify Sequence iterations in sc
Use range-based loops, STL and comphelper functions
Change-Id: I047fb2e6ec9591166339b9748c5013a32185f14b
Reviewed-on: https://gerrit.libreoffice.org/76912
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'sc/source/ui/unoobj/dispuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/dispuno.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index f8c55cd90de4..daaa70b2180a 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -119,13 +119,9 @@ uno::Sequence< uno::Reference<frame::XDispatch> > SAL_CALL SolarMutexGuard aGuard; uno::Sequence< uno::Reference< frame::XDispatch> > aReturn(aDescripts.getLength()); - uno::Reference< frame::XDispatch>* pReturn = aReturn.getArray(); - const frame::DispatchDescriptor* pDescripts = aDescripts.getConstArray(); - for (sal_Int32 i=0; i<aDescripts.getLength(); ++i, ++pReturn, ++pDescripts) - { - *pReturn = queryDispatch(pDescripts->FeatureURL, - pDescripts->FrameName, pDescripts->SearchFlags); - } + std::transform(aDescripts.begin(), aDescripts.end(), aReturn.begin(), + [this](const frame::DispatchDescriptor& rDescr) -> uno::Reference<frame::XDispatch> { + return queryDispatch(rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags); }); return aReturn; } |