Commit f8b73412 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

ooo: update mime mapper and tests for LibreOffice 24.2.

parent 25361606
...@@ -94,7 +94,7 @@ class MimeMapper: ...@@ -94,7 +94,7 @@ class MimeMapper:
'Microsoft PowerPoint 2007-2013 XML':'ms.pptx', 'Microsoft PowerPoint 2007-2013 XML':'ms.pptx',
'Microsoft Word 2007 XML':'ms.docx', 'Microsoft Word 2007 XML':'ms.docx',
'Microsoft Word 2007-2013 XML':'ms.docx', 'Microsoft Word 2007-2013 XML':'ms.docx',
'Word 2007–365':'ms.docx', 'Word 2007':'ms.docx',
'Microsoft Word 6.0':'6.doc', 'Microsoft Word 6.0':'6.doc',
'Microsoft Word 95':'95.doc', 'Microsoft Word 95':'95.doc',
'TIFF - Tagged Image File Format': 'tiff', 'TIFF - Tagged Image File Format': 'tiff',
......
...@@ -36,12 +36,12 @@ from cloudooo.handler.ooo.mimemapper import MimeMapper ...@@ -36,12 +36,12 @@ from cloudooo.handler.ooo.mimemapper import MimeMapper
# extension/document_type, the returned mime types are different for text # extension/document_type, the returned mime types are different for text
text_expected_tuple = ( text_expected_tuple = (
('doc', 'Word 97–2003'), ('doc', 'Word 97–2003'),
('docx', 'Office Open XML Text (Transitional)'), ('docx', 'Word 2010–365 Document'),
('epub', 'EPUB Document'), ('epub', 'EPUB Document'),
('fodt', 'Flat XML ODF Text Document'), ('fodt', 'Flat XML ODF Text Document'),
('html', 'HTML Document (Writer)'), ('html', 'HTML Document (Writer)'),
('jpg', 'JPEG - Joint Photographic Experts Group'), ('jpg', 'JPEG - Joint Photographic Experts Group'),
('ms.docx', 'Word 2007–365'), ('ms.docx', 'Word 2007'),
('odt', 'ODF Text Document'), ('odt', 'ODF Text Document'),
('pdf', 'PDF - Portable Document Format'), ('pdf', 'PDF - Portable Document Format'),
('png', 'PNG - Portable Network Graphics'), ('png', 'PNG - Portable Network Graphics'),
...@@ -50,13 +50,14 @@ text_expected_tuple = ( ...@@ -50,13 +50,14 @@ text_expected_tuple = (
('webp', 'WEBP - WebP Image'), ('webp', 'WEBP - WebP Image'),
) )
extra_text_expected_tuple = ( extra_text_expected_tuple = (
('docm', 'Word 2007–365 VBA'), ('docm', 'Word 2007 VBA'),
) )
global_expected_tuple = ( global_expected_tuple = (
) )
drawing_expected_tuple = ( drawing_expected_tuple = (
('apng', 'APNG - Animated Portable Network Graphics'),
('bmp', 'BMP - Windows Bitmap'), ('bmp', 'BMP - Windows Bitmap'),
('emf', 'EMF - Enhanced Metafile'), ('emf', 'EMF - Enhanced Metafile'),
('emz', 'EMZ - Compressed Enhanced Metafile'), ('emz', 'EMZ - Compressed Enhanced Metafile'),
......
...@@ -52,7 +52,7 @@ class TestAllowedExtensions(TestCase): ...@@ -52,7 +52,7 @@ class TestAllowedExtensions(TestCase):
text_allowed_list = self.proxy.getAllowedExtensionList(text_request) text_allowed_list = self.proxy.getAllowedExtensionList(text_request)
# XXX slightly different allowed formats with document_type !? # XXX slightly different allowed formats with document_type !?
_text_expected_tuple = text_expected_tuple + ( _text_expected_tuple = text_expected_tuple + (
('docm', 'Word 2007–365 VBA'), ('docm', 'Word 2007 VBA'),
) )
self.assertEqual( self.assertEqual(
sorted([tuple(x) for x in text_allowed_list]), sorted([tuple(x) for x in text_allowed_list]),
......
...@@ -84,7 +84,7 @@ def BBB_guess_extension(mimetype, title=None): ...@@ -84,7 +84,7 @@ def BBB_guess_extension(mimetype, title=None):
"Microsoft PowerPoint 2007-2013 XML": ".ms.pptx", "Microsoft PowerPoint 2007-2013 XML": ".ms.pptx",
"Microsoft PowerPoint 2007-2013 XML AutoPlay": ".ms.ppsx", "Microsoft PowerPoint 2007-2013 XML AutoPlay": ".ms.ppsx",
"Microsoft Word 2007-2013 XML": ".ms.docx", "Microsoft Word 2007-2013 XML": ".ms.docx",
"Word 2007–365": ".ms.docx", "Word 2007": ".ms.docx",
}.get(title, None) or { }.get(title, None) or {
# mediatype : extension # mediatype : extension
"application/msword": ".doc", "application/msword": ".doc",
......
...@@ -636,6 +636,7 @@ image/vnd.fujixerox.edmics-mmr ...@@ -636,6 +636,7 @@ image/vnd.fujixerox.edmics-mmr
image/vnd.fujixerox.edmics-rlc image/vnd.fujixerox.edmics-rlc
image/vnd.microsoft.icon ico image/vnd.microsoft.icon ico
image/vnd.mix image/vnd.mix
image/vnd.mozilla.apng apng
image/vnd.net-fpx image/vnd.net-fpx
image/vnd.svf image/vnd.svf
image/vnd.wap.wbmp wbmp image/vnd.wap.wbmp wbmp
......
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