diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-21 19:39:26 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-29 18:44:33 +0200 |
commit | 25b200ff79c71c831bc7e6fe8b1ec0b5315e96d6 (patch) | |
tree | b8e7cc15bfe82b677fb1bfc791b3f2f5a50fdc79 /sfx2/source/appl/macroloader.cxx | |
parent | c762e3859973355b31f6676a8e697c5fd78c9970 (diff) |
Simplify Sequence iterations in sfx2
Use range-based loops, STL and comphelper functions
Change-Id: I6a0d18493db7a25e8b41925f2d45cb221b5065a7
Reviewed-on: https://gerrit.libreoffice.org/76074
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'sfx2/source/appl/macroloader.cxx')
-rw-r--r-- | sfx2/source/appl/macroloader.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index 970ff56b5083..1aeff343e275 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star::util; SfxMacroLoader::SfxMacroLoader(const css::uno::Sequence< css::uno::Any >& aArguments) { Reference < XFrame > xFrame; - if ( aArguments.getLength() ) + if ( aArguments.hasElements() ) { aArguments[0] >>= xFrame; m_xFrame = xFrame; @@ -114,10 +114,9 @@ uno::Sequence< uno::Reference<frame::XDispatch> > SAL_CALL { sal_Int32 nCount = seqDescriptor.getLength(); uno::Sequence< uno::Reference<frame::XDispatch> > lDispatcher(nCount); - for( sal_Int32 i=0; i<nCount; ++i ) - lDispatcher[i] = queryDispatch( seqDescriptor[i].FeatureURL, - seqDescriptor[i].FrameName, - seqDescriptor[i].SearchFlags ); + std::transform(seqDescriptor.begin(), seqDescriptor.end(), lDispatcher.begin(), + [this](const frame::DispatchDescriptor& rDescr) -> uno::Reference<frame::XDispatch> { + return queryDispatch(rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags); }); return lDispatcher; } |