From efa0451d8eab878812e2bbacc4319d7490d0f333 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 10 Feb 2013 22:14:45 +0100 Subject: pyagenda: remove placeholder when text is not empty Change-Id: I06ae1815ec1bd904e944929f1b50a0ee95a6a5ae --- wizards/com/sun/star/wizards/agenda/AgendaDocument.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'wizards/com') diff --git a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py index c993d623aa2b..07b3f35f7117 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaDocument.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaDocument.py @@ -662,7 +662,6 @@ class ItemsTable(object): # should this section be visible? visible = False # write items - # =========== cellName = "" ''' now go through all items that belong to this @@ -689,8 +688,6 @@ class ItemsTable(object): if not visible: return ''' - remove obsolete rows - ==================== if the cell that was last written is the current cell, it means this is the end of the table, so we end here. (because after getting the cellName above, @@ -889,6 +886,7 @@ class PlaceholderTextElement(TextElement): self.text = placeHolderText_ self.hint = hint_ self.xmsf = xmsf_ + self.xTextContentList = [] def write(self, textRange): textRange.String = self.placeHolderText @@ -896,11 +894,16 @@ class PlaceholderTextElement(TextElement): try: xTextContent = AgendaDocument.createPlaceHolder( self.xmsf, self.text, self.hint) + self.xTextContentList.append(xTextContent) textRange.Text.insertTextContent( textRange.Start, xTextContent, True) except Exception: 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 it using a ParaStyleName. -- cgit