Commit 000284fc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

hardcode 'extension -> document type' mappings according to soffice behaviour...

hardcode 'extension -> document type' mappings according to soffice behaviour for extensions having several candidates.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@42578 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ac0d8af5
......@@ -189,6 +189,19 @@ class MimeMapper(object):
preferred=preferred, sort_index=sort_index, label=ui_name)
# Adds the object in filter_by_extension_dict
self._addFilter(filter)
# hardcode 'extension -> document type' mappings according to
# soffice behaviour for extensions having several candidates.
self._doc_type_list_by_extension.update({
'rtf':['com.sun.star.text.TextDocument'],
'sxd':['com.sun.star.drawing.DrawingDocument'],
'txt':['com.sun.star.text.TextDocument'],
'odg':['com.sun.star.drawing.DrawingDocument'],
'html':['com.sun.star.text.WebDocument'],
'sda':['com.sun.star.drawing.DrawingDocument'],
'sdd':['com.sun.star.drawing.DrawingDocument'],
'pdf':['com.sun.star.drawing.DrawingDocument'],
'xls':['com.sun.star.sheet.SpreadsheetDocument'],
})
self.document_service_list = self._extension_list_by_type.keys()
self.extension_list_by_doc_type =\
dict([(type, [extension[0] for extension in extension_list])\
......
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