Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3026

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/3026/1

Init: Pythonize the class ListModelBinder and avoid using the Helper class.

Change-Id: Ic080237bc075d979cbc6c70e43c6781a7ce36106
---
M wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
1 file changed, 13 insertions(+), 14 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py 
b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
index cd255ff..5cbe5ae 100644
--- a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
+++ b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
@@ -15,7 +15,6 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ...common.Helper import Helper
 
 class ListModelBinder(object):
 
@@ -33,45 +32,45 @@
         self.listModel.addListDataListener(this)
 
     def contentsChanged(self, lde):
-        selected = getSelectedItems()
+        selected = self.getSelectedItems()
         i = lde.getIndex0()
         while i <= lde.getIndex1():
-            update(i)
+            self.update(i)
             i += 1
-        setSelectedItems(selected)
+        self.setSelectedItems(selected)
 
     def update(self, i):
-        remove(i, i)
-        insert(i)
+        self.remove(i, i)
+        self.insert(i)
 
     def remove(self, i1, i2):
         self.unoList.removeItems(i1, i2 - i1 + 1)
 
     def insert(self, i):
-        self.unoList.addItem(getItemString(i), i)
+        self.unoList.addItem(self.getItemString(i), i)
 
     def getItemString(self, i):
-        return getItemString(self.listModel.getElementAt(i))
+        return self.getItemString(self.listModel.getElementAt(i))
 
     def getItemString(self, item):
         return self.renderer.render(item)
 
     def getSelectedItems(self):
-        return Helper.getUnoPropertyValue(self.unoListModel, "SelectedItems")
+        return self.unoListModel.SelectedItems
 
     def setSelectedItems(self, selected):
-        Helper.setUnoPropertyValue(self.unoListModel, "SelectedItems", selected)
+        self.unoListModel.SelectedItems = selected;
 
     def intervalAdded(self, lde):
         for i in xrange(lde.Index0, lde.Index1):
-            insert(i)
+            self.insert(i)
 
     def intervalRemoved(self, lde):
-        remove(lde.Index0, lde.Index1)
+        self.remove(lde.Index0, lde.Index1)
 
     @classmethod
     def fillList(self, xlist, items, renderer):
-        Helper.setUnoPropertyValue(xlist.Model, "StringItemList", ())
+        xlist.Model.StringItemList = ()
         for index,item in enumerate(items):
             if item is not None:
                 if renderer is not None:
@@ -82,7 +81,7 @@
 
     @classmethod
     def fillComboBox(self, xComboBox, items, renderer):
-        Helper.setUnoPropertyValue(xComboBox.Model, "StringItemList", ())
+        xComboBox.Model.StringItemList = ()
         for index,item in enumerate(items):
             if item is not None:
                 if renderer is not None:

-- 
To view, visit https://gerrit.libreoffice.org/3026
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic080237bc075d979cbc6c70e43c6781a7ce36106
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez <javier.fgb@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.