diff options
author | Xisco Fauli <anistenis@gmail.com> | 2011-07-31 15:00:41 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-18 02:57:44 +0200 |
commit | 927ba7df4028bda0f1b38698d9f85e2ca7124850 (patch) | |
tree | 4047bffa8e54dd0ca32fbc635ec9a9921a5efbc3 /wizards/com | |
parent | 85a72b6eefa97748f7364982fa9e88cf029f4f26 (diff) |
Write the agendaitems in the proper table
Diffstat (limited to 'wizards/com')
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/AgendaTemplate.py | 30 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/TopicsControl.py | 7 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ControlScroller.py | 1 |
3 files changed, 20 insertions, 18 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py index e1b3d4bf31d4..6fda41906d5e 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py @@ -691,9 +691,10 @@ class ItemsTable(object): the items in the table. ''' items = [] + table = None def __init__(self, section_, table_): - Topics.table = table_ + ItemsTable.table = table_ self.section = section_ self.items = [] ''' @@ -707,7 +708,7 @@ class ItemsTable(object): while i < len(AgendaTemplate._allItems): workwith = AgendaTemplate._allItems[i] t = Helper.getUnoPropertyValue(workwith, "TextTable") - if t == Topics.table: + if t == ItemsTable.table: iText = workwith.String.lower().lstrip() ai = AgendaTemplate.itemsCache[iText] if ai is not None: @@ -738,9 +739,9 @@ class ItemsTable(object): AgendaTemplate.textSectionHandler.breakLinkOfTextSection( self.section) # we need to get a instance after linking. - Topics.table = AgendaTemplate.getTable(name) + ItemsTable.table = AgendaTemplate.getTable(name) self.section = AgendaTemplate.getSection(name) - cursor = Topics.table.createCursorByCellName("A1") + cursor = ItemsTable.table.createCursorByCellName("A1") # should this section be visible? visible = False # write items @@ -757,7 +758,7 @@ class ItemsTable(object): for i in self.items: if AgendaTemplate.isShowItem(i.name): visible = True - i.table = Topics.table + i.table = ItemsTable.table i.write(cursor) # I store the cell name which was last written... cellName = cursor.RangeName @@ -789,7 +790,7 @@ class ItemsTable(object): while not cellName == cursor.RangeName and \ not cursor.RangeName.startswith("A"): - cell = Topics.table.getCellByName(cursor.RangeName) + cell = ItemsTable.table.getCellByName(cursor.RangeName) cell.String = "" cellName = cursor.RangeName cursor.goRight(1, False) @@ -801,7 +802,7 @@ class ItemsTable(object): return rowIndex = AgendaTemplate.getRowIndex(cursor) - rowsCount = AgendaTemplate.getRowCount(Topics.table) + rowsCount = AgendaTemplate.getRowCount(ItemsTable.table) ''' now before deleteing i move the cursor up so it does not disappear, because it will crash office. @@ -810,7 +811,7 @@ class ItemsTable(object): if rowsCount >= rowIndex: pass #COMMENTED - #removeTableRows(Topics.table, rowIndex - 1, (rowsCount - rowIndex) + 1) + #removeTableRows(table, rowIndex - 1, (rowsCount - rowIndex) + 1) ''' This class handles the preview of the topics table. @@ -1020,17 +1021,16 @@ class Topics(object): cursor = Topics.table.createCursorByCellName("A" + str(firstRow)) te = None cursorMoves = 0 - tmp_switch_var1 = what - if tmp_switch_var1 == 0: + if what == 0: te = self.setItemText(Topics.numCell, data[0].Value) cursorMoves = Topics.numCell - elif tmp_switch_var1 == 1: + elif what == 1: te = self.setItemText(Topics.topicCell, data[1].Value) cursorMoves = Topics.topicCell - elif tmp_switch_var1 == 2: + elif what == 2: te = self.setItemText(Topics.responsibleCell, data[2].Value) cursorMoves = Topics.responsibleCell - elif tmp_switch_var1 == 3: + elif what == 3: te = self.setItemText(Topics.timeCell, data[3].Value) cursorMoves = Topics.timeCell @@ -1243,13 +1243,13 @@ class AgendaItem(object): def write(self, tableCursor): cellname = tableCursor.RangeName - cell = Topics.table.getCellByName(cellname) + cell = ItemsTable.table.getCellByName(cellname) self.textElement.write(cell) tableCursor.goRight(1, False) #second field is actually always null... # this is a preparation for adding placeholders. if self.field is not None: - self.field.write(Topics.table.getCellByName( + self.field.write(ItemsTable.table.getCellByName( tableCursor.RangeName)) ''' diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index 870ced27d090..74d95d120244 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -167,6 +167,7 @@ class TopicsControl(ControlScroller): remove the last row ''' + @classmethod def removeLastRow(self): l = len(ControlScroller.scrollfields) # if we should scroll up... @@ -394,7 +395,7 @@ class TopicsControl(ControlScroller): ''' if (guiRow + TopicsControl.nscrollvalue) \ == len(ControlScroller.scrollfields) - 2: - removeLastRow() + self.removeLastRow() '''now consequentially check the last two rows, and remove the last one if they are both empty. (actually I check always the "before last" row, @@ -407,9 +408,9 @@ class TopicsControl(ControlScroller): ControlScroller.scrollfields.size - TopicsControl.nscrollvalue - 1] # if a remove was performed, set focus #to the last row with some data in it... - focus(getControl(cr, column)) + self.focus(getControl(cr, column)) # update the preview document. - reduceDocumentToTopics() + self.reduceDocumentToTopics() else: # row contains data diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index ad3406e0a234..16a34c597d64 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -224,6 +224,7 @@ class ControlScroller(object): else: return None + @classmethod def unregisterControlGroup(self, _index): del ControlScroller.scrollfields[_index] |