Commit dc619e90 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

minimize hardcoded blacklisted filters.

parent 1c44f35b
...@@ -132,6 +132,12 @@ class MimeMapper(object): ...@@ -132,6 +132,12 @@ class MimeMapper(object):
for filter_name, value in filter_dict.iteritems(): for filter_name, value in filter_dict.iteritems():
if filter_name in ooo_disable_filter_name_list: if filter_name in ooo_disable_filter_name_list:
continue continue
# Hardcode blacklisted filters
if filter_name in [
'Text', # Use 'Text (encoded)' instead
'Text (StarWriter/Web)', # Use 'Text (encoded) (StarWriter/Web)' instead
]:
continue
flag = value.get("Flags") flag = value.get("Flags")
# http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_2_4_2_10_Properties_of_a_Filter # http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_2_4_2_10_Properties_of_a_Filter
# Import:0x01, Export:0x02, Template:0x04, Internal:0x08, # Import:0x01, Export:0x02, Template:0x04, Internal:0x08,
...@@ -142,17 +148,6 @@ class MimeMapper(object): ...@@ -142,17 +148,6 @@ class MimeMapper(object):
if flag & 0x08 or flag & 0x1000 or flag & 0x2000: if flag & 0x08 or flag & 0x1000 or flag & 0x2000:
continue continue
ui_name = value.get('UIName') ui_name = value.get('UIName')
# Hardcode blacklisted filters
# XXX It should be done in configuration file instead
if value.get('Name') in [
'Text', # Use 'Text Encoded' instead
'Text (Writer/Web)', # Use 'Text Encoded (Writer/Web)' instead
'XHTML Calc File',
'XHTML Impress File',
'XHTML Writer File',
'XHTML Draw File',
]:
continue
filter_type = value.get('Type') filter_type = value.get('Type')
filter_type_dict = type_dict.get(filter_type) filter_type_dict = type_dict.get(filter_type)
if not ui_name: if not ui_name:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment