[Libreoffice-commits] core.git: mysqlc/source

Julien Nabet serval2412 at yahoo.fr
Fri Mar 30 05:04:04 UTC 2018


 mysqlc/source/mysqlc_connection.cxx |    5 +++--
 mysqlc/source/mysqlc_driver.cxx     |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 932c9065ee09d94fa14248f49b2cb1b190a91a1d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu Mar 29 20:44:55 2018 +0200

    Use for-range loops in mysqlc
    
    Change-Id: I3ff3fa5dca6b6b9060b0b38d875e1b7dec1f8245
    Reviewed-on: https://gerrit.libreoffice.org/52127
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index e53a3b560cb0..c9b4c6d2e471 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -488,8 +488,9 @@ void OConnection::disposing()
     // we noticed that we should be destroyed in near future so we have to dispose our statements
     MutexGuard aGuard(m_aMutex);
 
-    for (OWeakRefArray::iterator i = m_aStatements.begin(); i != m_aStatements.end() ; ++i) {
-        Reference< XComponent > xComp(i->get(), UNO_QUERY);
+    for (auto const& statement : m_aStatements)
+    {
+        Reference< XComponent > xComp(statement.get(), UNO_QUERY);
         if (xComp.is()) {
             xComp->dispose();
         }
diff --git a/mysqlc/source/mysqlc_driver.cxx b/mysqlc/source/mysqlc_driver.cxx
index b54463affe6f..18e2db4cb9ae 100644
--- a/mysqlc/source/mysqlc_driver.cxx
+++ b/mysqlc/source/mysqlc_driver.cxx
@@ -57,9 +57,9 @@ void MysqlCDriver::disposing()
     ::osl::MutexGuard aGuard(m_aMutex);
 
     // when driver will be destroyed so all our connections have to be destroyed as well
-    for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
+    for (auto const& connection : m_xConnections)
     {
-        Reference< XComponent > xComp(i->get(), UNO_QUERY);
+        Reference< XComponent > xComp(connection.get(), UNO_QUERY);
         if (xComp.is()) {
             xComp->dispose();
         }


More information about the Libreoffice-commits mailing list