diff options
author | Hossein <hossein@libreoffice.org> | 2022-11-06 22:44:40 +0100 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2022-11-07 08:20:46 +0100 |
commit | acf7a851e87ec993ae828ccbf1bfb25448e88423 (patch) | |
tree | af00af6188cf4a4725eed35416cbd73072b29489 /ure | |
parent | 08bb758b150d6d52258b2a4f783e37298bb42373 (diff) |
Revert "tdf#145538 Use range based for loops"
This reverts commit 64469bb1a7383da6e7ff1150d693b3e08f54bc91.
To keep the compatibility with C++98, we need to revert the previous patch.
Quoting sberg:
"This code happens to not normally be processed (see ure/source/uretest/README)
and is meant to be compilable with the 3rd-party UNO compiler baselines (i.e.,
just C++98, which implies no range base for loops)."
Change-Id: I1355a29af24299a99a23dfcd1dd473894d7c9e0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142302
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'ure')
-rw-r--r-- | ure/source/uretest/cppmain.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc index 1acdad0a7811..fb957d9f221a 100644 --- a/ure/source/uretest/cppmain.cc +++ b/ure/source/uretest/cppmain.cc @@ -17,6 +17,7 @@ */ #include "sal/config.h" +#include "sal/macros.h" #include <cstddef> #include <memory> @@ -119,9 +120,8 @@ private: "com.sun.star.script.InvocationAdapterFactory", "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript" }; - for (auto const & service : services) - { - ::rtl::OUString name(::rtl::OUString::createFromAscii(service)); + for (::std::size_t i = 0; i < SAL_N_ELEMENTS(services); ++i) { + ::rtl::OUString name(::rtl::OUString::createFromAscii(services[i])); css::uno::Reference< css::uno::XInterface > instance; try { instance = context_->getServiceManager()->createInstanceWithContext( @@ -165,11 +165,10 @@ private: static char const * const singletons[] = { "com.sun.star.reflection.theTypeDescriptionManager" }; - for (auto const & singleton : singletons) - { + for (std::size_t i = 0; i != SAL_N_ELEMENTS(singletons); ++i) { css::uno::Reference< css::uno::XInterface > instance( context_->getValueByName( - "/singletons/" + rtl::OUString::createFromAscii(singleton)), + "/singletons/" + rtl::OUString::createFromAscii(singletons[i])), css::uno::UNO_QUERY_THROW); } css::util::theMacroExpander::get(context_); |