summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/fax/FaxDocument.py
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-06-15 19:09:17 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-18 02:13:21 +0200
commit0df4a8eff1f0a9f8a8619cdd29df3c3036279587 (patch)
tree99f492d2fd57826945ea0da2e2943fc1a72cb433 /wizards/com/sun/star/wizards/fax/FaxDocument.py
parent68b50acc4d8672ce74b413076da13a36613efca6 (diff)
Line length <= 80
Diffstat (limited to 'wizards/com/sun/star/wizards/fax/FaxDocument.py')
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxDocument.py62
1 files changed, 42 insertions, 20 deletions
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.py b/wizards/com/sun/star/wizards/fax/FaxDocument.py
index 691c5effd506..8c0f0c4588ef 100644
--- a/wizards/com/sun/star/wizards/fax/FaxDocument.py
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.py
@@ -14,14 +14,17 @@ from com.sun.star.style.NumberingType import ARABIC
class FaxDocument(TextDocument):
def __init__(self, xMSF, listener):
- super(FaxDocument,self).__init__(xMSF, listener, None, "WIZARD_LIVE_PREVIEW")
+ super(FaxDocument,self).__init__(xMSF, listener, None,
+ "WIZARD_LIVE_PREVIEW")
self.keepLogoFrame = True
self.keepTypeFrame = True
def switchElement(self, sElement, bState):
try:
- mySectionHandler = TextSectionHandler(self.xMSF, self.xTextDocument)
- oSection = mySectionHandler.xTextDocument.getTextSections().getByName(sElement)
+ mySectionHandler = TextSectionHandler(self.xMSF,
+ self.xTextDocument)
+ oSection = \
+ mySectionHandler.xTextDocument.TextSections.getByName(sElement)
Helper.setUnoPropertyValue(oSection, "IsVisible", bState)
except UnoException, exception:
traceback.print_exc()
@@ -35,7 +38,8 @@ class FaxDocument(TextDocument):
self.xTextDocument.lockControllers()
try:
- xPageStyleCollection = self.xTextDocument.getStyleFamilies().getByName("PageStyles")
+ xPageStyleCollection = \
+ self.xTextDocument.StyleFamilies.getByName("PageStyles")
xPageStyle = xPageStyleCollection.getByName(sPageStyle)
if bState:
@@ -47,16 +51,21 @@ class FaxDocument(TextDocument):
#Adding the Page Number
myCursor = xFooterText.Text.createTextCursor()
myCursor.gotoEnd(False)
- xFooterText.insertControlCharacter(myCursor, PARAGRAPH_BREAK, False)
+ xFooterText.insertControlCharacter(myCursor,
+ PARAGRAPH_BREAK, False)
myCursor.setPropertyValue("ParaAdjust", CENTER )
- xPageNumberField = xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber")
- xPageNumberField.setPropertyValue("NumberingType", uno.Any("short",ARABIC))
+ xPageNumberField = xMSFDoc.createInstance(
+ "com.sun.star.text.TextField.PageNumber")
+ xPageNumberField.setPropertyValue(
+ "NumberingType", uno.Any("short",ARABIC))
xPageNumberField.setPropertyValue("SubType", CURRENT)
- xFooterText.insertTextContent(xFooterText.getEnd(), xPageNumberField, False)
+ xFooterText.insertTextContent(xFooterText.getEnd(),
+ xPageNumberField, False)
else:
- Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", False)
+ Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn",
+ False)
self.xTextDocument.unlockControllers()
except UnoException, exception:
@@ -64,7 +73,8 @@ class FaxDocument(TextDocument):
def hasElement(self, sElement):
if self.xTextDocument != None:
- mySectionHandler = TextSectionHandler(self.xMSF, self.xTextDocument)
+ mySectionHandler = TextSectionHandler(self.xMSF,
+ self.xTextDocument)
return mySectionHandler.hasTextSectionByName(sElement)
else:
return False
@@ -78,14 +88,24 @@ class FaxDocument(TextDocument):
def fillSenderWithUserData(self):
try:
- myFieldHandler = TextFieldHandler(self.xTextDocument, self.xTextDocument)
- oUserDataAccess = Configuration.getConfigurationRoot(self.xMSF, "org.openoffice.UserProfile/Data", False)
- myFieldHandler.changeUserFieldContent("Company", Helper.getUnoObjectbyName(oUserDataAccess, "o"))
- myFieldHandler.changeUserFieldContent("Street", Helper.getUnoObjectbyName(oUserDataAccess, "street"))
- myFieldHandler.changeUserFieldContent("PostCode", Helper.getUnoObjectbyName(oUserDataAccess, "postalcode"))
- myFieldHandler.changeUserFieldContent(PropertyNames.PROPERTY_STATE, Helper.getUnoObjectbyName(oUserDataAccess, "st"))
- myFieldHandler.changeUserFieldContent("City", Helper.getUnoObjectbyName(oUserDataAccess, "l"))
- myFieldHandler.changeUserFieldContent("Fax", Helper.getUnoObjectbyName(oUserDataAccess, "facsimiletelephonenumber"))
+ myFieldHandler = TextFieldHandler(self.xTextDocument,
+ self.xTextDocument)
+ oUserDataAccess = Configuration.getConfigurationRoot(
+ self.xMSF, "org.openoffice.UserProfile/Data", False)
+ myFieldHandler.changeUserFieldContent("Company",
+ Helper.getUnoObjectbyName(oUserDataAccess, "o"))
+ myFieldHandler.changeUserFieldContent("Street",
+ Helper.getUnoObjectbyName(oUserDataAccess, "street"))
+ myFieldHandler.changeUserFieldContent("PostCode",
+ Helper.getUnoObjectbyName(oUserDataAccess, "postalcode"))
+ myFieldHandler.changeUserFieldContent(
+ PropertyNames.PROPERTY_STATE,
+ Helper.getUnoObjectbyName(oUserDataAccess, "st"))
+ myFieldHandler.changeUserFieldContent("City",
+ Helper.getUnoObjectbyName(oUserDataAccess, "l"))
+ myFieldHandler.changeUserFieldContent("Fax",
+ Helper.getUnoObjectbyName(oUserDataAccess,
+ "facsimiletelephonenumber"))
except UnoException, exception:
traceback.print_exc()
@@ -96,12 +116,14 @@ class FaxDocument(TextDocument):
def killEmptyFrames(self):
try:
if not self.keepLogoFrame:
- xTF = TextFrameHandler.getFrameByName("Company Logo", self.xTextDocument)
+ xTF = TextFrameHandler.getFrameByName("Company Logo",
+ self.xTextDocument)
if xTF != None:
xTF.dispose()
if not self.keepTypeFrame:
- xTF = TextFrameHandler.getFrameByName("Communication Type", self.xTextDocument)
+ xTF = TextFrameHandler.getFrameByName("Communication Type",
+ self.xTextDocument)
if xTF != None:
xTF.dispose()