[Libreoffice-commits] .: 5 commits - wizards/com

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 17:10:23 PDT 2012


 wizards/com/sun/star/wizards/agenda/AgendaTemplate.py              |  489 +---------
 wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py          |  191 ++-
 wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.py     |  104 +-
 wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py      |   68 -
 wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py |   50 +
 wizards/com/sun/star/wizards/agenda/CallWizard.py                  |   50 +
 wizards/com/sun/star/wizards/agenda/TemplateConsts.py              |   90 -
 wizards/com/sun/star/wizards/agenda/TopicsControl.py               |   13 
 wizards/com/sun/star/wizards/common/FileAccess.py                  |   13 
 wizards/com/sun/star/wizards/common/TextElement.py                 |    2 
 wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py            |   15 
 wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py       |   27 
 wizards/com/sun/star/wizards/letter/CGLetter.py                    |    1 
 wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py      |   16 
 wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py |    5 
 wizards/com/sun/star/wizards/text/TextDocument.py                  |   61 -
 wizards/com/sun/star/wizards/ui/UnoDialog2.py                      |    3 
 17 files changed, 465 insertions(+), 733 deletions(-)

New commits:
commit 9545c85db39144705fb50409b7f4b7a3cf472150
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Tue Oct 30 01:06:43 2012 +0100

    pyagenda: rework AgendaTemplate.py. Still some work to do
    
    Change-Id: Ife802611e8aef10e5d06f04617662753d6f2ee21

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
index bb85bcc..3e928a8 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
@@ -15,11 +15,14 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
+import traceback
 import uno
 from .TemplateConsts import *
 from threading import RLock
-from ..text.TextDocument import *
+from ..text.TextDocument import TextDocument
 from ..common.FileAccess import FileAccess
+from ..common.TextElement import TextElement
+from ..common.Helper import Helper
 from ..text.TextSectionHandler import TextSectionHandler
 
 from datetime import date as dateTimeObject
@@ -76,7 +79,7 @@ One compolsary Heading row.<br/>
 <br/><br/>
 To let the template be flexible, we use a kind of "detection": we look where
 the items are read the design of each table, reaplying it after writing the
-table.AgendaTemplate.document
+table.AgendaTemplate.xTextDocument
 <br/><br/>
 A note about threads:<br/>
 Many methods here are synchronized, in order to avoid colission made by
@@ -86,8 +89,6 @@ events fired too often.
 class AgendaTemplate(TextDocument):
 
     writtenTopics = []
-    itemsCache = None
-    _allItems = []
     items = []
     itemsMap = {}
     document = None
@@ -103,21 +104,16 @@ class AgendaTemplate(TextDocument):
     @param resources_ resources.
     '''
 
-    def __init__(self,  xmsf_, agenda_, resources_, listener):
-        super(AgendaTemplate,self).__init__(xmsf_,listener, None,
+    def __init__(self,  xmsf, agenda, resources, listener):
+        super(AgendaTemplate,self).__init__(xmsf,listener, None,
             "WIZARD_LIVE_PREVIEW")
-        AgendaTemplate.agenda = agenda_
-        self.resources = resources_
-
-        if AgendaTemplate.itemsCache is None:
-            self.initItemsCache()
-
-        AgendaTemplate._allItems = None
+        self.agenda = agenda
+        self.resources = resources
 
     @synchronized(lock)
     def load(self, templateURL, topics):
         AgendaTemplate.template = self.calcTemplateName(templateURL)
-        AgendaTemplate.document = self.loadAsPreview(templateURL, False)
+        AgendaTemplate.xTextDocument = self.loadAsPreview(templateURL, False)
         self.xFrame.ComponentWindow.Enable = False
         self.xTextDocument.lockControllers()
         self.initialize()
@@ -155,9 +151,9 @@ class AgendaTemplate(TextDocument):
         self.redrawTitle("txtDate")
         self.redrawTitle("txtTime")
         self.redrawTitle("cbLocation")
-        if AgendaTemplate.agenda.cp_TemplateName is None:
-            AgendaTemplate.agenda.cp_TemplateName = ""
-        self.setTemplateTitle(AgendaTemplate.agenda.cp_TemplateName)
+        if self.agenda.cp_TemplateName is None:
+            self.agenda.cp_TemplateName = ""
+        self.setTemplateTitle(self.agenda.cp_TemplateName)
 
     '''redraws/rewrites the table which contains the given item
     This method is called when the user checks/unchecks an item.
@@ -188,111 +184,30 @@ class AgendaTemplate(TextDocument):
 
     '''checks the data model if the
     item corresponding to the given string should be shown
-    @param itemName a string representing an Item (name or heading).
-    @return true if the model specifies that the item should be displayed.
     '''
-
-    @classmethod
     def isShowItem(self, itemName):
