diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-11-28 19:22:29 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-11-28 22:45:37 +0100 |
commit | d3f933beb5f28f3581f324cf5ebd05612b856072 (patch) | |
tree | c29b6966f2bf37237aa2c404b4876e6f621dd395 /wizards | |
parent | 07f5a7c8ab3c2d36703235b49b66441d804046e1 (diff) |
pyagenda: remove helper here too
Change-Id: I3a9e55107888d95faa0fbc6061a23168a7b06441
Diffstat (limited to 'wizards')
4 files changed, 26 insertions, 35 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py index e6643e0994d5..c16dd7c20ee4 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py @@ -21,7 +21,6 @@ from ..text.TextElement import TextElement from ..text.TextDocument import TextDocument from ..common.FileAccess import FileAccess from ..text.TextSectionHandler import TextSectionHandler -from ..common.Helper import Helper from datetime import date as dateTimeObject @@ -280,7 +279,7 @@ class AgendaTemplate(TextDocument): Get the default locale of the document, and create the date and time formatters. ''' - AgendaTemplate.dateUtils = Helper.DateUtils( + AgendaTemplate.dateUtils = self.DateUtils( self.xMSF, self.xTextDocument) AgendaTemplate.formatter = AgendaTemplate.dateUtils.formatter AgendaTemplate.dateFormat = \ @@ -434,8 +433,7 @@ class AgendaTemplate(TextDocument): try: for i in allSections: self.section = self.getSection(i) - visible = bool(Helper.getUnoPropertyValue( - self.section, "IsVisible")) + visible = bool(self.section.IsVisible) if not visible: self.section.Anchor.String = "" @@ -559,9 +557,9 @@ class AgendaTemplate(TextDocument): ''' def fillMinutesItem(self, Range, text, placeholder): - paraStyle = Helper.getUnoPropertyValue(Range, "ParaStyleName") + paraStyle = Range.ParaStyleName Range.setString(text) - Helper.setUnoPropertyValue(Range, "ParaStyleName", paraStyle) + Range.ParaStyleName = paraStyle if text == None or text == "": if placeholder != None and not placeholder == "": placeHolder = createPlaceHolder( @@ -586,10 +584,9 @@ class AgendaTemplate(TextDocument): traceback.print_exc() return None - Helper.setUnoPropertyValue(placeHolder, "PlaceHolder", ph) - Helper.setUnoPropertyValue(placeHolder, "Hint", hint) - Helper.setUnoPropertyValue( - placeHolder, "PlaceHolderType", uno.Any("short",TEXT)) + placeHolder.PlaceHolder = ph + placeHolder.Hint = hint + placeHolder.PlaceHolderType = uno.Any("short",TEXT) return placeHolder def getNamesWhichStartWith(self, allNames, prefix): @@ -649,7 +646,7 @@ class ItemsTable(object): i = 0 while i < len(self.agenda.allItems): workwith = self.agenda.allItems[i] - t = Helper.getUnoPropertyValue(workwith, "TextTable") + t = workwith.TextTable if t == ItemsTable.table: iText = workwith.String.lower().lstrip() ai = self.agenda.itemsCache[iText] @@ -709,7 +706,7 @@ class ItemsTable(object): boolean = True else: boolean = False - Helper.setUnoPropertyValue(self.section, "IsVisible", boolean) + self.section.IsVisible = boolean if not visible: return ''' @@ -824,9 +821,9 @@ class Topics(object): try: items = {} for i in self.agenda.allItems: - t = Helper.getUnoPropertyValue(i, "TextTable") + t = i.TextTable if t == Topics.table: - cell = Helper.getUnoPropertyValue(i, "Cell") + cell = i.Cell iText = cell.CellName items[iText] = i diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py index a84a28a92f1c..b7f428e8cedd 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py @@ -15,8 +15,7 @@ # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . # -from ..ui.WizardDialog import WizardDialog, uno, Helper, UIConsts, \ - PropertyNames +from ..ui.WizardDialog import WizardDialog, uno, UIConsts, PropertyNames from .AgendaWizardDialogConst import AgendaWizardDialogConst, HID from .AgendaWizardDialogResources import AgendaWizardDialogResources @@ -31,8 +30,8 @@ class AgendaWizardDialog(WizardDialog): self.resources = AgendaWizardDialogResources(xmsf) #set dialog properties... - Helper.setUnoPropertyValues( - self.xDialogModel, ("Closeable", + uno.invoke(self.xDialogModel, "setPropertyValues", + (("Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, @@ -40,7 +39,7 @@ class AgendaWizardDialog(WizardDialog): PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH), (True, 210, True, 200, 52, 1, 1, - self.resources.resAgendaWizardDialog_title,310)) + self.resources.resAgendaWizardDialog_title,310))) self.PROPS_LIST = ("Dropdown", PropertyNames.PROPERTY_HEIGHT, diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index 00262ee3957d..b934a6ab9570 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -17,7 +17,8 @@ # import uno from .CGTopic import CGTopic -from ..ui.ControlScroller import * +from ..ui.ControlScroller import ControlScroller, PropertyNames, traceback, \ + HelpIds, UnoDialog from .AgendaWizardDialogConst import HID from ..common.Properties import Properties from ..ui.event.CommonListener import FocusListenerProcAdapter, \ @@ -202,8 +203,7 @@ class TopicsControl(ControlScroller): def focusGained2(self, control): try: #calculate in which row we are... - name = Helper.getUnoPropertyValue( - control.Model, PropertyNames.PROPERTY_NAME) + name = control.Model.Name num = name[name.index("_") + 1:] TopicsControl.lastFocusRow = int(num) + ControlScroller.nscrollvalue TopicsControl.lastFocusControl = control @@ -687,8 +687,7 @@ class TopicsControl(ControlScroller): @classmethod def getColumn(self, control): - name = Helper.getUnoPropertyValue( - control.Model, PropertyNames.PROPERTY_NAME) + name = control.Model.Name if name.startswith(TopicsControl.TOPIC): return 1 if name.startswith(TopicsControl.RESP): diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index a17ee172b7fe..e411503409dc 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -20,7 +20,6 @@ from .UnoDialog import UnoDialog from ..common.Desktop import Desktop from ..common.PropertyNames import PropertyNames from ..common.HelpIds import HelpIds -from ..common.Helper import Helper from com.sun.star.awt.ScrollBarOrientation import HORIZONTAL, VERTICAL @@ -116,8 +115,7 @@ class ControlScroller(object): if _ntotfieldcount is not None: self.setTotalFieldCount(_ntotfieldcount) if _nscrollvalue >= 0: - Helper.setUnoPropertyValue( - ControlScroller.xScrollBar.Model, "ScrollValue", _nscrollvalue) + ControlScroller.xScrollBar.Model.ScrollValue = _nscrollvalue self.scrollControls() @classmethod @@ -132,13 +130,11 @@ class ControlScroller(object): self.ntotfieldcount = _ntotfieldcount self.setCurFieldCount() if self.ntotfieldcount > ControlScroller.nblockincrement: - Helper.setUnoPropertyValues( - ControlScroller.xScrollBar.Model, - (PropertyNames.PROPERTY_ENABLED, "ScrollValueMax"), - (True, self.ntotfieldcount - ControlScroller.nblockincrement)) + ControlScroller.xScrollBar.Model.Enabled = True + ControlScroller.xScrollBar.Model.ScrollValueMax = \ + self.ntotfieldcount - ControlScroller.nblockincrement else: - Helper.setUnoPropertyValue(ControlScroller.xScrollBar.Model, - PropertyNames.PROPERTY_ENABLED, False) + ControlScroller.xScrollBar.Model.Enabled = False def toggleComponent(self, _bdoenable): bdoenable = _bdoenable and \ @@ -162,8 +158,8 @@ class ControlScroller(object): @classmethod def scrollControls(self): try: - ControlScroller.nscrollvalue = int(Helper.getUnoPropertyValue( - ControlScroller.xScrollBar.Model, "ScrollValue")) + ControlScroller.nscrollvalue = \ + int(ControlScroller.xScrollBar.Model.ScrollValue) if ControlScroller.nscrollvalue + ControlScroller.nblockincrement \ >= self.ntotfieldcount: ControlScroller.nscrollvalue = \ |