Kaydet (Commit) 0ff42915 authored tarafından Xisco Fauli's avatar Xisco Fauli

pyagenda: remove duplicate code

Change-Id: I673818e6ab3ed5c430b9891af5c4bd5fe7ab146f
üst 531b7136
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment