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

Stephan Bergmann sbergman at redhat.com
Tue Jun 2 09:29:00 PDT 2015


 connectivity/source/drivers/kab/korder.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 2dd0c65cb20ed42b31e854b7da1afd6fc03b4325
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 2 18:28:15 2015 +0200

    Use range-based for
    
    Change-Id: Ie10317f3ffcaa8032417584cb056007c5f67ea91

diff --git a/connectivity/source/drivers/kab/korder.cxx b/connectivity/source/drivers/kab/korder.cxx
index 9418a56..6ff1f0c 100644
--- a/connectivity/source/drivers/kab/korder.cxx
+++ b/connectivity/source/drivers/kab/korder.cxx
@@ -56,8 +56,8 @@ KabComplexOrder::KabComplexOrder()
 
 KabComplexOrder::~KabComplexOrder()
 {
-    for (std::vector<KabOrder *>::size_type i = 0; i < m_aOrders.size(); i++)
-        delete m_aOrders[i];
+    for (auto p: m_aOrders)
+        delete p;
 }
 
 void KabComplexOrder::addOrder(KabOrder *pOrder)
@@ -67,10 +67,9 @@ void KabComplexOrder::addOrder(KabOrder *pOrder)
 
 sal_Int32 KabComplexOrder::compare(const ::KABC::Addressee &aAddressee1, const ::KABC::Addressee &aAddressee2) const
 {
-    for (std::vector<KabOrder *>::size_type i = 0; i < m_aOrders.size(); i++)
+    for (auto p: m_aOrders)
     {
-        const KabOrder *pOrder = m_aOrders[i];
-        sal_Int32 result = pOrder->compare(aAddressee1, aAddressee2);
+        sal_Int32 result = p->compare(aAddressee1, aAddressee2);
 
         if (result) return result;
     }


More information about the Libreoffice-commits mailing list