add more debugging on list changes
This commit is contained in:
parent
53513fe6de
commit
5f2ade7b80
|
@ -765,23 +765,23 @@ class ListStyleApply(unohelper.Base, XJobExecutor):
|
|||
props = numberingrules.getByIndex(level)
|
||||
found_bullet_char_prop = False
|
||||
found_bullet_fontname_prop = False
|
||||
log.append('style as %s' % style)
|
||||
log.append('style level %s as %s' % (level, style))
|
||||
for i, prop in enumerate(props):
|
||||
log.append(' initial prop: %s: %s' % (prop.Name, prop.Value))
|
||||
if prop.Name == 'CharStyleName':
|
||||
log.append('had CharStyleName %r' % prop.Value)
|
||||
if style in ('DASH', 'BULLET'):
|
||||
prop.Value = 'Bullet Symbols'
|
||||
else:
|
||||
prop.Value = 'Numbering Symbols'
|
||||
log.append(' -> changed to %r' % prop.Value)
|
||||
elif prop.Name == 'BulletChar':
|
||||
log.append('had BulletChar %r' % prop.Value)
|
||||
found_bullet_char_prop = True
|
||||
if style == 'DASH':
|
||||
prop.Value = '-'
|
||||
else:
|
||||
prop.Value = '◦'
|
||||
log.append(' -> changed to %r' % prop.Value)
|
||||
elif prop.Name == 'NumberingType':
|
||||
log.append('had NumberingType %r' % prop.Value)
|
||||
if style == 'CHARS_UPPER_LETTER':
|
||||
prop.Value = 0
|
||||
elif style == 'CHARS_LOWER_LETTER':
|
||||
|
@ -794,30 +794,35 @@ class ListStyleApply(unohelper.Base, XJobExecutor):
|
|||
prop.Value = 4
|
||||
else:
|
||||
prop.Value = 6
|
||||
log.append(' -> changed to %r' % prop.Value)
|
||||
elif prop.Name == 'BulletFontName':
|
||||
log.append('had BulletFontName %r' % prop.Value)
|
||||
if style in ('DASH', 'BULLET'):
|
||||
prop.Value = ''
|
||||
log.append(' -> changed to %r' % prop.Value)
|
||||
|
||||
if style in ('DASH', 'BULLET'):
|
||||
props = list(props)
|
||||
if not found_bullet_char_prop:
|
||||
log.append('had to set BulletChar')
|
||||
if style == 'DASH':
|
||||
props.append(makePropertyValue('BulletChar', '-'))
|
||||
else:
|
||||
props.append(makePropertyValue('BulletChar', '◦'))
|
||||
log.append(' -> add BulletChar as %r' % props[-1].Value)
|
||||
if not found_bullet_fontname_prop:
|
||||
log.append('had to set BulletFontName')
|
||||
log.append(' -> add BulletFontName')
|
||||
props.append(makePropertyValue('BulletFontName', ''))
|
||||
props = tuple(props)
|
||||
|
||||
uno.invoke(numberingrules, 'replaceByIndex',
|
||||
(level, uno.Any("[]com.sun.star.beans.PropertyValue", props)) )
|
||||
(level+123, uno.Any("[]com.sun.star.beans.PropertyValue", props)) )
|
||||
textcursor.setPropertyValue('NumberingRules', numberingrules)
|
||||
except:
|
||||
except Exception, e:
|
||||
display_exception(self.ctx)
|
||||
|
||||
log.append('\nException data:')
|
||||
log.append('%s' % type(e))
|
||||
log.append('%r' % e.__dict__)
|
||||
|
||||
desktop = self.ctx.ServiceManager.createInstanceWithContext(
|
||||
'com.sun.star.frame.Desktop', self.ctx)
|
||||
doc = desktop.getCurrentComponent()
|
||||
|
|
Reference in New Issue