Update export/import of StyledText according to structural changes in r10626.
svn: r10630
This commit is contained in:
parent
9bf1c718f6
commit
cb4a425f55
@ -424,7 +424,7 @@ class GrampsDbXmlWriter(UpdateCallback):
|
|||||||
|
|
||||||
self.g.write(' ' * index + '<tag name="%s"' % name)
|
self.g.write(' ' * index + '<tag name="%s"' % name)
|
||||||
if value:
|
if value:
|
||||||
self.g.write(' value="%s"' % value)
|
self.g.write(' value="%s"' % str(value))
|
||||||
self.g.write('>\n')
|
self.g.write('>\n')
|
||||||
|
|
||||||
for (start, end) in tag.ranges:
|
for (start, end) in tag.ranges:
|
||||||
|
@ -1327,9 +1327,12 @@ class GrampsParser(UpdateCallback):
|
|||||||
tagtype.set_from_xml_str(attrs['name'])
|
tagtype.set_from_xml_str(attrs['name'])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tagvalue = attrs['value']
|
val = attrs['value']
|
||||||
|
tagvalue = gen.lib.StyledTextTagType.STYLE_TYPE[int(tagtype)](val)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
tagvalue = None
|
tagvalue = None
|
||||||
|
except ValueError:
|
||||||
|
return
|
||||||
|
|
||||||
self.note_tags.append(gen.lib.StyledTextTag(tagtype, tagvalue))
|
self.note_tags.append(gen.lib.StyledTextTag(tagtype, tagvalue))
|
||||||
|
|
||||||
@ -1360,7 +1363,7 @@ class GrampsParser(UpdateCallback):
|
|||||||
self.note.format = int(attrs.get('format', gen.lib.Note.FLOWED))
|
self.note.format = int(attrs.get('format', gen.lib.Note.FLOWED))
|
||||||
self.note.type.set_from_xml_str(attrs['type'])
|
self.note.type.set_from_xml_str(attrs['type'])
|
||||||
|
|
||||||
# Since StyledText was introduced (XML v1.2.1?) the clear text
|
# Since StyledText was introduced (XML v1.3.0) the clear text
|
||||||
# part of the note is moved between <text></text> tags.
|
# part of the note is moved between <text></text> tags.
|
||||||
# To catch the different versions here we reset the note_text
|
# To catch the different versions here we reset the note_text
|
||||||
# variable. It will be checked in stop_note() then.
|
# variable. It will be checked in stop_note() then.
|
||||||
|
Loading…
Reference in New Issue
Block a user