diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-11-28 02:05:43 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-11-28 02:07:15 +0100 |
commit | 47e7436d61539a77aa4e97de952262d858483cb7 (patch) | |
tree | 327a6342a55ff616f0d23b3d69b96864d005e964 /wizards/com/sun/star/wizards/letter | |
parent | 03a0ea88e94205bf14feffccf981e4aac82a28ae (diff) |
pywizards: remove helper class
Change-Id: I899cab320edb3712b17e339b0931a0deed4425e8
Diffstat (limited to 'wizards/com/sun/star/wizards/letter')
3 files changed, 25 insertions, 36 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.py b/wizards/com/sun/star/wizards/letter/LetterDocument.py index f8c1cedf693b..60fecc30bebc 100644 --- a/wizards/com/sun/star/wizards/letter/LetterDocument.py +++ b/wizards/com/sun/star/wizards/letter/LetterDocument.py @@ -15,7 +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 ..text.TextDocument import TextDocument, traceback, Helper, \ +from ..text.TextDocument import TextDocument, traceback, \ TextFieldHandler, Configuration from ..text.TextSectionHandler import TextSectionHandler from ..common.PropertyNames import PropertyNames @@ -51,7 +51,7 @@ class LetterDocument(TextDocument): self.xMSF, self.xTextDocument) oSection = \ mySectionHandler.xTextDocument.TextSections.getByName(sElement) - Helper.setUnoPropertyValue(oSection, "IsVisible", bState) + oSection.IsVisible = bState except Exception: traceback.print_exc() @@ -68,9 +68,8 @@ class LetterDocument(TextDocument): xPageStyleCollection = xNameAccess.getByName("PageStyles") xPageStyle = xPageStyleCollection.getByName(sPageStyle) if bState: - Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", True) - xFooterText = \ - Helper.getUnoPropertyValue(xPageStyle, "FooterText") + xPageStyle.FooterIsOn = True + xFooterText = xPageStyle.FooterText xFooterText.String = sText if bPageNumber: #Adding the Page Number @@ -89,8 +88,7 @@ class LetterDocument(TextDocument): xPageNumberField, False) else: - Helper.setUnoPropertyValue( - xPageStyle, "FooterIsOn", False) + xPageStyle.FooterIsOn = False self.xTextDocument.unlockControllers() except Exception: @@ -118,17 +116,16 @@ class LetterDocument(TextDocument): oUserDataAccess = Configuration.getConfigurationRoot( self.xMSF, "org.openoffice.UserProfile/Data", False) myFieldHandler.changeUserFieldContent( - "Company", Helper.getUnoObjectbyName(oUserDataAccess, "o")) + "Company", oUserDataAccess.getByName("o")) myFieldHandler.changeUserFieldContent( - "Street", Helper.getUnoObjectbyName(oUserDataAccess, "street")) + "Street", oUserDataAccess.getByName("street")) myFieldHandler.changeUserFieldContent( - "PostCode", - Helper.getUnoObjectbyName(oUserDataAccess, "postalcode")) + "PostCode", oUserDataAccess.getByName("postalcode")) myFieldHandler.changeUserFieldContent( - "City", Helper.getUnoObjectbyName(oUserDataAccess, "l")) + "City", oUserDataAccess.getByName("l")) myFieldHandler.changeUserFieldContent( PropertyNames.PROPERTY_STATE, - Helper.getUnoObjectbyName(oUserDataAccess, "st")) + oUserDataAccess.getByName("st")) except Exception: traceback.print_exc() diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py index 76c74a4109f0..e73142a5402b 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py @@ -18,7 +18,7 @@ from .LetterWizardDialogConst import LetterWizardDialogConst, HIDMAIN, HID from .LetterWizardDialogResources import LetterWizardDialogResources from ..common.HelpIds import HelpIds -from ..ui.WizardDialog import WizardDialog, uno, Helper, PropertyNames +from ..ui.WizardDialog import WizardDialog, uno, PropertyNames from com.sun.star.awt.FontUnderline import SINGLE @@ -28,9 +28,8 @@ class LetterWizardDialog(WizardDialog): super(LetterWizardDialog, self).__init__(xmsf, HIDMAIN ) self.resources = LetterWizardDialogResources(xmsf) - Helper.setUnoPropertyValues( - self.xDialogModel, - ("Closeable", + uno.invoke(self.xDialogModel, "setPropertyValues", + (("Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, @@ -42,7 +41,8 @@ class LetterWizardDialog(WizardDialog): PropertyNames.PROPERTY_WIDTH), (True, 210, True, "LetterWizardDialog", 104, 52, 1, 1, - self.resources.resLetterWizardDialog_title, 310)) + self.resources.resLetterWizardDialog_title, 310))) + self.fontDescriptor1 = \ uno.createUnoStruct('com.sun.star.awt.FontDescriptor') self.fontDescriptor2 = \ diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py index c109b6546155..2c451335c25c 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py @@ -17,8 +17,8 @@ # import traceback import os.path -from .LetterWizardDialog import LetterWizardDialog, Helper, \ - PropertyNames, uno, HelpIds, HID +from .LetterWizardDialog import LetterWizardDialog, PropertyNames, uno, \ + HelpIds, HID from .LetterDocument import LetterDocument, BusinessPaperObject from .CGLetterWizard import CGLetterWizard from ..common.NoValidPathException import NoValidPathException @@ -570,12 +570,9 @@ class LetterWizardDialogImpl(LetterWizardDialog): try: xReceiverFrame = self.myLetterDoc.getFrameByName( "Receiver Address", self.myLetterDoc.xTextDocument) - iFrameWidth = int(Helper.getUnoPropertyValue( - xReceiverFrame, PropertyNames.PROPERTY_WIDTH)) - iFrameX = int(Helper.getUnoPropertyValue( - xReceiverFrame, "HoriOrientPosition")) - iFrameY = int(Helper.getUnoPropertyValue( - xReceiverFrame, "VertOrientPosition")) + iFrameWidth = int(xReceiverFrame.Width) + iFrameX = int(xReceiverFrame.HoriOrientPosition) + iFrameY = int(xReceiverFrame.VertOrientPosition) iReceiverHeight = int(0.5 * 1000) self.BusCompanyAddressReceiver = BusinessPaperObject( self.myLetterDoc.xTextDocument, " ", iFrameWidth, iReceiverHeight, @@ -689,8 +686,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): BPaperItem = \ self.getRoadmapItemByID(LetterWizardDialogImpl.RM_FOOTER) - Helper.setUnoPropertyValue( - BPaperItem, PropertyNames.PROPERTY_ENABLED, bFooterPossible) + BPaperItem.Enabled = bFooterPossible except Exception: traceback.print_exc() @@ -823,21 +819,18 @@ class LetterWizardDialogImpl(LetterWizardDialog): def enableSenderReceiver(self): BPaperItem = self.getRoadmapItemByID( LetterWizardDialogImpl.RM_SENDERRECEIVER) - Helper.setUnoPropertyValue( - BPaperItem, PropertyNames.PROPERTY_ENABLED, True) + BPaperItem.Enabled = True def disableSenderReceiver(self): BPaperItem = self.getRoadmapItemByID( LetterWizardDialogImpl.RM_SENDERRECEIVER) - Helper.setUnoPropertyValue( - BPaperItem, PropertyNames.PROPERTY_ENABLED, False) + BPaperItem.Enabled = False def enableBusinessPaper(self): try: BPaperItem = self.getRoadmapItemByID( LetterWizardDialogImpl.RM_BUSINESSPAPER) - Helper.setUnoPropertyValue( - BPaperItem, PropertyNames.PROPERTY_ENABLED, True) + BPaperItem.Enabled = True self.chkPaperCompanyLogoItemChanged() self.chkPaperCompanyAddressItemChanged() self.chkPaperFooterItemChanged() @@ -849,8 +842,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): try: BPaperItem = self.getRoadmapItemByID( LetterWizardDialogImpl.RM_BUSINESSPAPER) - Helper.setUnoPropertyValue( - BPaperItem, PropertyNames.PROPERTY_ENABLED, False) + BPaperItem.Enabled = False if self.BusCompanyLogo != None: self.BusCompanyLogo.removeFrame() |