ure/source/uretest/cppmain.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit 64469bb1a7383da6e7ff1150d693b3e08f54bc91 Author: jsala <javier.salamanca.mu...@gmail.com> AuthorDate: Sat Jun 25 13:34:32 2022 +0200 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Sun Nov 6 01:25:32 2022 +0100 tdf#145538 Use range based for loops Change-Id: Ic27ef946b8b878770446bd975b836d7c6c29dd4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141668 Tested-by: Jenkins Reviewed-by: Hossein <hoss...@libreoffice.org> diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc index fb957d9f221a..1acdad0a7811 100644 --- a/ure/source/uretest/cppmain.cc +++ b/ure/source/uretest/cppmain.cc @@ -17,7 +17,6 @@ */ #include "sal/config.h" -#include "sal/macros.h" #include <cstddef> #include <memory> @@ -120,8 +119,9 @@ private: "com.sun.star.script.InvocationAdapterFactory", "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript" }; - for (::std::size_t i = 0; i < SAL_N_ELEMENTS(services); ++i) { - ::rtl::OUString name(::rtl::OUString::createFromAscii(services[i])); + for (auto const & service : services) + { + ::rtl::OUString name(::rtl::OUString::createFromAscii(service)); css::uno::Reference< css::uno::XInterface > instance; try { instance = context_->getServiceManager()->createInstanceWithContext( @@ -165,10 +165,11 @@ private: static char const * const singletons[] = { "com.sun.star.reflection.theTypeDescriptionManager" }; - for (std::size_t i = 0; i != SAL_N_ELEMENTS(singletons); ++i) { + for (auto const & singleton : singletons) + { css::uno::Reference< css::uno::XInterface > instance( context_->getValueByName( - "/singletons/" + rtl::OUString::createFromAscii(singletons[i])), + "/singletons/" + rtl::OUString::createFromAscii(singleton)), css::uno::UNO_QUERY_THROW); } css::util::theMacroExpander::get(context_);