summaryrefslogtreecommitdiff
path: root/wizards/com
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2013-02-03 20:39:49 +0100
committerXisco Fauli <anistenis@gmail.com>2013-02-03 21:45:32 +0100
commit38ca76010af700430daa348abbc31d25092ba2b2 (patch)
treed5a57a442d1da491aeee9b98aefbafb5d10df516 /wizards/com
parent3b147851a5b1d73e77223e6101bd381d40fd97bb (diff)
pyagenda: synchronize gui/preview when adding/removing topics
Change-Id: Ib25efb5c80b54b961d3df1b4443bf0ddb1ae92c9
Diffstat (limited to 'wizards/com')
-rw-r--r--wizards/com/sun/star/wizards/agenda/TopicsControl.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
index 8116b43a1762..b8a11e085134 100644
--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py
+++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
@@ -351,7 +351,7 @@ class TopicsControl(ControlScroller):
def isRowEmpty(self, row):
data = self.getTopicData(row)
# now - is this row empty?
- return data[1].Value and data[2].Value and data[3].Value
+ return data[1].Value or data[2].Value or data[3].Value
'''
update the preview document and
@@ -369,7 +369,7 @@ class TopicsControl(ControlScroller):
return
self.updateDocumentCell(
guiRow + ControlScroller.nscrollvalue, column, data)
- if self.isRowEmpty(guiRow + ControlScroller.nscrollvalue):
+ if not self.isRowEmpty(guiRow + ControlScroller.nscrollvalue):
'''
if this is the row before the last one
(the last row is always empty)
@@ -384,16 +384,17 @@ class TopicsControl(ControlScroller):
because the last one is always empty...
'''
while len(ControlScroller.scrollfields) > 1 \
- and self.isRowEmpty(len(ControlScroller.scrollfields) - 2):
+ and not self.isRowEmpty(
+ len(ControlScroller.scrollfields) - 2):
self.removeLastRow()
cr = self.ControlGroupVector[
- len(ControlScroller.scrollfields) - ControlScroller.nscrollvalue - 1]
+ len(ControlScroller.scrollfields) - \
+ ControlScroller.nscrollvalue - 1]
# if a remove was performed, set focus
#to the last row with some data in it...
- self.focus(self.getControl(cr, column))
+ self.focus(self.getControlByIndex(cr, column))
# update the preview document.
self.reduceDocumentToTopics()
-
else:
# row contains data
# is this the last row?
@@ -610,8 +611,9 @@ class TopicsControl(ControlScroller):
elif (row1 + ControlScroller.nscrollvalue) + \
(row2 + ControlScroller.nscrollvalue) \
== (len(ControlScroller.scrollfields) * 2 - 5):
- if self.isRowEmpty(len(ControlScroller.scrollfields) - 2) \
- and self.isRowEmpty(len(ControlScroller.scrollfields) - 1):
+ if not self.isRowEmpty(len(ControlScroller.scrollfields) - 2) \
+ and not self.isRowEmpty(
+ len(ControlScroller.scrollfields) - 1):
self.removeLastRow()
self.reduceDocumentToTopics()
@@ -729,6 +731,7 @@ class TopicsControl(ControlScroller):
according to the data model.
'''
+ @classmethod
def reduceDocumentToTopics(self):
try:
ControlScroller.CurUnoDialog.agendaTemplate.topics.reduceDocumentTo(