KeyError on styled note (translation for Link); add missing link style on map

svn: r16964
This commit is contained in:
Jérôme Rapinat 2011-03-28 08:26:47 +00:00
parent 2f4bf5696f
commit 8084f88ab1

View File

@ -66,6 +66,7 @@ ALLOWED_STYLES = (
StyledTextTagType.HIGHLIGHT, StyledTextTagType.HIGHLIGHT,
StyledTextTagType.FONTFACE, StyledTextTagType.FONTFACE,
StyledTextTagType.FONTSIZE, StyledTextTagType.FONTSIZE,
StyledTextTagType.LINK,
) )
STYLE_TO_PROPERTY = { STYLE_TO_PROPERTY = {
@ -76,6 +77,7 @@ STYLE_TO_PROPERTY = {
StyledTextTagType.HIGHLIGHT: 'background', StyledTextTagType.HIGHLIGHT: 'background',
StyledTextTagType.FONTFACE: 'family', StyledTextTagType.FONTFACE: 'family',
StyledTextTagType.FONTSIZE: 'size-points', StyledTextTagType.FONTSIZE: 'size-points',
StyledTextTagType.LINK: 'link',
} }
(MATCH_START, (MATCH_START,
@ -553,7 +555,7 @@ class StyledTextBuffer(UndoableBuffer):
s_tags = s_text.get_tags() s_tags = s_text.get_tags()
for s_tag in s_tags: for s_tag in s_tags:
if s_tag.name == 'Link': if s_tag.name == _('Link'):
g_tag = LinkTag(self, s_tag.value, g_tag = LinkTag(self, s_tag.value,
foreground="blue", foreground="blue",
underline=UNDERLINE_SINGLE) underline=UNDERLINE_SINGLE)