Revert "tdf#145538 Use range based for loops"

This reverts commit 64469bb1a7.

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>
This commit is contained in:
Hossein
2022-11-06 22:44:40 +01:00
parent 08bb758b15
commit acf7a851e8

View File

@ -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_);