ure/source/uretest/cppmain.cc |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit acf7a851e87ec993ae828ccbf1bfb25448e88423
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Sun Nov 6 22:44:40 2022 +0100
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Mon Nov 7 08:20:46 2022 +0100

    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 <hoss...@libreoffice.org>

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

Reply via email to