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): ...@@ -173,7 +173,6 @@ class AgendaTemplate(TextDocument):
def redraw(self, itemName): def redraw(self, itemName):
AgendaTemplate.xTextDocument.lockControllers() AgendaTemplate.xTextDocument.lockControllers()
try: try:
print "kinki"
# get the table in which the item is... # get the table in which the item is...
itemsTable = AgendaTemplate.itemsMap[itemName] itemsTable = AgendaTemplate.itemsMap[itemName]
# rewrite the table. # rewrite the table.
...@@ -450,9 +449,9 @@ class AgendaTemplate(TextDocument): ...@@ -450,9 +449,9 @@ class AgendaTemplate(TextDocument):
@classmethod @classmethod
def writeTitle(self, te, tr, text): def writeTitle(self, te, tr, text):
if text is None: if text is None:
te.text = "" te.placeHolderText = ""
else: else:
te.text = text te.placeHolderText = text
te.write(tr) te.write(tr)
@classmethod @classmethod
...@@ -1141,18 +1140,18 @@ inserts a placeholder instead. ...@@ -1141,18 +1140,18 @@ inserts a placeholder instead.
class PlaceholderTextElement(TextElement): class PlaceholderTextElement(TextElement):
def __init__(self, textRange, placeHolderText_, hint_, xmsf_): 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.hint = hint_
self.xmsf = xmsf_ self.xmsf = xmsf_
def write(self, textRange): def write(self, textRange):
textRange.String = self.text textRange.String = self.placeHolderText
if self.text is None or self.text == "": if self.placeHolderText is None or self.placeHolderText == "":
try: try:
xTextContent = AgendaTemplate.createPlaceHolder( xTextContent = AgendaTemplate.createPlaceHolder(
self.xmsf, self.placeHolderText, self.hint) self.xmsf, self.text, self.hint)
textRange.Text.insertTextContent( textRange.Text.insertTextContent(
textRange.Start, xTextContent, True) textRange.Start, xTextContent, True)
except Exception, ex: 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