From 0ff42915684fe773e58f5c77ce3c78470123412b Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 8 Nov 2012 01:01:31 +0100 Subject: pyagenda: remove duplicate code Change-Id: I673818e6ab3ed5c430b9891af5c4bd5fe7ab146f --- wizards/com/sun/star/wizards/agenda/AgendaTemplate.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'wizards') diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py index 0ecf8c32eda9..4f99bfdebc17 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py @@ -173,7 +173,6 @@ class AgendaTemplate(TextDocument): def redraw(self, itemName): AgendaTemplate.xTextDocument.lockControllers() try: - print "kinki" # get the table in which the item is... itemsTable = AgendaTemplate.itemsMap[itemName] # rewrite the table. @@ -450,9 +449,9 @@ class AgendaTemplate(TextDocument): @classmethod def writeTitle(self, te, tr, text): if text is None: - te.text = "" + te.placeHolderText = "" else: - te.text = text + te.placeHolderText = text te.write(tr) @classmethod @@ -1141,18 +1140,18 @@ inserts a placeholder instead. class PlaceholderTextElement(TextElement): def __init__(self, textRange, placeHolderText_, hint_, xmsf_): - super(PlaceholderTextElement,self).__init__(textRange, placeHolderText_) + super(PlaceholderTextElement,self).__init__(textRange, "") - self.placeHolderText = placeHolderText_ + self.text = placeHolderText_ self.hint = hint_ self.xmsf = xmsf_ def write(self, textRange): - textRange.String = self.text - if self.text is None or self.text == "": + textRange.String = self.placeHolderText + if self.placeHolderText is None or self.placeHolderText == "": try: xTextContent = AgendaTemplate.createPlaceHolder( - self.xmsf, self.placeHolderText, self.hint) + self.xmsf, self.text, self.hint) textRange.Text.insertTextContent( textRange.Start, xTextContent, True) except Exception, ex: -- cgit