[Libreoffice-commits] .: Branch 'feature/gsoc2011_wizards' - wizards/com

Xisco Fauli xfauli at kemper.freedesktop.org
Sat Jul 16 15:37:45 PDT 2011


 wizards/com/sun/star/wizards/common/Helper.py                 |    6 ++---
 wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py |   12 +++++-----
 wizards/com/sun/star/wizards/ui/event/RadioDataAware.py       |    6 ++---
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 85edaf029255760a0183c29e3b1523eb3ea6a821
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun Jul 17 00:37:15 2011 +0200

    Replace xrange(len(x))

diff --git a/wizards/com/sun/star/wizards/common/Helper.py b/wizards/com/sun/star/wizards/common/Helper.py
index eaa615d..25f4375 100644
--- a/wizards/com/sun/star/wizards/common/Helper.py
+++ b/wizards/com/sun/star/wizards/common/Helper.py
@@ -111,9 +111,9 @@ class Helper(object):
                 uno.invoke(xMultiPSetLst, "setPropertyValues",
                     (PropertyNames, PropertyValues))
             else:
-                for i in xrange(len(PropertyNames)):
-                    self.setUnoPropertyValue(xMultiPSetLst, PropertyNames[i],
-                        PropertyValues[i])
+                for index, workwith in enumerate(PropertyNames):
+                    self.setUnoPropertyValue(
+                        xMultiPSetLst, PropertyNames[index], workwith)
 
         except Exception, e:
             traceback.print_exc()
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index e2bffcd..2c0a9dc 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -792,16 +792,16 @@ class LetterWizardDialogImpl(LetterWizardDialog):
         found = False
         OfficeLinguistic = Configuration.getOfficeLinguistic(self.xMSF)
         i = 0
-        for i in xrange(len(self.Norms)):
-            if self.Norms[i].lower() == OfficeLinguistic.lower():
-                oL = i
+        for index, workwith in enumerate(self.Norms):
+            if workwith.lower() == OfficeLinguistic.lower():
+                oL = index
                 found = True
                 break
 
         if not found:
-            for i in xrange(len(self.Norms)):
-                if self.Norms[i].lower() == "en-US".lower():
-                    oL = i
+            for index, workwith in enumerate(self.Norms):
+                if workwith.lower() == "en-US".lower():
+                    oL = index
                     found = True
                     break
         return oL
diff --git a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
index 41ce307..31d3740 100644
--- a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
+++ b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
@@ -24,9 +24,9 @@ class RadioDataAware(DataAware):
             self.radioButtons[selected].State = True
 
     def getFromUI(self):
-        for i in xrange(len(self.radioButtons)):
-            if self.radioButtons[i].State:
-                return i
+        for index, workwith in enumerate(self.radioButtons):
+            if workwith.State:
+                return index
 
         return -1
 


More information about the Libreoffice-commits mailing list