-        if itemName == FILLIN_MEETING_TYPE:
-            return AgendaTemplate.agenda.cp_ShowMeetingType
-        elif itemName == FILLIN_READ:
-            return AgendaTemplate.agenda.cp_ShowRead
-        elif itemName == FILLIN_BRING:
-            return AgendaTemplate.agenda.cp_ShowBring
-        elif itemName == FILLIN_NOTES:
-            return AgendaTemplate.agenda.cp_ShowNotes
-        elif itemName == FILLIN_FACILITATOR:
-            return AgendaTemplate.agenda.cp_ShowFacilitator
-        elif itemName == FILLIN_TIMEKEEPER:
-            return AgendaTemplate.agenda.cp_ShowTimekeeper
-        elif itemName == FILLIN_NOTETAKER:
-            return AgendaTemplate.agenda.cp_ShowNotetaker
-        elif itemName == FILLIN_PARTICIPANTS:
-            return AgendaTemplate.agenda.cp_ShowAttendees
-        elif itemName == FILLIN_CALLED_BY:
-            return AgendaTemplate.agenda.cp_ShowCalledBy
-        elif itemName == FILLIN_OBSERVERS:
-            return AgendaTemplate.agenda.cp_ShowObservers
-        elif itemName == FILLIN_RESOURCE_PERSONS:
-            return AgendaTemplate.agenda.cp_ShowResourcePersons
-        else:
-            raise ValueError("No such item")
-
-    '''itemsCache is a Map containing all agenda item. These are object which
-    "write themselfs" to the table, given a table cursor.
-    A cache is used in order to reuse the objects, instead of recreate them.
-    This method fills the cache will all items objects (names and headings).
-    '''
-
-    def initItemsCache(self):
-        AgendaTemplate.itemsCache = {}
-        # Headings
-        AgendaTemplate.itemsCache[FILLIN_MEETING_TYPE] = AgendaItem(
-            FILLIN_MEETING_TYPE,
-            TextElement (self.resources.itemMeetingType),
-            PlaceholderElement(
-                self.resources.reschkMeetingTitle_value,
-                self.resources.resPlaceHolderHint, self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_BRING] = AgendaItem(
-            FILLIN_BRING, TextElement (self.resources.itemBring),
-            PlaceholderElement (
-                self.resources.reschkBring_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_READ] = AgendaItem (
-            FILLIN_READ, TextElement (self.resources.itemRead),
-            PlaceholderElement (
-                self.resources.reschkRead_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_NOTES] = AgendaItem (
-            FILLIN_NOTES, TextElement (self.resources.itemNote),
-            PlaceholderElement (
-                self.resources.reschkNotes_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-
-        # Names
-        AgendaTemplate.itemsCache[FILLIN_CALLED_BY] = AgendaItem(
-            FILLIN_CALLED_BY,
-            TextElement (self.resources.itemCalledBy),
-            PlaceholderElement (
-                self.resources.reschkConvenedBy_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_FACILITATOR] = AgendaItem(
-            FILLIN_FACILITATOR,
-            TextElement (self.resources.itemFacilitator),
-            PlaceholderElement (
-                self.resources.reschkPresiding_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_PARTICIPANTS] = AgendaItem(
-            FILLIN_PARTICIPANTS,
-            TextElement (self.resources.itemAttendees),
-            PlaceholderElement(
-                self.resources.reschkAttendees_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_NOTETAKER] = AgendaItem(
-            FILLIN_NOTETAKER,
-            TextElement(self.resources.itemNotetaker),
-            PlaceholderElement(
-                self.resources.reschkNoteTaker_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_TIMEKEEPER] = AgendaItem(
-            FILLIN_TIMEKEEPER,
-            TextElement (self.resources.itemTimekeeper),
-            PlaceholderElement(
-                self.resources.reschkTimekeeper_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_OBSERVERS] = AgendaItem(
-            FILLIN_OBSERVERS,
-            TextElement(self.resources.itemObservers),
-            PlaceholderElement(
-                self.resources.reschkObservers_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
-        AgendaTemplate.itemsCache[FILLIN_RESOURCE_PERSONS] = AgendaItem(
-            FILLIN_RESOURCE_PERSONS,
-            TextElement(self.resources.itemResource),
-            PlaceholderElement(
-                self.resources.reschkResourcePersons_value,
-                self.resources.resPlaceHolderHint,  self.xMSF))
+        if itemName is "<meeting-type>":
+            return self.agenda.cp_ShowMeetingType
+        elif itemName is "<read>":
+            return self.agenda.cp_ShowRead
+        elif itemName is "<bring>":
+            return self.agenda.cp_ShowBring
+        elif itemName is "<notes>":
+            return self.agenda.cp_ShowNotes
+        elif itemName is "<facilitator>":
+            return self.agenda.cp_ShowFacilitator
+        elif itemName is "<timekeeper>":
+            return self.agenda.cp_ShowTimekeeper
+        elif itemName is "<notetaker>":
+            return self.agenda.cp_ShowNotetaker
+        elif itemName is "<attendees>":
+            return self.agenda.cp_ShowAttendees
+        elif itemName is "<called-by>":
+            return self.agenda.cp_ShowCalledBy
+        elif itemName is "<observers>":
+            return self.agenda.cp_ShowObservers
+        elif itemName is "<resource-persons>":
+            return self.agenda.cp_ShowResourcePersons
 
     '''Initializes a template.<br/>
     This method does the following tasks:<br/>
@@ -312,7 +227,7 @@ class AgendaTemplate(TextDocument):
         and create the date and time formatters.
         '''
         AgendaTemplate.dateUtils = Helper.DateUtils(
-            self.xMSF, AgendaTemplate.document)
+            self.xMSF, AgendaTemplate.xTextDocument)
         AgendaTemplate.formatter = AgendaTemplate.dateUtils.formatter
         AgendaTemplate.dateFormat = AgendaTemplate.dateUtils.getFormat(DATE_SYSTEM_LONG)
         AgendaTemplate.timeFormat = AgendaTemplate.dateUtils.getFormat(TIME_HHMM)
@@ -321,60 +236,39 @@ class AgendaTemplate(TextDocument):
         get the document properties object.
         '''
 
-        self.m_xDocProps = AgendaTemplate.document.DocumentProperties
-        self.initItemsCache()
-        AgendaTemplate._allItems = self.searchFillInItems()
-        self.initializeTitles()
-        self.initializeItemsSections()
+        self.m_xDocProps = AgendaTemplate.xTextDocument.DocumentProperties
+        self.addTitlesToPlaceHoldersDict()
+        self.initializePlaceHolders()
+        #self.initializeItemsSections()
         AgendaTemplate.textSectionHandler = TextSectionHandler(
-            AgendaTemplate.document, AgendaTemplate.document)
+            AgendaTemplate.xTextDocument, AgendaTemplate.xTextDocument)
         self.topics = Topics()
-        del AgendaTemplate._allItems[:]
-        AgendaTemplate._allItems = None
 
-    '''
-    locates the titles (name, location, date, time)
-    and saves a reference to thier Text ranges.
-    '''
 
-    def initializeTitles(self):
-        i = 0
-        while i < len(AgendaTemplate._allItems):
-            workwith = AgendaTemplate._allItems[i]
-            text = workwith.String.lstrip().lower()
-            if text == FILLIN_TITLE:
-                AgendaTemplate.teTitle = PlaceholderTextElement(
-                    workwith, self.resources.resPlaceHolderTitle,
-                    self.resources.resPlaceHolderHint,
-                    AgendaTemplate.document)
-                AgendaTemplate.trTitle = workwith
-                del AgendaTemplate._allItems[i]
-                i -= 1
-            elif text == FILLIN_DATE:
-                AgendaTemplate.teDate = PlaceholderTextElement(
-                    workwith, self.resources.resPlaceHolderDate,
-                    self.resources.resPlaceHolderHint,
-                    AgendaTemplate.document)
-                AgendaTemplate.trDate = workwith
-                del AgendaTemplate._allItems[i]
-                i -= 1
-            elif text == FILLIN_TIME:
-                AgendaTemplate.teTime = PlaceholderTextElement(
-                    workwith, self.resources.resPlaceHolderTime,
-                    self.resources.resPlaceHolderHint,
-                    AgendaTemplate.document)
-                AgendaTemplate.trTime = workwith
-                del AgendaTemplate._allItems[i]
-                i -= 1
-            elif text == FILLIN_LOCATION:
-                AgendaTemplate.teLocation = PlaceholderTextElement(
-                    workwith, self.resources.resPlaceHolderLocation,
-                    self.resources.resPlaceHolderHint,
-                    AgendaTemplate.document)
-                AgendaTemplate.trLocation = workwith
-                del AgendaTemplate._allItems[i]
-                i -= 1
-            i += 1
+    def addTitlesToPlaceHoldersDict(self):
+        #We add them here because we can't in AgendaWizardDialogResources.py
+        self.resources.dictTemplatePlaceHolders["<minutes-title>"] = \
+            self.agenda.cp_Title
+        self.resources.dictTemplatePlaceHolders["<minutes-location>"] = \
+            self.agenda.cp_Location
+        self.resources.dictTemplatePlaceHolders["<minutes-date>"] = \
+            self.agenda.cp_Date
+        self.resources.dictTemplatePlaceHolders["<minutes-time>"] = \
+            self.agenda.cp_Time
+        
+    def initializePlaceHolders(self):
+        # Looks for all the placeholders in the template with the following
+        # pattern: "<[^>]+>" and create a TextElement for each one of them   
+        allItems = self.searchFillInItems(0)
+        for i in xrange(allItems.Count):
+            item = allItems.getByIndex(i)
+            text = item.String.lower()
+            aux = TextElement(
+                item, self.resources.dictTemplatePlaceHolders[text],
+                self.resources.resPlaceHolderHint, self.xMSF)
+            if self.isShowItem(text):
+                aux.write()
+                
 
     '''
     analyze the item sections in the template.
@@ -382,7 +276,7 @@ class AgendaTemplate(TextDocument):
     '''
 
     def initializeItemsSections(self):
-        sections = self.getSections(AgendaTemplate.document, SECTION_ITEMS)
+        sections = self.getSections(AgendaTemplate.xTextDocument, SECTION_ITEMS)
         # for each section - there is a table...
         self.itemsTables = []
         for i in sections:
@@ -392,8 +286,8 @@ class AgendaTemplate(TextDocument):
             except Exception, ex:
                 traceback.print_exc()
                 raise AttributeError (
-                    "Fatal Error while initialilzing \
-                    Template: items table in section " + i)
+                    "Fatal Error while initialilzing" +
+                    "Template: items table in section " + i)
 
 
     def getSections(self, document, s):
@@ -402,11 +296,11 @@ class AgendaTemplate(TextDocument):
 
     @classmethod
     def getSection(self, name):
-        return getattr(AgendaTemplate.document.TextSections, name)
+        return getattr(AgendaTemplate.xTextDocument.TextSections, name)
 
     @classmethod
     def getTable(self, name):
-        return getattr(AgendaTemplate.document.TextTables, name)
+        return getattr(AgendaTemplate.xTextDocument.TextTables, name)
 
     @classmethod
     @synchronized(lock)
@@ -415,19 +309,19 @@ class AgendaTemplate(TextDocument):
             if controlName == "txtTitle":
                 self.writeTitle(
                     AgendaTemplate.teTitle, AgendaTemplate.trTitle,
-                    AgendaTemplate.agenda.cp_Title)
+                    self.agenda.cp_Title)
             elif controlName == "txtDate":
                 self.writeTitle(
                     AgendaTemplate.teDate, AgendaTemplate.trDate,
-                    self.getDateString(AgendaTemplate.agenda.cp_Date))
+                    self.getDateString(self.agenda.cp_Date))
             elif controlName == "txtTime":
                 self.writeTitle(
                     AgendaTemplate.teTime, AgendaTemplate.trTime,
-                    self.getTimeString(AgendaTemplate.agenda.cp_Time))
+                    self.getTimeString(self.agenda.cp_Time))
             elif controlName == "cbLocation":
                 self.writeTitle(
                     AgendaTemplate.teLocation, AgendaTemplate.trLocation,
-                    AgendaTemplate.agenda.cp_Location)
+                    self.agenda.cp_Location)
             else:
                 raise IllegalArgumentException ("No such title control...")
         except Exception:
@@ -475,7 +369,7 @@ class AgendaTemplate(TextDocument):
     '''
 
     def deleteHiddenSections(self):
-        allSections = AgendaTemplate.document.TextSections.ElementNames
+        allSections = AgendaTemplate.xTextDocument.TextSections.ElementNames
         try:
             for i in allSections:
                 self.section = self.getSection(i)
@@ -500,7 +394,7 @@ class AgendaTemplate(TextDocument):
     def createMinutes(self, topicsData):
         # if the minutes section should be removed (the
         # user did not check "create minutes")
-        if not AgendaTemplate.agenda.cp_IncludeMinutes \
+        if not self.agenda.cp_IncludeMinutes \
                 or len(topicsData) <= 1:
             try:
                 minutesAllSection = self.getSection(SECTION_MINUTES_ALL)
@@ -511,30 +405,6 @@ class AgendaTemplate(TextDocument):
         # the user checked "create minutes"
         else:
             try:
-                topicStartTime = int(AgendaTemplate.agenda.cp_Time)
-                #first I replace the minutes titles...
-                AgendaTemplate.items = TextDocument.searchFillInItems()
-                itemIndex = 0
-                for item in self.items:
-                    itemText = item.String.lstrip().lower()
-                    if itemText == FILLIN_MINUTES_TITLE:
-                        self.fillMinutesItem(
-                            item, AgendaTemplate.agenda.cp_Title,
-                            self.resources.resPlaceHolderTitle)
-                    elif itemText == FILLIN_MINUTES_LOCATION:
-                        self.fillMinutesItem(
-                            item, AgendaTemplate.agenda.cp_Location,
-                            self.resources.resPlaceHolderLocation)
-                    elif itemText == FILLIN_MINUTES_DATE:
-                        self.fillMinutesItem(
-                            item, getDateString(AgendaTemplate.agenda.cp_Date),
-                            self.resources.resPlaceHolderDate)
-                    elif itemText == FILLIN_MINUTES_TIME:
-                        self.fillMinutesItem(
-                            item, getTimeString(AgendaTemplate.agenda.cp_Time),
-                            self.resources.resPlaceHolderTime)
-
-                self.items.clear()
                 '''
                 now add minutes for each topic.
                 The template contains *one* minutes section, so
@@ -547,20 +417,6 @@ class AgendaTemplate(TextDocument):
                     AgendaTemplate.items = TextDocument.searchFillInItems()
                     itemIndex = 0
                     for item in self.items:
-                        itemText = item.String.lstrip().lower()
-                        if itemText == FILLIN_MINUTE_NUM:
-                            fillMinutesItem(item, topic[0].Value, "")
-                        elif itemText == FILLIN_MINUTE_TOPIC:
-                            fillMinutesItem(item, topic[1].Value, "")
-                        elif itemText == FILLIN_MINUTE_RESPONSIBLE:
-                            fillMinutesItem(item, topic[2].Value, "")
-                        elif itemText == FILLIN_MINUTE_TIME:
-                            topicTime = 0
-                            try:
-                                topicTime = topic[3].Value
-                            except Exception, ex:
-                                pass
-
                             '''
                             if the topic has no time, we do not
                             display any time here.
@@ -584,53 +440,6 @@ class AgendaTemplate(TextDocument):
             except Exception, ex:
                 traceback.print_exc()
 
-    '''given a text range and a text, fills the given
-    text range with the given text.
-    If the given text is empty, uses a placeholder with the giveb
-    placeholder text.
-    @param range text range to fill
-    @param text the text to fill to the text range object.
-    @param placeholder the placeholder text to use, if the
-    text argument is empty (null or "")
-    '''
-
-    def fillMinutesItem(self, Range, text, placeholder):
-        paraStyle = Helper.getUnoPropertyValue(Range, "ParaStyleName")
-        Range.setString(text)
-        Helper.setUnoPropertyValue(Range, "ParaStyleName", paraStyle)
-        if text == None or text == "":
-            if placeholder != None and not placeholder == "":
-                placeHolder = createPlaceHolder(
-                    AgendaTemplate.document, placeholder,
-                    self.resources.resPlaceHolderHint)
-                try:
-                    Range.Start.Text.insertTextContent(
-                        Range.Start, placeHolder, True)
-                except Exception, ex:
-                    traceback.print_exc()
-
-    '''creates a placeholder field with the given text and given hint.
-    @param  AgendaTemplate.document service factory
-    @param ph place holder text
-    @param hint hint text
-    @return the place holder field.
-    '''
-
-    @classmethod
-    def createPlaceHolder(self, xmsf, ph, hint):
-        try:
-            placeHolder =  xmsf.createInstance(
-                "com.sun.star.text.TextField.JumpEdit")
-        except Exception, ex:
-            traceback.print_exc()
-            return None
-
-        Helper.setUnoPropertyValue(placeHolder, "PlaceHolder", ph)
-        Helper.setUnoPropertyValue(placeHolder, "Hint", hint)
-        Helper.setUnoPropertyValue(
-           placeHolder, "PlaceHolderType", uno.Any("short",TEXT))
-        return placeHolder
-
     def getNamesWhichStartWith(self, allNames, prefix):
         v = []
         for i in allNames:
@@ -680,26 +489,6 @@ class ItemsTable(object):
         ItemsTable.table = table_
         self.section = section_
         self.items = []
-        '''
-        go through all <*> items in the document
-        and each one if it is in this table.
-        If they are, register them to belong here, notice their order
-        and remove them from the list of all <*> items, so the next
-        search will be faster.
-        '''
-        i = 0
-        while i < len(AgendaTemplate._allItems):
-            workwith = AgendaTemplate._allItems[i]
-            t = Helper.getUnoPropertyValue(workwith, "TextTable")
-            if t == ItemsTable.table:
-                iText = workwith.String.lower().lstrip()
-                ai = AgendaTemplate.itemsCache[iText]
-                if ai is not None:
-                    self.items.append(ai)
-                    del AgendaTemplate._allItems[i]
-                    AgendaTemplate.itemsMap[iText] = self
-                    i -= 1
-            i += 1
 
     '''
     link the section to the template. this will restore the original table
@@ -846,22 +635,6 @@ class Topics(object):
                 SECTION_TOPICS + " could not load.")
 
         '''
-        first I store all <*> ranges
-        which are in the topics table.
-        I store each <*> range in this - the key
-        is the cell it is in. Later when analyzing the topic,
-        cell by cell, I check in this map to know
-        if a cell contains a <*> or not.
-        '''
-        items = {}
-        for i in AgendaTemplate._allItems:
-            t = Helper.getUnoPropertyValue(i, "TextTable")
-            if t == Topics.table:
-                cell = Helper.getUnoPropertyValue(i, "Cell")
-                iText = cell.CellName
-                items[iText] = i
-
-        '''
         in the topics table, there are always one
         title row and three topics defined.
         So no mutter how many rows a topic takes - we
@@ -876,18 +649,16 @@ class Topics(object):
         # analyze the structure of the topic rows.
         while not cursor.RangeName == afterLastCell:
             cell = Topics.table.getCellByName(cursor.RangeName)
-            # first I store the content and para style of the cell
-            ae = TextElement(cell)
             # if the cell contains a relevant <...>
             # i add the text element to the hash,
             # so it's text can be updated later.
             try:
                 if items[cell.CellName] is not None:
-                    self.topicItems[cell.String.lower().lstrip()] = ae
+                    self.topicItems[cell.String.lower().lstrip()] = cell
             except KeyError:
                 pass
 
-            Topics.topicCells.append(ae)
+            Topics.topicCells.append(cell)
             # goto next cell.
             cursor.goRight(1, False)
         '''
@@ -1104,68 +875,6 @@ class Topics(object):
                 cursor.goRight(1, False)
 
 '''
-A basic implementation of AgendaElement:
-writes a String to the given XText/XTextRange, and applies
-a ParaStyle to it (using the parent class).
- at author rp143992
-'''
-class TextElement(object):
-
-    def __init__(self, text_):
-        self.text = text_
-
-    def write(self, textRange):
-        textRange.String = self.text
-
-'''
-A Text element which, if the text to write is empty (null or "")
-inserts a placeholder instead.
- at author rp143992
-'''
-
-class PlaceholderTextElement(TextElement):
-
-    def __init__(self, textRange, placeHolderText_, hint_, xmsf_):
-        super(PlaceholderTextElement,self).__init__(textRange)
-
-        self.placeHolderText = placeHolderText_
-        self.hint = hint_
-        self.xmsf = xmsf_
-
-    def write(self, textRange):
-        textRange.String = self.text
-        if self.text is None or self.text == "":
-            try:
-                xTextContent = AgendaTemplate.createPlaceHolder(
-                    self.xmsf, self.placeHolderText, self.hint)
-                textRange.Text.insertTextContent(
-                    textRange.Start, xTextContent, True)
-            except Exception, ex:
-                traceback.print_exc()
-
-'''
-An Agenda element which writes no text, but inserts a placeholder, and formats
-it using a ParaStyleName.
- at author rp143992
-'''
-
-class PlaceholderElement(object):
-
-    def __init__(self, placeHolderText_, hint_,  xmsf_):
-        self.placeHolderText = placeHolderText_
-        self.hint = hint_
-        self.xmsf =  xmsf_
-
-    def write(self, textRange):
-        try:
-            xTextContent = AgendaTemplate.createPlaceHolder(
-                AgendaTemplate.document, self.placeHolderText, self.hint)
-            textRange.Text.insertTextContent(
-                textRange.Start, xTextContent, True)
-        except Exception, ex:
-            traceback.print_exc()
-
-'''
 An implementation of AgendaElement which
 gets as a parameter a table cursor, and writes
 a text to the cell marked by this table cursor, and
@@ -1175,15 +884,15 @@ a place holder to the next cell.
 
 class AgendaItem(object):
 
-    def __init__(self, name_, te, f):
-        self.name = name_
-        self.field = f
-        self.textElement = te
+    def __init__(self, name, textRange, field):
+        self.name = name
+        self.field = field
+        self.textRange = textRange
 
     def write(self, tableCursor):
         cellname = tableCursor.RangeName
         cell = ItemsTable.table.getCellByName(cellname)
-        self.textElement.write(cell)
+        self.textElement.String = cell
         tableCursor.goRight(1, False)
         #second field is actually always null...
         # this is a preparation for adding placeholders.
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
index e1e0765..d729f07 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
@@ -57,7 +57,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
                 "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
             xLocMSF = Desktop.connect(ConnectStr)
             lw = AgendaWizardDialogImpl(xLocMSF)
-            lw.startWizard()
+            lw.startWizard(xLocMSF)
         except Exception as e:
             print ("Wizard failure exception " + str(type(e)) +
                    " message " + str(e) + " args " + str(e.args) +
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
index 8ddc3ab..92b8276 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
@@ -166,5 +166,53 @@ class AgendaWizardDialogResources(Resource):
         self.resButtonDown = self.getResText(
             AgendaWizardDialogResources.RID_AGENDAWIZARDDIALOG_START + 71)
 
+        #Create a dictionary for localising the template placeholders
+        self.dictTemplatePlaceHolders = {
+            "<title>" : self.resPlaceHolderTitle,
+            "<date>" : self.resPlaceHolderDate,
+            "<time>" : self.resPlaceHolderTime,
+            "<location>" : self.resPlaceHolderLocation,
+            "<meeting-type>" : self.reschkMeetingTitle_value,
+            "<bring>" : self.reschkBring_value,
+            "<read>" : self.reschkRead_value,
+            "<notes>" : self.reschkNotes_value,
+            "<called-by>" : self.itemCalledBy,
+            "<facilitator>" : self.itemFacilitator,
+            "<attendees>" : self.itemAttendees,
+            "<notetaker>" : self.itemNotetaker,
+            "<timekeeper>" : self.itemTimekeeper,
+            "<observers>" : self.itemObservers,
+            "<resource-persons>" : self.itemResource,
+            "<num>" : "",
+            "<topic>" : "",
+            "<responsible>" : "",
+            "<topic-time>" : "",
+            "<mnum>" : "",
+            "<mtopic>" : "",
+            "<mresponsible>" : "",
+            "<mtime>" : ""}            
+            
+        '''
+        section name <b>prefix</b> for sections that contain items.
+        this is also used as table name prefix, since each items section
+        must contain a table whos name is identical name to the section's name.
+        '''
+        SECTION_ITEMS = "AGENDA_ITEMS"
+        '''
+        the name of the section which contains the topics.
+        '''
+        SECTION_TOPICS = "AGENDA_TOPICS"
+        '''
+        the name of the parent minutes section.
+        '''
+        SECTION_MINUTES_ALL = "MINUTES_ALL"
+        '''
+        the name of the child nimutes section.
+        This section will be duplicated for each topic.
+        '''
+        SECTION_MINUTES = "MINUTES"
+
+
+        #Common Resources
         self.resOverwriteWarning = self.getResText(
             AgendaWizardDialogResources.RID_COMMON_START + 19)
diff --git a/wizards/com/sun/star/wizards/agenda/TemplateConsts.py b/wizards/com/sun/star/wizards/agenda/TemplateConsts.py
deleted file mode 100644
index 1736fce..0000000
--- a/wizards/com/sun/star/wizards/agenda/TemplateConsts.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-FILLIN_TITLE = "<title>"
-FILLIN_TITLE = "<title>"
-FILLIN_DATE = "<date>"
-FILLIN_TIME = "<time>"
-FILLIN_LOCATION = "<location>"
-'''
-section name <b>prefix</b> for sections that contain items.
-this is also used as table name prefix, since each items section
-must contain a table whos name is identical name to the section's name.
-'''
-SECTION_ITEMS = "AGENDA_ITEMS"
-'''
-the name of the section which contains the topics.
-'''
-SECTION_TOPICS = "AGENDA_TOPICS"
-'''
-the name of the parent minutes section.
-'''
-SECTION_MINUTES_ALL = "MINUTES_ALL"
-'''
-the name of the child nimutes section.
-This section will be duplicated for each topic.
-'''
-SECTION_MINUTES = "MINUTES"
-'''
-taged headings and names.
-These will be searched in item tables (in the template) and will be
-replaced with resource strings.
-
-headings...
-'''
-FILLIN_MEETING_TYPE = "<meeting-type>"
-FILLIN_BRING = "<bring>"
-FILLIN_READ = "<read>"
-FILLIN_NOTES = "<notes>"
-'''
-names...
-'''
-FILLIN_CALLED_BY = "<called-by>"
-FILLIN_FACILITATOR = "<facilitator>"
-FILLIN_PARTICIPANTS = "<attendees>"
-FILLIN_NOTETAKER = "<notetaker>"
-FILLIN_TIMEKEEPER = "<timekeeper>"
-FILLIN_OBSERVERS = "<observers>"
-FILLIN_RESOURCE_PERSONS = "<resource-persons>"
-
-'''
-Fillins for the topic table.
-These strings will be searched inside the topic table as
-part of detecting its structure.
-'''
-FILLIN_TOPIC_NUMBER = "<num>"
-FILLIN_TOPIC_TOPIC = "<topic>"
-FILLIN_TOPIC_RESPONSIBLE = "<responsible>"
-FILLIN_TOPIC_TIME = "<topic-time>"
-'''
-fillins for minutes.
-These will be searched in the minutes section and will be replaced
-with the appropriate data.
-'''
-FILLIN_MINUTES_TITLE = "<minutes-title>"
-FILLIN_MINUTES_LOCATION = "<minutes-location>"
-FILLIN_MINUTES_DATE = "<minutes-date>"
-FILLIN_MINUTES_TIME = "<minutes-time>"
-'''
-Minutes-topic fillins
-These will be searched in the minutes-child-section, and
-will be replaced with topic data.
-'''
-FILLIN_MINUTE_NUM = "<mnum>"
-FILLIN_MINUTE_TOPIC = "<mtopic>"
-FILLIN_MINUTE_RESPONSIBLE = "<mresponsible>"
-FILLIN_MINUTE_TIME = "<mtime>"
diff --git a/wizards/com/sun/star/wizards/common/TextElement.py b/wizards/com/sun/star/wizards/common/TextElement.py
index f035808..5d819b2 100644
--- a/wizards/com/sun/star/wizards/common/TextElement.py
+++ b/wizards/com/sun/star/wizards/common/TextElement.py
@@ -30,7 +30,7 @@ class TextElement(object):
 
     def write(self):
         try:
-            if self.item is not None:
+            if self.item is not None and not self.placeHolderText:
                 self.item.String = ""
                 cursor = self.item.Text.createTextCursorByRange(
                     self.item.Start)
commit 4e63e4ba815ea61d0d4c28dae0117ce9890e2b5e
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Mon Oct 29 20:16:52 2012 +0100

    pyagenda: Add callwizard
    
    Change-Id: Icbceb222d400652f4e8757a9aa2967bee60bc09e

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
index ce0a3fe..bb85bcc 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
@@ -21,7 +21,6 @@ from threading import RLock
 from ..text.TextDocument import *
 from ..common.FileAccess import FileAccess
 from ..text.TextSectionHandler import TextSectionHandler
-from .TopicsControl import TopicsControl
 
 from datetime import date as dateTimeObject
 
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
index 73e47c4..e1e0765 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
@@ -18,8 +18,9 @@
 import traceback
 from .AgendaWizardDialog import AgendaWizardDialog
 from .AgendaWizardDialogConst import HID
-from .AgendaTemplate import AgendaTemplate, TopicsControl, FileAccess
-from CGAgenda import CGAgenda
+from .AgendaTemplate import AgendaTemplate, FileAccess
+from .TopicsControl import TopicsControl
+from .CGAgenda import CGAgenda
 from ..ui.PathSelection import PathSelection
 from ..ui.event.UnoDataAware import UnoDataAware
 from ..ui.event.RadioDataAware import RadioDataAware
@@ -48,7 +49,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
     def leaveStep(self, OldStep, NewStep):
         pass
 
-
     @classmethod
     def main(self):
         #Call the wizard remotely(see README)
@@ -63,7 +63,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
                    " message " + str(e) + " args " + str(e.args) +
                    traceback.format_exc())
 
-    def startWizard(self):
+    def startWizard(self, xMSF):
         self.running = True
         try:
             #Number of steps on WizardDialog
diff --git a/wizards/com/sun/star/wizards/agenda/CallWizard.py b/wizards/com/sun/star/wizards/agenda/CallWizard.py
new file mode 100644
index 0000000..5c76249
--- /dev/null
+++ b/wizards/com/sun/star/wizards/agenda/CallWizard.py
@@ -0,0 +1,50 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the "License"); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import unohelper
+import traceback
+
+from .AgendaWizardDialogImpl import AgendaWizardDialogImpl
+
+from com.sun.star.task import XJobExecutor
+
+# implement a UNO component by deriving from the standard unohelper.Base class
+# and from the interface(s) you want to implement.
+class CallWizard(unohelper.Base, XJobExecutor):
+    def __init__(self, ctx):
+        # store the component context for later use
+        self.ctx = ctx
+
+    def trigger(self, args):
+        try:
+            fw = AgendaWizardDialogImpl(self.ctx.ServiceManager)
+            fw.startWizard(self.ctx.ServiceManager)
+        except Exception as e:
+            print ("Wizard failure exception " + str(type(e)) +
+                   " message " + str(e) + " args " + str(e.args) +
+                   traceback.format_exc())
+
+# pythonloader looks for a static g_ImplementationHelper variable
+g_ImplementationHelper = unohelper.ImplementationHelper()
+
+g_ImplementationHelper.addImplementation( \
+    CallWizard,                               # UNO object class
+    "com.sun.star.wizards.agenda.CallWizard", # implemenation name
+    ("com.sun.star.task.Job",),)                 # list of implemented services
+                                                 # (the only service)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
commit ec20c94a3034b6991f98821a2a4d511dd93682d3
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun Oct 28 22:49:42 2012 +0100

    pyagenda: now it's possible to call the wizard remotely
    
    Change-Id: I25c49f58e580a0d08a2b0d0fce9d76e372c69d19

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
index 271aa24..ce0a3fe 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
@@ -16,12 +16,13 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 import uno
-from TemplateConsts import *
+from .TemplateConsts import *
 from threading import RLock
-from wizards.text.TextDocument import *
-from wizards.common.FileAccess import FileAccess
-from wizards.text.TextSectionHandler import TextSectionHandler
-from TopicsControl import TopicsControl
+from ..text.TextDocument import *
+from ..common.FileAccess import FileAccess
+from ..text.TextSectionHandler import TextSectionHandler
+from .TopicsControl import TopicsControl
+
 from datetime import date as dateTimeObject
 
 from com.sun.star.text.PlaceholderType import TEXT
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
index 82b29b5..605444f 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
@@ -15,9 +15,9 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from wizards.ui.WizardDialog import *
-from wizards.ui.WizardDialog import *
-from AgendaWizardDialogConst import *
+from wizards.ui.WizardDialog import WizardDialog, uno, Helper, UIConsts, \
+    PropertyNames
+from AgendaWizardDialogConst import AgendaWizardDialogConst, HID
 from AgendaWizardDialogResources import AgendaWizardDialogResources
 
 from com.sun.star.awt.FontUnderline import SINGLE
@@ -26,23 +26,22 @@ class AgendaWizardDialog(WizardDialog):
 
     def __init__(self, xmsf):
         super(AgendaWizardDialog,self).__init__(xmsf, HID )
+        
         #Load Resources
         self.resources = AgendaWizardDialogResources(xmsf)
+        
         #set dialog properties...
         Helper.setUnoPropertyValues(
-            self.xDialogModel, ("Closeable",
+            self.xDialogModel, ("Closeable", 
                 PropertyNames.PROPERTY_HEIGHT,
-                "Moveable",
-                PropertyNames.PROPERTY_POSITION_X,
+                "Moveable", PropertyNames.PROPERTY_POSITION_X,
                 PropertyNames.PROPERTY_POSITION_Y,
                 PropertyNames.PROPERTY_STEP,
                 PropertyNames.PROPERTY_TABINDEX,
-                "Title",
-                PropertyNames.PROPERTY_WIDTH),
+                "Title", PropertyNames.PROPERTY_WIDTH),
             (True, 210, True, 200, 52, 1, 1,
                 self.resources.resAgendaWizardDialog_title,310))
 
-        self.IMGHELP1_HID = ""
         self.PROPS_LIST = ("Dropdown",
                 PropertyNames.PROPERTY_HEIGHT,
                 PropertyNames.PROPERTY_HELPURL,
@@ -105,16 +104,17 @@ class AgendaWizardDialog(WizardDialog):
                 PropertyNames.PROPERTY_IMAGEURL,
                 PropertyNames.PROPERTY_POSITION_X,
                 PropertyNames.PROPERTY_POSITION_Y,
-                "ScaleImage",
-                PropertyNames.PROPERTY_STEP,
+                "ScaleImage", PropertyNames.PROPERTY_STEP,
                 PropertyNames.PROPERTY_TABINDEX,
                 PropertyNames.PROPERTY_WIDTH)
+                
         self.fontDescriptor1 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor2 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor4 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
+            
         #Set member- FontDescriptors...
         self.fontDescriptor1.Weight = 150
         self.fontDescriptor1.Underline = SINGLE
@@ -125,35 +125,40 @@ class AgendaWizardDialog(WizardDialog):
     build components
     '''
     def buildStep1(self):
-        self.insertLabel("lblTitle1", self.PROPS_LABEL_B, (self.fontDescriptor4,
-            16, self.resources.reslblTitle1_value, True, 91, 8, 1, 100,212))
+        self.insertLabel("lblTitle1", self.PROPS_LABEL_B,
+            (self.fontDescriptor4, 16, self.resources.reslblTitle1_value,
+                True, 91, 8, 1, 100,212))
         self.insertLabel("lblPageDesign", self.PROPS_TEXT,
-            (8, self.resources.reslblPageDesign_value, 97, 32, 1, 101, 66))
+            (8, self.resources.reslblPageDesign_value, 97, 32, 1, 101, 66))  
         self.listPageDesign = self.insertListBox("listPageDesign",
-            None, LISTPAGEDESIGN_ACTION_PERFORMED, self.PROPS_LIST,
-            (True, 12, LISTPAGEDESIGN_HID, 166, 30, 1, 102, 70), self)
+            None, AgendaWizardDialogConst.LISTPAGEDESIGN_ACTION_PERFORMED,
+            self.PROPS_LIST,
+            (True, 12, AgendaWizardDialogConst.LISTPAGEDESIGN_HID,
+                166, 30, 1, 102, 70), self)
         self.chkMinutes = self.insertCheckBox("chkMinutes", None,
-            self.PROPS_CHECK, (9, CHKMINUTES_HID,
+            self.PROPS_CHECK, (9, AgendaWizardDialogConst.CHKMINUTES_HID,
             self.resources.reschkMinutes_value, 97, 50, 0, 1, 103, 203), self)
         self.insertImage("imgHelp1", self.PROPS_IMAGE,
-            (0, 10, self.IMGHELP1_HID,
-                INFO_IMAGE_URL, 92,
-                145, False, 1, 104, 10))
+            (0, 10, "", UIConsts.INFOIMAGEURL, 92, 145, False, 1, 104, 10))
         self.insertLabel("lblHelp1", self.PROPS_TEXTAREA,
-            (39, self.resources.reslblHelp1_value, True,104,145, 1, 105,199))
+            (39, self.resources.reslblHelp1_value,
+                True, 104, 145, 1, 105, 199))
 
     def buildStep2(self):
         self.insertLabel("lblTitle2", self.PROPS_LABEL_B,
-            (self.fontDescriptor4, 16,
-                self.resources.reslblTitle2_value, True,91, 8, 2, 200,212))
+            (self.fontDescriptor4, 16, self.resources.reslblTitle2_value,
+                True, 91, 8, 2, 200, 212))
         self.insertLabel("lblDate", self.PROPS_TEXT,
             (8, self.resources.reslblDate_value, 97, 32, 2, 201,66))
         self.txtDate = self.insertDateField(
-            "txtDate", TXTDATE_TEXT_CHANGED, self.PROPS_LIST,
-            (True, 12, TXTDATE_HID,166,30, 2, 202,70), self)
+            "txtDate", AgendaWizardDialogConst.TXTDATE_TEXT_CHANGED,
+            self.PROPS_LIST,
+            (True, 12, AgendaWizardDialogConst.TXTDATE_HID,
+                166,30, 2, 202, 70), self)
         self.insertLabel("lblTime", self.PROPS_TEXT,
             (8, self.resources.reslblTime_value, 97, 50, 2, 203, 66))
-        self.txtTime = self.insertTimeField("txtTime", TXTTIME_TEXT_CHANGED,
+        self.txtTime = self.insertTimeField("txtTime",
+            AgendaWizardDialogConst.TXTTIME_TEXT_CHANGED,
             (PropertyNames.PROPERTY_HEIGHT,
                 PropertyNames.PROPERTY_HELPURL,
                 PropertyNames.PROPERTY_POSITION_X,
@@ -162,11 +167,12 @@ class AgendaWizardDialog(WizardDialog):
                 "StrictFormat",
                 PropertyNames.PROPERTY_TABINDEX,
                 PropertyNames.PROPERTY_WIDTH),
-            (12, TXTTIME_HID, 166, 48, 2, True, 204,70), self)
+            (12, AgendaWizardDialogConst.TXTTIME_HID,
+                166, 48, 2, True, 204, 70), self)
         self.insertLabel("lblTitle", self.PROPS_TEXT,
-            (8, self.resources.reslblTitle_value, 97, 68, 2, 205,66))
+            (8, self.resources.reslblTitle_value, 97, 68, 2, 205, 66))
         self.txtTitle = self.insertTextField(
-            "txtTitle", TXTTITLE_TEXT_CHANGED,
+            "txtTitle", AgendaWizardDialogConst.TXTTITLE_TEXT_CHANGED,
             (PropertyNames.PROPERTY_HEIGHT,
                 PropertyNames.PROPERTY_HELPURL,
                 PropertyNames.PROPERTY_MULTILINE,
@@ -175,11 +181,12 @@ class AgendaWizardDialog(WizardDialog):
                 PropertyNames.PROPERTY_STEP,
                 PropertyNames.PROPERTY_TABINDEX,
                 PropertyNames.PROPERTY_WIDTH),
-            (26, TXTTITLE_HID, True, 166, 66, 2, 206, 138), self)
+            (26, AgendaWizardDialogConst.TXTTITLE_HID,
+                True, 166, 66, 2, 206, 138), self)
         self.insertLabel("lblLocation", self.PROPS_TEXT,
             (8, self.resources.reslblLocation_value, 97, 100, 2, 207, 66))
         self.cbLocation = self.insertTextField(
-            "cbLocation", TXTLOCATION_TEXT_CHANGED,
+            "cbLocation", AgendaWizardDialogConst.TXTLOCATION_TEXT_CHANGED,
             (PropertyNames.PROPERTY_HEIGHT,
                 PropertyNames.PROPERTY_HELPURL,
                 PropertyNames.PROPERTY_MULTILINE,
@@ -188,37 +195,40 @@ class AgendaWizardDialog(WizardDialog):
                 PropertyNames.PROPERTY_STEP,
                 PropertyNames.PROPERTY_TABINDEX,
                 PropertyNames.PROPERTY_WIDTH),
-            (34, CBLOCATION_HID, True, 166,98, 2, 208, 138), self)
+            (34, AgendaWizardDialogConst.CBLOCATION_HID,
+                True, 166,98, 2, 208, 138), self)
         self.insertImage("imgHelp2", self.PROPS_IMAGE,
-            (0, 10, self.IMGHELP1_HID,
-                INFO_IMAGE_URL,
-                92, 145, False, 2, 209, 10))
+            (0, 10, "", UIConsts.INFOIMAGEURL, 92, 145, False, 2, 209, 10))
         self.insertLabel("lblHelp2", self.PROPS_TEXTAREA,
-            (39, self.resources.reslblHelp2_value, True, 104, 145, 2, 210, 199))
+            (39, self.resources.reslblHelp2_value,
+                True, 104, 145, 2, 210, 199))
 
     def buildStep3(self):
         self.insertLabel("lblTitle3", self.PROPS_LABEL_B,
             (self.fontDescriptor4, 16, self.resources.reslblTitle3_value,
                 True, 91, 8, 3, 300,212))
         self.chkMeetingTitle = self.insertCheckBox("chkMeetingTitle",
-            CHKUSEMEETINGTYPE_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKMEETINGTITLE_HID, self.resources.reschkMeetingTitle_value,
+            AgendaWizardDialogConst.CHKUSEMEETINGTYPE_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKMEETINGTITLE_HID,
+                self.resources.reschkMeetingTitle_value,
                 97, 32, 1, 3, 301, 69), self)
         self.chkRead = self.insertCheckBox("chkRead",
-            CHKUSEREAD_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKREAD_HID, self.resources.reschkRead_value,
-                97, 46, 0, 3, 302, 162), self)
+            AgendaWizardDialogConst.CHKUSEREAD_ITEM_CHANGED, self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKREAD_HID,
+                self.resources.reschkRead_value, 97, 46, 0, 3, 302, 162), self)
         self.chkBring = self.insertCheckBox("chkBring",
-            CHKUSEBRING_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKBRING_HID, self.resources.reschkBring_value,
+            AgendaWizardDialogConst.CHKUSEBRING_ITEM_CHANGED, self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKBRING_HID,
+                self.resources.reschkBring_value,
                 97, 60, 0, 3, 303, 162), self)
         self.chkNotes = self.insertCheckBox("chkNotes",
-            CHKUSENOTES_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKNOTES_HID, self.resources.reschkNotes_value,
+            AgendaWizardDialogConst.CHKUSENOTES_ITEM_CHANGED, self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKNOTES_HID,
+                self.resources.reschkNotes_value,
                 97, 74, 1, 3, 304, 160), self)
         self.insertImage("imgHelp3", self.PROPS_IMAGE, (0, 10,
-            self.IMGHELP1_HID, INFO_IMAGE_URL,
-                92, 145, False, 3, 305, 10))
+            "", UIConsts.INFOIMAGEURL, 92, 145, False, 3, 305, 10))
         self.insertLabel("lblHelp3", self.PROPS_TEXTAREA,
             (39, self.resources.reslblHelp3_value, True,104, 145, 3, 306, 199))
 
@@ -227,35 +237,49 @@ class AgendaWizardDialog(WizardDialog):
             (self.fontDescriptor4, 16, self.resources.reslblTitle5_value,
                 True, 91, 8, 4, 400, 212))
         self.chkConvenedBy = self.insertCheckBox("chkConvenedBy",
-            CHKUSECALLEDBYNAME_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKCONVENEDBY_HID, self.resources.reschkConvenedBy_value,
+            AgendaWizardDialogConst.CHKUSECALLEDBYNAME_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKCONVENEDBY_HID,
+                self.resources.reschkConvenedBy_value,
                 97, 32, 1, 4, 401, 150), self)
         self.chkPresiding = self.insertCheckBox("chkPresiding",
-            CHKUSEFACILITATOR_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKPRESIDING_HID, self.resources.reschkPresiding_value,
+            AgendaWizardDialogConst.CHKUSEFACILITATOR_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKPRESIDING_HID,
+                self.resources.reschkPresiding_value,
                 97, 46, 0, 4, 402, 150), self)
         self.chkNoteTaker = self.insertCheckBox("chkNoteTaker",
-            CHKUSENOTETAKER_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKNOTETAKER_HID, self.resources.reschkNoteTaker_value,
+            AgendaWizardDialogConst.CHKUSENOTETAKER_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKNOTETAKER_HID,
+                self.resources.reschkNoteTaker_value,
                 97, 60, 0, 4, 403, 150), self)
         self.chkTimekeeper = self.insertCheckBox("chkTimekeeper",
-            CHKUSETIMEKEEPER_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKTIMEKEEPER_HID, self.resources.reschkTimekeeper_value,
+            AgendaWizardDialogConst.CHKUSETIMEKEEPER_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKTIMEKEEPER_HID,
+                self.resources.reschkTimekeeper_value,
                 97, 74, 0, 4, 404, 150), self)
         self.chkAttendees = self.insertCheckBox("chkAttendees",
-            CHKUSEATTENDEES_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKATTENDEES_HID, self.resources.reschkAttendees_value,
+            AgendaWizardDialogConst.CHKUSEATTENDEES_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKATTENDEES_HID,
+                self.resources.reschkAttendees_value,
                 97, 88, 1, 4, 405, 150), self)
         self.chkObservers = self.insertCheckBox("chkObservers",
-            CHKUSEOBSERVERS_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKOBSERVERS_HID, self.resources.reschkObservers_value,
+            AgendaWizardDialogConst.CHKUSEOBSERVERS_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKOBSERVERS_HID,
+                self.resources.reschkObservers_value,
                 97, 102, 0, 4, 406, 150), self)
         self.chkResourcePersons = self.insertCheckBox("chkResourcePersons",
-            CHKUSERESOURCEPERSONS_ITEM_CHANGED, self.PROPS_CHECK,
-            (8, CHKRESOURCEPERSONS_HID, self.resources.reschkResourcePersons_value,
+            AgendaWizardDialogConst.CHKUSERESOURCEPERSONS_ITEM_CHANGED,
+            self.PROPS_CHECK,
+            (8, AgendaWizardDialogConst.CHKRESOURCEPERSONS_HID,
+                self.resources.reschkResourcePersons_value,
                 97, 116, 0, 4, 407, 150), self)
         self.insertImage("imgHelp4", self.PROPS_IMAGE,
-            (0, 10, self.IMGHELP1_HID, INFO_IMAGE_URL,
+            (0, 10, "", UIConsts.INFOIMAGEURL,
                 92, 145, False, 4, 408, 10))
         self.insertLabel("lblHelp4", self.PROPS_TEXTAREA,
             (39, self.resources.reslblHelp4_value, True, 104, 145, 4, 409, 199))
@@ -270,18 +294,22 @@ class AgendaWizardDialog(WizardDialog):
             (8, self.resources.reslblResponsible_value, 195, 28, 5, 72, 502))
         self.insertLabel("lblDuration", self.PROPS_TEXT,
             (8, self.resources.reslblDuration_value, 267, 28, 5, 73, 503))
-        self.btnInsert = self.insertButton("btnInsert", BTNINSERT_ACTION_PERFORMED,
-            self.PROPS_BUTTON, (14, BTNINSERT_HID,
+        self.btnInsert = self.insertButton("btnInsert",
+            AgendaWizardDialogConst.BTNINSERT_ACTION_PERFORMED,
+            self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNINSERT_HID,
                 self.resources.resButtonInsert, 92, 136, 5, 580, 40), self)
-        self.btnRemove = self.insertButton("btnRemove", BTNREMOVE_ACTION_PERFORMED,
-                self.PROPS_BUTTON, (14, BTNREMOVE_HID,
-                    self.resources.resButtonRemove, 134, 136, 5, 581, 40), self)
-        self.btnUp = self.insertButton("btnUp", BTNUP_ACTION_PERFORMED,
-                self.PROPS_BUTTON, (14, BTNUP_HID,
-                    self.resources.resButtonUp, 202, 136, 5, 582, 50), self)
-        self.btnDown = self.insertButton("btnDown", BTNDOWN_ACTION_PERFORMED,
-                self.PROPS_BUTTON, (14, BTNDOWN_HID,
-                    self.resources.resButtonDown, 254, 136, 5, 583, 50), self)
+        self.btnRemove = self.insertButton("btnRemove",
+            AgendaWizardDialogConst.BTNREMOVE_ACTION_PERFORMED,
+            self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNREMOVE_HID,
+                self.resources.resButtonRemove, 134, 136, 5, 581, 40), self)
+        self.btnUp = self.insertButton("btnUp",
+            AgendaWizardDialogConst.BTNUP_ACTION_PERFORMED,
+            self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNUP_HID,
+                self.resources.resButtonUp, 202, 136, 5, 582, 50), self)
+        self.btnDown = self.insertButton("btnDown",
+            AgendaWizardDialogConst.BTNDOWN_ACTION_PERFORMED,
+            self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNDOWN_HID,
+                self.resources.resButtonDown, 254, 136, 5, 583, 50), self)
 
     def buildStep6(self):
         self.insertLabel("lblTitle6", self.PROPS_LABEL_B,
@@ -294,18 +322,21 @@ class AgendaWizardDialog(WizardDialog):
             (8, self.resources.reslblTemplateName_value,
                 97, 62, 6, 602, 101))
         self.txtTemplateName = self.insertTextField("txtTemplateName",
-            TXTTEMPLATENAME_TEXT_CHANGED, self.PROPS_X,
-            (12, TXTTEMPLATENAME_HID, 202, 60, 6, 603, 100), self)
+            AgendaWizardDialogConst.TXTTEMPLATENAME_TEXT_CHANGED,
+            self.PROPS_X,
+            (12, AgendaWizardDialogConst.TXTTEMPLATENAME_HID,
+                202, 60, 6, 603, 100), self)
         self.insertLabel("lblProceed", self.PROPS_TEXT,
             (8, self.resources.reslblProceed_value, 97, 101, 6, 607,204))
         self.optCreateAgenda = self.insertRadioButton("optCreateAgenda", None,
-            self.PROPS_CHECK, (8, OPTCREATEAGENDA_HID,
+            self.PROPS_CHECK, (8, AgendaWizardDialogConst.OPTCREATEAGENDA_HID,
                 self.resources.resoptCreateAgenda_value,
                 103, 113, 1, 6, 608, 198), self)
         self.optMakeChanges = self.insertRadioButton("optMakeChanges", None,
-            self.PROPS_BUTTON, (8, OPTMAKECHANGES_HID,
-                self.resources.resoptMakeChanges_value, 103, 125, 6, 609, 198), self)
-        self.insertImage("imgHelp6", self.PROPS_IMAGE, (0, 10, self.IMGHELP1_HID,
-            INFO_IMAGE_URL, 92, 145, False, 6, 610, 10))
+            self.PROPS_BUTTON, (8, AgendaWizardDialogConst.OPTMAKECHANGES_HID,
+                self.resources.resoptMakeChanges_value,
+                103, 125, 6, 609, 198), self)
+        self.insertImage("imgHelp6", self.PROPS_IMAGE, (0, 10, "",
+            UIConsts.INFOIMAGEURL, 92, 145, False, 6, 610, 10))
         self.insertLabel("lblHelp6", self.PROPS_TEXTAREA,
             (39, self.resources.reslblHelp6_value, True, 104, 145, 6, 611, 199))
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.py
index d97ddf9..4e8e7cb 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogConst.py
@@ -17,64 +17,62 @@
 #
 from wizards.common.HelpIds import HelpIds
 
-TXTTITLE_TEXT_CHANGED = "txtTitleTextChanged"
-TXTDATE_TEXT_CHANGED = "txtDateTextChanged"
-TXTTIME_TEXT_CHANGED = "txtTimeTextChanged"
-TXTLOCATION_TEXT_CHANGED = "txtLocationTextChanged"
-CHKMINUTES_ITEM_CHANGED = "chkMinutesItemChanged"
-CHKUSEMEETINGTYPE_ITEM_CHANGED = "chkUseMeetingTypeItemChanged"
-CHKUSEREAD_ITEM_CHANGED = "chkUseReadItemChanged"
-CHKUSEBRING_ITEM_CHANGED = "chkUseBringItemChanged"
-CHKUSENOTES_ITEM_CHANGED = "chkUseNotesItemChanged"
-CHKUSECALLEDBYNAME_ITEM_CHANGED = "chkUseCalledByItemChanged"
-CHKUSEFACILITATOR_ITEM_CHANGED = "chkUseFacilitatorItemChanged"
-CHKUSENOTETAKER_ITEM_CHANGED = "chkUseNoteTakerItemChanged"
-CHKUSETIMEKEEPER_ITEM_CHANGED = "chkUseTimeKeeperItemChanged"
-CHKUSEATTENDEES_ITEM_CHANGED = "chkUseAttendeesItemChanged"
-CHKUSEOBSERVERS_ITEM_CHANGED = "chkUseObserversItemChanged"
-CHKUSERESOURCEPERSONS_ITEM_CHANGED = "chkUseResourcePersonsItemChanged"
-LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged"
-TXTTEMPLATENAME_TEXT_CHANGED = "templateTitleChanged"
-BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs"
-BTNINSERT_ACTION_PERFORMED = "insertRow"
-BTNREMOVE_ACTION_PERFORMED = "removeRow"
-BTNUP_ACTION_PERFORMED = "rowUp"
-BTNDOWN_ACTION_PERFORMED = "rowDown"
-
-INFO_IMAGE_URL = "private:resource/dbu/image/19205"
-
 HID = 41051
 
-LISTPAGEDESIGN_HID =      HelpIds.getHelpIdString(HID + 6)
-CHKMINUTES_HID =          HelpIds.getHelpIdString(HID + 7)
-TXTTIME_HID =             HelpIds.getHelpIdString(HID + 8)
-TXTDATE_HID =             HelpIds.getHelpIdString(HID + 9)
-TXTTITLE_HID =            HelpIds.getHelpIdString(HID + 10)
-CBLOCATION_HID =          HelpIds.getHelpIdString(HID + 11)
+class AgendaWizardDialogConst:
+    
+    TXTTITLE_TEXT_CHANGED = "txtTitleTextChanged"
+    TXTDATE_TEXT_CHANGED = "txtDateTextChanged"
+    TXTTIME_TEXT_CHANGED = "txtTimeTextChanged"
+    TXTLOCATION_TEXT_CHANGED = "txtLocationTextChanged"
+    CHKMINUTES_ITEM_CHANGED = "chkMinutesItemChanged"
+    CHKUSEMEETINGTYPE_ITEM_CHANGED = "chkUseMeetingTypeItemChanged"
+    CHKUSEREAD_ITEM_CHANGED = "chkUseReadItemChanged"
+    CHKUSEBRING_ITEM_CHANGED = "chkUseBringItemChanged"
+    CHKUSENOTES_ITEM_CHANGED = "chkUseNotesItemChanged"
+    CHKUSECALLEDBYNAME_ITEM_CHANGED = "chkUseCalledByItemChanged"
+    CHKUSEFACILITATOR_ITEM_CHANGED = "chkUseFacilitatorItemChanged"
+    CHKUSENOTETAKER_ITEM_CHANGED = "chkUseNoteTakerItemChanged"
+    CHKUSETIMEKEEPER_ITEM_CHANGED = "chkUseTimeKeeperItemChanged"
+    CHKUSEATTENDEES_ITEM_CHANGED = "chkUseAttendeesItemChanged"
+    CHKUSEOBSERVERS_ITEM_CHANGED = "chkUseObserversItemChanged"
+    CHKUSERESOURCEPERSONS_ITEM_CHANGED = "chkUseResourcePersonsItemChanged"
+    LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged"
+    TXTTEMPLATENAME_TEXT_CHANGED = "templateTitleChanged"
+    BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs"
+    BTNINSERT_ACTION_PERFORMED = "insertRow"
+    BTNREMOVE_ACTION_PERFORMED = "removeRow"
+    BTNUP_ACTION_PERFORMED = "rowUp"
+    BTNDOWN_ACTION_PERFORMED = "rowDown"
 
-CHKMEETINGTITLE_HID =     HelpIds.getHelpIdString(HID + 12)
-CHKREAD_HID =             HelpIds.getHelpIdString(HID + 13)
-CHKBRING_HID =            HelpIds.getHelpIdString(HID + 14)
-CHKNOTES_HID =            HelpIds.getHelpIdString(HID + 15)
+    LISTPAGEDESIGN_HID =      HelpIds.getHelpIdString(HID + 6)
+    CHKMINUTES_HID =          HelpIds.getHelpIdString(HID + 7)
+    TXTTIME_HID =             HelpIds.getHelpIdString(HID + 8)
+    TXTDATE_HID =             HelpIds.getHelpIdString(HID + 9)
+    TXTTITLE_HID =            HelpIds.getHelpIdString(HID + 10)
+    CBLOCATION_HID =          HelpIds.getHelpIdString(HID + 11)
 
-CHKCONVENEDBY_HID =       HelpIds.getHelpIdString(HID + 16)
-CHKPRESIDING_HID =        HelpIds.getHelpIdString(HID + 17)
-CHKNOTETAKER_HID =        HelpIds.getHelpIdString(HID + 18)
-CHKTIMEKEEPER_HID =       HelpIds.getHelpIdString(HID + 19)
-CHKATTENDEES_HID =        HelpIds.getHelpIdString(HID + 20)
-CHKOBSERVERS_HID =        HelpIds.getHelpIdString(HID + 21)
-CHKRESOURCEPERSONS_HID =  HelpIds.getHelpIdString(HID + 22)
+    CHKMEETINGTITLE_HID =     HelpIds.getHelpIdString(HID + 12)
+    CHKREAD_HID =             HelpIds.getHelpIdString(HID + 13)
+    CHKBRING_HID =            HelpIds.getHelpIdString(HID + 14)
+    CHKNOTES_HID =            HelpIds.getHelpIdString(HID + 15)
 
-TXTTEMPLATENAME_HID =     HelpIds.getHelpIdString(HID + 23)
-TXTTEMPLATEPATH_HID =     HelpIds.getHelpIdString(HID + 24)
-BTNTEMPLATEPATH_HID =     HelpIds.getHelpIdString(HID + 25)
+    CHKCONVENEDBY_HID =       HelpIds.getHelpIdString(HID + 16)
+    CHKPRESIDING_HID =        HelpIds.getHelpIdString(HID + 17)
+    CHKNOTETAKER_HID =        HelpIds.getHelpIdString(HID + 18)
+    CHKTIMEKEEPER_HID =       HelpIds.getHelpIdString(HID + 19)
+    CHKATTENDEES_HID =        HelpIds.getHelpIdString(HID + 20)
+    CHKOBSERVERS_HID =        HelpIds.getHelpIdString(HID + 21)
+    CHKRESOURCEPERSONS_HID =  HelpIds.getHelpIdString(HID + 22)
 
-OPTCREATEAGENDA_HID =     HelpIds.getHelpIdString(HID + 26)
-OPTMAKECHANGES_HID =      HelpIds.getHelpIdString(HID + 27)
+    TXTTEMPLATENAME_HID =     HelpIds.getHelpIdString(HID + 23)
+    TXTTEMPLATEPATH_HID =     HelpIds.getHelpIdString(HID + 24)
+    BTNTEMPLATEPATH_HID =     HelpIds.getHelpIdString(HID + 25)
 
-BTNINSERT_HID =           HelpIds.getHelpIdString(HID + 28)
-BTNREMOVE_HID =           HelpIds.getHelpIdString(HID + 29)
-BTNUP_HID =               HelpIds.getHelpIdString(HID + 30)
-BTNDOWN_HID =             HelpIds.getHelpIdString(HID + 31)
+    OPTCREATEAGENDA_HID =     HelpIds.getHelpIdString(HID + 26)
+    OPTMAKECHANGES_HID =      HelpIds.getHelpIdString(HID + 27)
 
-LAST_HID = HID + 32
+    BTNINSERT_HID =           HelpIds.getHelpIdString(HID + 28)
+    BTNREMOVE_HID =           HelpIds.getHelpIdString(HID + 29)
+    BTNUP_HID =               HelpIds.getHelpIdString(HID + 30)
+    BTNDOWN_HID =             HelpIds.getHelpIdString(HID + 31)
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
index 8420680..73e47c4 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
@@ -15,14 +15,19 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from AgendaWizardDialog import *
-from AgendaTemplate import *
+import traceback
+from .AgendaWizardDialog import AgendaWizardDialog
+from .AgendaWizardDialogConst import HID
+from .AgendaTemplate import AgendaTemplate, TopicsControl, FileAccess
 from CGAgenda import CGAgenda
-from wizards.ui.PathSelection import PathSelection
-from wizards.ui.event.UnoDataAware import UnoDataAware
-from wizards.ui.event.RadioDataAware import RadioDataAware
-from wizards.common.NoValidPathException import NoValidPathException
-from wizards.common.SystemDialog import SystemDialog
+from ..ui.PathSelection import PathSelection
+from ..ui.event.UnoDataAware import UnoDataAware
+from ..ui.event.RadioDataAware import RadioDataAware
+from ..common.NoValidPathException import NoValidPathException
+from ..common.SystemDialog import SystemDialog
+from ..common.Desktop import Desktop
+from ..common.HelpIds import HelpIds
+from ..common.Configuration import Configuration
 
 from com.sun.star.view.DocumentZoomType import OPTIMAL
 from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
@@ -43,31 +48,20 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
     def leaveStep(self, OldStep, NewStep):
         pass
 
-    '''
-    used in developement to start the wizard
-    '''
 
     @classmethod
-    def main(self, args):
-        ConnectStr = \
-            "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
+    def main(self):
+        #Call the wizard remotely(see README)
         try:
+            ConnectStr = \
+                "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
             xLocMSF = Desktop.connect(ConnectStr)
-            wizard = AgendaWizardDialogImpl(xLocMSF)
-            wizard.startWizard()
-        except Exception, exception:
-            traceback.print_exc()
-
-    '''
-    read the configuration data, open the specified template,
-    initialize the template controller (AgendaTemplate) and
-    set the status of the displayed template to the one
-    read from the configuration.
-    build the dialog.
-    Synchronize the dialog to the same status (read from
-    the configuration).
-    show the dialog.
-    '''
+            lw = AgendaWizardDialogImpl(xLocMSF)
+            lw.startWizard()
+        except Exception as e:
+            print ("Wizard failure exception " + str(type(e)) +
+                   " message " + str(e) + " args " + str(e.args) +
+                   traceback.format_exc())
 
     def startWizard(self):
         self.running = True
@@ -134,8 +128,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
         self.myPathSelection.sDefaultDirectory = self.sUserTemplatePath
         self.myPathSelection.sDefaultName = "myAgendaTemplate.ott"
         self.myPathSelection.sDefaultFilter = "writer8_template"
-        self.myPathSelection.addSelectionListener(
-            self.myPathSelectionListener())
+        self.myPathSelection.addSelectionListener(self)
 
     def initializePaths(self):
         try:
@@ -173,7 +166,8 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
         self.agenda.readConfiguration(root, "cp_")
 
         self.setControlProperty(
-            "listPageDesign", "StringItemList", tuple(self.agendaTemplates[0]))
+            "listPageDesign", "StringItemList",
+            tuple(self.agendaTemplates.keys()))
         self.checkSavePath()
         UnoDataAware.attachListBox(
             self.agenda, "cp_AgendaType", self.listPageDesign, True).updateUI()
@@ -271,7 +265,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
             if AgendaWizardDialogImpl.pageDesign is not SelectedItemPos:
                 AgendaWizardDialogImpl.pageDesign = SelectedItemPos
                 self.agendaTemplate.load(
-                    self.agendaTemplates[1][SelectedItemPos],
+                    self.agendaTemplates.values()[SelectedItemPos],
                     self.topicsControl.scrollfields)
         except Exception:
             traceback.print_exc()
@@ -422,7 +416,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
                 if fileAccess.exists(self.sPath, True):
                     answer = SystemDialog.showMessageBox(
                         self.xMSF, "MessBox", YES_NO + DEF_NO,
-                        self.resources.resFileExists,
+                        self.resources.resOverwriteWarning,
                         self.xUnoDialog.Peer)
                     if answer == 3:
                         # user said: no, do not overwrite
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
index f8b9971..8ddc3ab 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogResources.py
@@ -166,5 +166,5 @@ class AgendaWizardDialogResources(Resource):
         self.resButtonDown = self.getResText(
             AgendaWizardDialogResources.RID_AGENDAWIZARDDIALOG_START + 71)
 
-        self.resFileExists = self.getResText(
+        self.resOverwriteWarning = self.getResText(
             AgendaWizardDialogResources.RID_COMMON_START + 19)
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
index 5e996ea..9a18ec7 100644
--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py
+++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
@@ -16,11 +16,12 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 from threading import RLock
-from CGTopic import CGTopic
-from wizards.ui.ControlScroller import *
-from AgendaWizardDialogConst import LAST_HID
-from wizards.common.Properties import Properties
-from wizards.ui.event.CommonListener import FocusListenerProcAdapter, KeyListenerProcAdapter
+from .CGTopic import CGTopic
+from ..ui.ControlScroller import *
+from .AgendaWizardDialogConst import HID
+from ..common.Properties import Properties
+from ..ui.event.CommonListener import FocusListenerProcAdapter, \
+    KeyListenerProcAdapter
 
 from com.sun.star.awt.Key import DOWN, UP, TAB
 from com.sun.star.awt.KeyModifier import SHIFT, MOD1
@@ -115,7 +116,7 @@ class TopicsControl(ControlScroller):
     def __init__(self, dialog, xmsf, agenda):
         try:
             super(TopicsControl, self).__init__(
-                dialog, xmsf, 5, 92, 38, 212, 5, 18, LAST_HID)
+                dialog, xmsf, 5, 92, 38, 212, 5, 18, HID + 32)
             self.initializeScrollFields(agenda)
             # set some focus listeners for TAB scroll down and up...
             # prepare scroll down on tab press...
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py
index 0364a0d..49acdeb 100644
--- a/wizards/com/sun/star/wizards/common/FileAccess.py
+++ b/wizards/com/sun/star/wizards/common/FileAccess.py
@@ -307,7 +307,7 @@ class FileAccess(object):
             return False
 
     @classmethod
-    def getFolderTitles(self, xMSF, FilterName, FolderName, resDict):
+    def getFolderTitles(self, xMSF, FilterName, FolderName, resDict=None):
         #Returns and ordered dict containing the template's name and path
         
         LocLayoutFiles = {}
@@ -326,11 +326,14 @@ class FileAccess(object):
                 fileName = self.getFilename(i)
                 if FilterName is None or fileName.startswith(FilterName):
                     xDocInterface.loadFromMedium(i, tuple())
-                    if xDocInterface.Title in resDict:
-                        # localise string at runtime
-                        title = resDict[xDocInterface.Title]
-                    else:
+                    if resDict is None:
                         title = xDocInterface.Title
+                    else:
+                        if xDocInterface.Title in resDict:
+                            # localise string at runtime
+                            title = resDict[xDocInterface.Title]
+                        else:
+                            title = xDocInterface.Title
                     LocLayoutFiles[title] = i
 
         except Exception, exception:
diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.py b/wizards/com/sun/star/wizards/ui/UnoDialog2.py
index 9f7f103..aae0414 100644
--- a/wizards/com/sun/star/wizards/ui/UnoDialog2.py
+++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.py
@@ -20,7 +20,8 @@ from .UIConsts import UIConsts
 from ..common.Desktop import Desktop
 from ..common.PropertyNames import PropertyNames
 from .event.CommonListener import ItemListenerProcAdapter, \
-    ActionListenerProcAdapter, TextListenerProcAdapter
+    ActionListenerProcAdapter, TextListenerProcAdapter, \
+    AdjustmentListenerProcAdapter
 
 '''
 This class contains convenience methods for inserting components to a dialog.
commit 02dd4619b20d53158f6a48f30ceb299a029883eb
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun Oct 28 21:06:39 2012 +0100

    pyagenda: Remove duplicate code
    
    Change-Id: Ic839031a50c4bd84efaebe89dbbe975bf81db789

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
index 56b8523..271aa24 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
@@ -377,28 +377,6 @@ class AgendaTemplate(TextDocument):
             i += 1
 
     '''
-    searches the document for items in the format ">*<"
-    @return a vector containing the XTextRanges of the found items
-    '''
-
-    def searchFillInItems(self):
-        try:
-            sd = AgendaTemplate.document.createSearchDescriptor()
-            sd.setSearchString("<[^>]+>")
-            sd.setPropertyValue("SearchRegularExpression", True)
-            sd.setPropertyValue("SearchWords", True)
-            ia = AgendaTemplate.document.findAll(sd)
-            try:
-                l = [ia.getByIndex(i) for i in xrange(ia.Count)]
-            except Exception, ex:
-                print "Nonfatal Error in finding fillins."
-            return l
-        except Exception, ex:
-            traceback.print_exc()
-            raise AttributeError (
-                "Fatal Error: Loading template failed: searching fillins failed")
-
-    '''
     analyze the item sections in the template.
     delegates the analyze of each table to the ItemsTable class.
     '''
@@ -535,7 +513,7 @@ class AgendaTemplate(TextDocument):
             try:
                 topicStartTime = int(AgendaTemplate.agenda.cp_Time)
                 #first I replace the minutes titles...
-                AgendaTemplate.items = self.searchFillInItems()
+                AgendaTemplate.items = TextDocument.searchFillInItems()
                 itemIndex = 0
                 for item in self.items:
                     itemText = item.String.lstrip().lower()
@@ -566,7 +544,7 @@ class AgendaTemplate(TextDocument):
 
                 for i in xrange(len(topicsData) - 1):
                     topic = topicsData[i]
-                    AgendaTemplate.items = self.searchFillInItems()
+                    AgendaTemplate.items = TextDocument.searchFillInItems()
                     itemIndex = 0
                     for item in self.items:
                         itemText = item.String.lstrip().lower()
commit 6fa0930ed4208e6fb13bc986616ad7441bbd4bd1
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun Oct 28 20:54:50 2012 +0100

    pyletter: Translate the templates at runtime
    
    Change-Id: Ie0b149b4a8928e5b61153a6ed62b66d02f916f20

diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index 7bfbfba..70993e1 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
@@ -232,7 +232,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
 
     def drawConstants(self):
         '''Localise the template'''
-        constRangeList = self.searchFillInItems(1)
+        constRangeList = TextDocument.searchFillInItems(1)
         
         for i in xrange(constRangeList.Count):
             item = constRangeList.getByIndex(i)
@@ -241,19 +241,6 @@ class FaxWizardDialogImpl(FaxWizardDialog):
                 "hint", self.xMSF)
             aux.write()
             
-    def searchFillInItems(self, typeSearch):
-        sd = TextDocument.xTextDocument.createSearchDescriptor()
-        
-        if typeSearch == 0:
-            sd.setSearchString("<[^>]+>")
-        elif typeSearch == 1:
-            sd.setSearchString("#[^#]+#")
-            
-        sd.setPropertyValue("SearchRegularExpression", True)
-        sd.setPropertyValue("SearchWords", True)
-        
-        return TextDocument.xTextDocument.findAll(sd)
-
     def insertRoadmap(self):
         self.addRoadmap()
         self.insertRoadMapItems(
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py
index 7cf3703..a02835a 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py
@@ -25,15 +25,6 @@ class FaxWizardDialogResources(Resource):
     RID_FAXWIZARDSALUTATION_START = 3290
     RID_FAXWIZARDROADMAP_START = 3300
     RID_RID_COMMON_START = 500
-    
-    resToPlaceHolder = "#to#"
-    resFromPlaceHolder = "#from#"
-    resFaxconstPlaceHolder = "#faxconst#"
-    resTelconstPlaceHolder = "#telconst#"
-    resEmailconstPlaceHolder = "#emailconst#"
-    resConsist1PlaceHolder = "#consist1#"
-    resConsist2PlaceHolder = "#consist2#"
-    resConsist3PlaceHolder = "#consist3#"
 
     def __init__(self, xmsf):
         super(FaxWizardDialogResources,self).__init__(xmsf,
@@ -121,24 +112,24 @@ class FaxWizardDialogResources(Resource):
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 39)
         self.resLabel2_value = self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 40)
-            
+    
         #Create a Dictionary for the constants values.
         self.dictConstants = {
-        FaxWizardDialogResources.resToPlaceHolder : self.getResText(
+        "#to#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 41),
-        FaxWizardDialogResources.resFromPlaceHolder : self.getResText(
+        "#from#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 42),
-        FaxWizardDialogResources.resFaxconstPlaceHolder : self.getResText(
+        "#faxconst#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 43),
-        FaxWizardDialogResources.resTelconstPlaceHolder : self.getResText(
+        "#telconst#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 44),
-        FaxWizardDialogResources.resEmailconstPlaceHolder : self.getResText(
+        "#emailconst#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 45),
-        FaxWizardDialogResources.resConsist1PlaceHolder : self.getResText(
+        "#consist1#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 46),
-        FaxWizardDialogResources.resConsist2PlaceHolder : self.getResText(
+        "#consist2#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 47),
-        FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText(
+        "#consist3#" : self.getResText(
             FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 48)}
 
         #Create a dictionary for localising the private template
diff --git a/wizards/com/sun/star/wizards/letter/CGLetter.py b/wizards/com/sun/star/wizards/letter/CGLetter.py
index abed250..cf9bd76 100644
--- a/wizards/com/sun/star/wizards/letter/CGLetter.py
+++ b/wizards/com/sun/star/wizards/letter/CGLetter.py
@@ -28,7 +28,6 @@ class CGLetter(ConfigGroup):
         self.cp_PaperCompanyAddressReceiverField = bool()
         self.cp_PaperFooter = bool()
         self.cp_PaperFooterHeight = float()
-        self.cp_Norm = int()
         self.cp_PrintCompanyLogo = bool()
         self.cp_PrintCompanyAddressReceiverField = bool()
         self.cp_PrintLetterSigns = bool()
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 4f91d37..bfdd667 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -25,6 +25,7 @@ from ..common.FileAccess import FileAccess
 from ..common.Configuration import Configuration
 from ..common.SystemDialog import SystemDialog
 from ..common.Desktop import Desktop
+from ..common.TextElement import TextElement
 from ..ui.PathSelection import PathSelection
 from ..ui.event.UnoDataAware import UnoDataAware
 from ..ui.event.RadioDataAware import RadioDataAware
@@ -386,6 +387,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
             self.initializeElements()
             self.chkBusinessPaperItemChanged()
             self.setElements(False)
+            self.drawConstants()
             
     def lstPrivOfficialStyleItemChanged(self):
         selectedItemPos = self.lstPrivOfficialStyle.SelectedItemPos
@@ -397,6 +399,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
             self.initializeElements()
             self.setPossibleSenderData(True)
             self.setElements(False)
+            self.drawConstants()
 
     def lstPrivateStyleItemChanged(self):
         selectedItemPos = self.lstPrivateStyle.SelectedItemPos
@@ -981,7 +984,18 @@ class LetterWizardDialogImpl(LetterWizardDialog):
 
         if self.optMakeChanges.State:
             self.optMakeChangesItemChanged()
-
+            
+    def drawConstants(self):
+        '''Localise the template'''
+        constRangeList = TextDocument.searchFillInItems(1)
+        
+        for i in xrange(constRangeList.Count):
+            item = constRangeList.getByIndex(i)
+            text = item.String.lower()
+            aux = TextElement(item, self.resources.dictConstants[text],
+                "hint", self.xMSF)
+            aux.write()
+            
     def insertRoadmap(self):
         self.addRoadmap()
 
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
index 8e0a016..64b45f7 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
@@ -208,6 +208,11 @@ class LetterWizardDialogResources(Resource):
         self.reslblTitle6_value = \
             self.getResText(
                 LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 58)
+                
+        #Create a Dictionary for the constants values.
+        self.dictConstants = {
+        "#subjectconst#" : self.getResText(
+            LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 59)}
 
         #Create a dictionary for localising the bussiness templates
         self.dictBusinessTemplate = {
diff --git a/wizards/com/sun/star/wizards/text/TextDocument.py b/wizards/com/sun/star/wizards/text/TextDocument.py
index df0de96..0198d6d 100644
--- a/wizards/com/sun/star/wizards/text/TextDocument.py
+++ b/wizards/com/sun/star/wizards/text/TextDocument.py
@@ -34,13 +34,12 @@ from com.sun.star.beans.PropertyState import DIRECT_VALUE
 
 class TextDocument(object):
 
-    xTextDocument = None
-
     def __init__(self, xMSF,listener=None,bShowStatusIndicator=None,
         FrameName=None,_sPreviewURL=None,_moduleIdentifier=None,
         _textDocument=None, xArgs=None):
 
         self.xMSF = xMSF
+        self.xTextDocument = None
 
         if listener is not None:
             if FrameName is not None:
@@ -55,19 +54,19 @@ class TextDocument(object):
                 '''creates an instance of TextDocument by
                 loading a given URL as preview'''
                 self.xFrame = OfficeDocument.createNewFrame(xMSF, listener)
-                TextDocument.xTextDocument = self.loadAsPreview(_sPreviewURL, True)
+                self.xTextDocument = self.loadAsPreview(_sPreviewURL, True)
 
             elif xArgs is not None:
                 '''creates an instance of TextDocument
                 and creates a frame and loads a document'''
                 self.xDesktop = Desktop.getDesktop(xMSF);
                 self.xFrame = OfficeDocument.createNewFrame(xMSF, listener)
-                TextDocument.xTextDocument = OfficeDocument.load(
+                self.xTextDocument = OfficeDocument.load(
                     xFrame, URL, "_self", xArgs);
                 self.xWindowPeer = xFrame.getComponentWindow()
-                self.m_xDocProps = TextDocument.xTextDocument.DocumentProperties
+                self.m_xDocProps = self.xTextDocument.DocumentProperties
                 CharLocale = Helper.getUnoStructValue(
-                    TextDocument.xTextDocument, "CharLocale");
+                    self.xTextDocument, "CharLocale");
                 return
 
             else:
@@ -75,27 +74,27 @@ class TextDocument(object):
                 the desktop's current frame'''
                 self.xDesktop = Desktop.getDesktop(xMSF);
                 self.xFrame = self.xDesktop.getActiveFrame()
-                TextDocument.xTextDocument = self.xFrame.getController().Model
+                self.xTextDocument = self.xFrame.getController().Model
 
         elif _moduleIdentifier is not None:
             try:
                 '''create the empty document, and set its module identifier'''
-                TextDocument.xTextDocument = xMSF.createInstance(
+                self.xTextDocument = xMSF.createInstance(
                     "com.sun.star.text.TextDocument")
-                TextDocument.xTextDocument.initNew()
-                TextDocument.xTextDocument.setIdentifier(
+                self.xTextDocument.initNew()
+                self.xTextDocument.setIdentifier(
                     _moduleIdentifier.Identifier)
                 # load the document into a blank frame
                 xDesktop = Desktop.getDesktop(xMSF)
                 loadArgs = range(1)
                 loadArgs[0] = "Model"
                 loadArgs[0] = -1
-                loadArgs[0] = TextDocument.xTextDocument
+                loadArgs[0] = self.xTextDocument
                 loadArgs[0] = DIRECT_VALUE
                 xDesktop.loadComponentFromURL(
                     "private:object", "_blank", 0, loadArgs)
                 # remember some things for later usage
-                self.xFrame = TextDocument.xTextDocument.CurrentController.Frame
+                self.xFrame = self.xTextDocument.CurrentController.Frame
             except Exception, e:
                 traceback.print_exc()
 
@@ -103,17 +102,17 @@ class TextDocument(object):
             '''creates an instance of TextDocument
             from a given XTextDocument'''
             self.xFrame = _textDocument.CurrentController.Frame
-            TextDocument.xTextDocument = _textDocument
+            self.xTextDocument = _textDocument
         if bShowStatusIndicator:
             self.showStatusIndicator()
         self.init()
 
     def init(self):
         self.xWindowPeer = self.xFrame.getComponentWindow()
-        self.m_xDocProps = TextDocument.xTextDocument.DocumentProperties
+        self.m_xDocProps = self.xTextDocument.DocumentProperties
         self.CharLocale = Helper.getUnoStructValue(
-            TextDocument.xTextDocument, "CharLocale")
-        self.xText = TextDocument.xTextDocument.Text
+            self.xTextDocument, "CharLocale")
+        self.xText = self.xTextDocument.Text
 
     def showStatusIndicator(self):
         self.xProgressBar = self.xFrame.createStatusIndicator()
@@ -140,24 +139,24 @@ class TextDocument(object):
         loadValues[2].Name = "Preview"
         loadValues[2].Value = True
 
-        TextDocument.xTextDocument = OfficeDocument.load(
+        self.xTextDocument = OfficeDocument.load(
             self.xFrame, sDefaultTemplate, "_self", loadValues)
 
         self.DocSize = self.getPageSize()
 
-        myViewHandler = ViewHandler(TextDocument.xTextDocument, TextDocument.xTextDocument)
+        myViewHandler = ViewHandler(self.xTextDocument, self.xTextDocument)
         try:
             myViewHandler.setViewSetting(
                 "ZoomType", ENTIRE_PAGE)
         except Exception, e:
             traceback.print_exc()
-        myFieldHandler = TextFieldHandler(self.xMSF, TextDocument.xTextDocument)
+        myFieldHandler = TextFieldHandler(self.xMSF, self.xTextDocument)
         myFieldHandler.updateDocInfoFields()
-        return TextDocument.xTextDocument
+        return self.xTextDocument
 
     def getPageSize(self):
         try:
-            xNameAccess = TextDocument.xTextDocument.StyleFamilies
+            xNameAccess = self.xTextDocument.StyleFamilies
             xPageStyleCollection = xNameAccess.getByName("PageStyles")
             xPageStyle = xPageStyleCollection.getByName("First Page")
             return Helper.getUnoPropertyValue(xPageStyle, "Size")
@@ -173,7 +172,7 @@ class TextDocument(object):
         return xTextCursor
 
     def refresh(self):
-        TextDocument.xTextDocument.refresh()
+        self.xTextDocument.refresh()
 
     '''
     This method sets the Author of a Wizard-generated template correctly
@@ -197,10 +196,10 @@ class TextDocument(object):
             day = time.strftime("%d", now)
 
             dateObject = dateTimeObject(int(year), int(month), int(day))
-            du = Helper.DateUtils(self.xMSF, TextDocument.xTextDocument)
+            du = Helper.DateUtils(self.xMSF, self.xTextDocument)
             ff = du.getFormat(DATE_SYS_DDMMYY)
             myDate = du.format(ff, dateObject)
-            xDocProps2 = TextDocument.xTextDocument.DocumentProperties
+            xDocProps2 = self.xTextDocument.DocumentProperties
             xDocProps2.Author = fullname
             xDocProps2.ModifiedBy = fullname
             description = xDocProps2.Description
@@ -238,3 +237,17 @@ class TextDocument(object):
             return xTD.TextFrames.getByName(sFrameName)
 
         return None
+
+    @classmethod
+    def searchFillInItems(self, typeSearch):
+        sd = self.xTextDocument.createSearchDescriptor()
+        
+        if typeSearch == 0:
+            sd.setSearchString("<[^>]+>")
+        elif typeSearch == 1:
+            sd.setSearchString("#[^#]+#")
+            
+        sd.setPropertyValue("SearchRegularExpression", True)
+        sd.setPropertyValue("SearchWords", True)
+        
+        return self.xTextDocument.findAll(sd)


More information about the Libreoffice-commits mailing list