do not insert speaker function if there is none
This commit is contained in:
parent
42a96a09f0
commit
3358841e9e
|
@ -443,6 +443,8 @@ class Minister(RemoteObject):
|
|||
return u'%s %s %s' % (self.title, self.firstname, self.name)
|
||||
|
||||
def get_function_with_correct_case(self, ctx):
|
||||
if not self.fonc:
|
||||
self.fonc = ''
|
||||
fonc = self.fonc.strip()
|
||||
fonc = fonc.replace('Ministre', 'ministre')
|
||||
if get_mode(ctx) == 'PCF':
|
||||
|
@ -460,12 +462,15 @@ class Minister(RemoteObject):
|
|||
doc.Text.insertTextContent(cursor, annotation, False)
|
||||
cursor.setPropertyValue('CharWeight', BOLD)
|
||||
doc.Text.insertString(cursor, self.get_long_name().replace(' ', u' '), 0)
|
||||
if get_mode(ctx) == 'PCF':
|
||||
cursor.setPropertyValue('CharWeight', NORMAL)
|
||||
doc.Text.insertString(cursor, u', ', 0)
|
||||
doc.Text.insertString(cursor, self.get_function_with_correct_case(ctx), 0)
|
||||
if get_mode(ctx) == 'PFB':
|
||||
cursor.setPropertyValue('CharWeight', NORMAL)
|
||||
|
||||
fonc = self.get_function_with_correct_case(ctx)
|
||||
if fonc:
|
||||
if get_mode(ctx) == 'PCF':
|
||||
cursor.setPropertyValue('CharWeight', NORMAL)
|
||||
doc.Text.insertString(cursor, u', ', 0)
|
||||
doc.Text.insertString(cursor, fonc, 0)
|
||||
if get_mode(ctx) == 'PFB':
|
||||
cursor.setPropertyValue('CharWeight', NORMAL)
|
||||
self.insert_speaker_closing(ctx, doc, cursor)
|
||||
|
||||
|
||||
|
|
Reference in New Issue