Ignore (and remove) style tags this version of gramps doesn't know about, rather than crash

svn: r15331
This commit is contained in:
Doug Blank 2010-05-05 23:15:22 +00:00
parent 602aa8c1bd
commit 5f69c64971

View File

@ -474,7 +474,9 @@ class StyledTextBuffer(gtk.TextBuffer):
If TextTag does not exist yet, it is created.
"""
if StyledTextTagType.STYLE_TYPE[style] == bool:
if style not in StyledTextTagType.STYLE_TYPE:
return None
elif StyledTextTagType.STYLE_TYPE[style] == bool:
tag_name = str(style)
elif StyledTextTagType.STYLE_TYPE[style] == str:
tag_name = "%d %s" % (style, value)