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:
'Microsoft PowerPoint 2007-2013 XML':'ms.pptx',
'Microsoft Word 2007 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 95':'95.doc',
'TIFF - Tagged Image File Format': 'tiff',
......
......@@ -204,11 +204,11 @@ class TestHandler(HandlerTestCase):
('application/msword', 'Word 97–2003'),
('application/pdf', 'PDF - Portable Document Format'),
('application/rtf', 'Rich Text'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
......@@ -227,11 +227,11 @@ class TestHandler(HandlerTestCase):
('application/msword', 'Word 97–2003'),
('application/pdf', 'PDF - Portable Document Format'),
('application/rtf', 'Rich Text'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
......@@ -254,6 +254,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -277,11 +278,11 @@ class TestHandler(HandlerTestCase):
('application/msword', 'Word 97–2003'),
('application/pdf', 'PDF - Portable Document Format'),
('application/rtf', 'Rich Text'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
......@@ -297,11 +298,11 @@ class TestHandler(HandlerTestCase):
('application/msword', 'Word 97–2003'),
('application/pdf', 'PDF - Portable Document Format'),
('application/rtf', 'Rich Text'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
......@@ -324,6 +325,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -345,6 +347,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -360,7 +363,7 @@ class TestHandler(HandlerTestCase):
('application/rtf', 'Rich Text'),
('application/vnd.ms-excel', 'Excel 97–2003'),
('application/vnd.ms-excel.sheet.macroEnabled.12', 'Excel 2007–365 (macro-enabled)'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.spreadsheet', 'ODF Spreadsheet'),
('application/vnd.oasis.opendocument.spreadsheet-flat-xml', 'Flat XML ODF Spreadsheet'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
......@@ -368,8 +371,8 @@ class TestHandler(HandlerTestCase):
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'Excel 2007–365'),
('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'Office Open XML Spreadsheet'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('application/vnd.sun.xml.writer', 'OpenOffice.org 1.0 Text Document (Writer/Web)'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
......@@ -398,6 +401,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -419,6 +423,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -440,6 +445,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -470,6 +476,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -492,6 +499,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -513,6 +521,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -534,6 +543,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -555,6 +565,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -576,6 +587,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -597,6 +609,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -618,6 +631,7 @@ class TestHandler(HandlerTestCase):
('image/svg+xml', 'SVG - Scalable Vector Graphics'),
('image/svg+xml', 'SVGZ - Compressed Scalable Vector Graphics'),
('image/tiff', 'TIFF - Tagged Image File Format'),
('image/vnd.mozilla.apng', 'APNG - Animated Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
('image/wmf', 'WMF - Windows Metafile'),
('image/x-ms-bmp', 'BMP - Windows Bitmap'),
......@@ -688,11 +702,11 @@ class TestHandler(HandlerTestCase):
('application/msword', 'Word 97–2003'),
('application/pdf', 'PDF - Portable Document Format'),
('application/rtf', 'Rich Text'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
('image/webp', 'WEBP - WebP Image'),
......@@ -709,7 +723,7 @@ class TestHandler(HandlerTestCase):
('application/rtf', 'Rich Text'),
('application/vnd.ms-excel', 'Excel 97–2003'),
('application/vnd.ms-excel.sheet.macroEnabled.12', 'Excel 2007–365 (macro-enabled)'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007–365 VBA'),
('application/vnd.ms-word.document.macroEnabled.12', 'Word 2007 VBA'),
('application/vnd.oasis.opendocument.spreadsheet', 'ODF Spreadsheet'),
('application/vnd.oasis.opendocument.spreadsheet-flat-xml', 'Flat XML ODF Spreadsheet'),
('application/vnd.oasis.opendocument.text', 'ODF Text Document'),
......@@ -717,8 +731,8 @@ class TestHandler(HandlerTestCase):
('application/vnd.oasis.opendocument.text-flat-xml', 'Flat XML ODF Text Document'),
('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'Excel 2007–365'),
('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'Office Open XML Spreadsheet'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Office Open XML Text (Transitional)'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007–365'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2007'),
('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'Word 2010–365 Document'),
('application/vnd.sun.xml.writer', 'OpenOffice.org 1.0 Text Document (Writer/Web)'),
('image/jpeg', 'JPEG - Joint Photographic Experts Group'),
('image/png', 'PNG - Portable Network Graphics'),
......
......@@ -36,12 +36,12 @@ from cloudooo.handler.ooo.mimemapper import MimeMapper
# extension/document_type, the returned mime types are different for text
text_expected_tuple = (
('doc', 'Word 97–2003'),
('docx', 'Office Open XML Text (Transitional)'),
('docx', 'Word 2010–365 Document'),
('epub', 'EPUB Document'),
('fodt', 'Flat XML ODF Text Document'),
('html', 'HTML Document (Writer)'),
('jpg', 'JPEG - Joint Photographic Experts Group'),
('ms.docx', 'Word 2007–365'),
('ms.docx', 'Word 2007'),
('odt', 'ODF Text Document'),
('pdf', 'PDF - Portable Document Format'),
('png', 'PNG - Portable Network Graphics'),
......@@ -50,13 +50,14 @@ text_expected_tuple = (
('webp', 'WEBP - WebP Image'),
)
extra_text_expected_tuple = (
('docm', 'Word 2007–365 VBA'),
('docm', 'Word 2007 VBA'),
)
global_expected_tuple = (
)
drawing_expected_tuple = (
('apng', 'APNG - Animated Portable Network Graphics'),
('bmp', 'BMP - Windows Bitmap'),
('emf', 'EMF - Enhanced Metafile'),
('emz', 'EMZ - Compressed Enhanced Metafile'),
......
......@@ -52,7 +52,7 @@ class TestAllowedExtensions(TestCase):
text_allowed_list = self.proxy.getAllowedExtensionList(text_request)
# XXX slightly different allowed formats with document_type !?
_text_expected_tuple = text_expected_tuple + (
('docm', 'Word 2007–365 VBA'),
('docm', 'Word 2007 VBA'),
)
self.assertEqual(
sorted([tuple(x) for x in text_allowed_list]),
......
......@@ -84,7 +84,7 @@ def BBB_guess_extension(mimetype, title=None):
"Microsoft PowerPoint 2007-2013 XML": ".ms.pptx",
"Microsoft PowerPoint 2007-2013 XML AutoPlay": ".ms.ppsx",
"Microsoft Word 2007-2013 XML": ".ms.docx",
"Word 2007–365": ".ms.docx",
"Word 2007": ".ms.docx",
}.get(title, None) or {
# mediatype : extension
"application/msword": ".doc",
......
......@@ -636,6 +636,7 @@ image/vnd.fujixerox.edmics-mmr
image/vnd.fujixerox.edmics-rlc
image/vnd.microsoft.icon ico
image/vnd.mix
image/vnd.mozilla.apng apng
image/vnd.net-fpx
image/vnd.svf
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