Bug 3145 - OpenOffice.org Calc spreadsheet magic
Summary: OpenOffice.org Calc spreadsheet magic
Status: RESOLVED DUPLICATE of bug 2926
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-27 12:07 UTC by J.H.M. Dassen (Ray)
Modified: 2007-02-05 09:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description J.H.M. Dassen (Ray) 2005-04-27 12:07:30 UTC
--- shared-mime-info-0.16/freedesktop.org.xml.in.old	2005-04-27
19:18:16.000000000 +0200
+++ shared-mime-info-0.16/freedesktop.org.xml.in	2005-04-27 19:19:00.000000000 +0200
@@ -262,9 +262,12 @@
     <glob pattern="*.vor"/>
     <glob pattern="*.sgl"/>
   </mime-type>
-  <mime-type type="application/vnd.sun.xml.calc">
+  <mime-type type="application/vnd.sun.xml.calc"><!-- Not officially registered
with IANA -->
     <_comment>OpenOffice.org Calc spreadsheet</_comment>
     <glob pattern="*.sxc"/>
+    <magic priority="50">
+      <match type="string" value="\x50\x4B\x03\x04\x14\x00" offset="0"/>
+    </magic>
   </mime-type>
   <mime-type type="application/vnd.sun.xml.calc.template">
     <_comment>OpenOffice.org Calc spreadsheet template</_comment>
Comment 1 Stewart Jeacocke 2005-05-01 03:39:08 UTC
Th above patch is far too general. It will match any zip files (all OOo files
are zipped). Below is a far more specific bit of magic that will only match OOo
calc files

diff -ru shared-mime-info-0.16.old/freedesktop.org.xml.in
shared-mime-info-0.16/freedesktop.org.xml.in
--- shared-mime-info-0.16.old/freedesktop.org.xml.in	2005-04-30
15:55:07.000000000 +0200
+++ shared-mime-info-0.16/freedesktop.org.xml.in	2005-04-30 15:55:08.000000000 +0200
@@ -285,9 +285,13 @@
     <glob pattern="*.vor"/>
     <glob pattern="*.sgl"/>
   </mime-type>
-  <mime-type type="application/vnd.sun.xml.calc">
+  <mime-type type="application/vnd.sun.xml.calc"><!-- Not officially registered
with IANA -->
+    <sub-class-of type="application/zip"/>
     <_comment>OpenOffice.org Calc spreadsheet</_comment>
     <glob pattern="*.sxc"/>
+    <magic priority="50">
+      <match value="mimetypeapplication/vnd.sun.xml.calc" type="string"
offset="30"/>
+    </magic>
   </mime-type>
   <mime-type type="application/vnd.sun.xml.calc.template">
     <_comment>OpenOffice.org Calc spreadsheet template</_comment>
Comment 2 Bastien Nocera 2007-02-05 09:14:33 UTC
Bug 2926 has the same information but for more OO.o filetypes.

*** This bug has been marked as a duplicate of bug 2926 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.