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

pyagenda: remove placeholder when text is not empty

Change-Id: I06ae1815ec1bd904e944929f1b50a0ee95a6a5ae
üst 2f7bd777
...@@ -662,7 +662,6 @@ class ItemsTable(object): ...@@ -662,7 +662,6 @@ class ItemsTable(object):
# should this section be visible? # should this section be visible?
visible = False visible = False
# write items # write items
# ===========
cellName = "" cellName = ""
''' '''
now go through all items that belong to this now go through all items that belong to this
...@@ -689,8 +688,6 @@ class ItemsTable(object): ...@@ -689,8 +688,6 @@ class ItemsTable(object):
if not visible: if not visible:
return return
''' '''
remove obsolete rows
====================
if the cell that was last written is the current cell, if the cell that was last written is the current cell,
it means this is the end of the table, so we end here. it means this is the end of the table, so we end here.
(because after getting the cellName above, (because after getting the cellName above,
...@@ -889,6 +886,7 @@ class PlaceholderTextElement(TextElement): ...@@ -889,6 +886,7 @@ class PlaceholderTextElement(TextElement):
self.text = placeHolderText_ self.text = placeHolderText_
self.hint = hint_ self.hint = hint_
self.xmsf = xmsf_ self.xmsf = xmsf_
self.xTextContentList = []
def write(self, textRange): def write(self, textRange):
textRange.String = self.placeHolderText textRange.String = self.placeHolderText
...@@ -896,11 +894,16 @@ class PlaceholderTextElement(TextElement): ...@@ -896,11 +894,16 @@ class PlaceholderTextElement(TextElement):
try: try:
xTextContent = AgendaDocument.createPlaceHolder( xTextContent = AgendaDocument.createPlaceHolder(
self.xmsf, self.text, self.hint) self.xmsf, self.text, self.hint)
self.xTextContentList.append(xTextContent)
textRange.Text.insertTextContent( textRange.Text.insertTextContent(
textRange.Start, xTextContent, True) textRange.Start, xTextContent, True)
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
else:
if self.xTextContentList:
for i in self.xTextContentList:
textRange.Text.removeTextContent(i)
self.xTextContentList = []
''' '''
An Agenda element which writes no text, but inserts a placeholder, and formats An Agenda element which writes no text, but inserts a placeholder, and formats
it using a ParaStyleName. it using a ParaStyleName.
......
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