forked from openlp/openlp
Simplify previous cruft.
This commit is contained in:
parent
3b5bd4852f
commit
4917831206
@ -463,14 +463,6 @@ class StripRtf():
|
|||||||
u'zwnj': u'\u200C'}
|
u'zwnj': u'\u200C'}
|
||||||
CHARSET_MAPPING = {
|
CHARSET_MAPPING = {
|
||||||
u'fcharset0': u'cp1252',
|
u'fcharset0': u'cp1252',
|
||||||
u'fcharset1': None,
|
|
||||||
u'fcharset2': None,
|
|
||||||
u'fcharset77': None,
|
|
||||||
u'fcharset128': None,
|
|
||||||
u'fcharset129': None,
|
|
||||||
u'fcharset130': None,
|
|
||||||
u'fcharset134': None,
|
|
||||||
u'fcharset136': None,
|
|
||||||
u'fcharset161': u'cp1253',
|
u'fcharset161': u'cp1253',
|
||||||
u'fcharset162': u'cp1254',
|
u'fcharset162': u'cp1254',
|
||||||
u'fcharset163': u'cp1258',
|
u'fcharset163': u'cp1258',
|
||||||
@ -545,19 +537,10 @@ class StripRtf():
|
|||||||
font = arg
|
font = arg
|
||||||
elif word == u'ansicpg':
|
elif word == u'ansicpg':
|
||||||
font_table[font] = 'cp' + arg
|
font_table[font] = 'cp' + arg
|
||||||
elif word == u'fcharset':
|
elif word == u'fcharset' and font not in font_table and \
|
||||||
charset_reference = word + arg
|
word + arg in self.CHARSET_MAPPING:
|
||||||
if charset_reference in self.CHARSET_MAPPING:
|
# \ansicpg overrides \fcharset, if present.
|
||||||
charset = self.CHARSET_MAPPING[charset_reference]
|
font_table[font] = self.CHARSET_MAPPING[word + arg]
|
||||||
else:
|
|
||||||
charset = None
|
|
||||||
log.error(u"Charset '%s' not in CHARSET_MAPPING "
|
|
||||||
u"dictionary in "
|
|
||||||
u"openlp/plugins/songs/lib/__init__.py"
|
|
||||||
% charset_reference)
|
|
||||||
# This makes ansicpg always override fcharset if present.
|
|
||||||
if font not in font_table:
|
|
||||||
font_table[font] = charset
|
|
||||||
# \'xx
|
# \'xx
|
||||||
elif hex:
|
elif hex:
|
||||||
if curskip > 0:
|
if curskip > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user