[Libreoffice-commits] .: sysui/desktop
Petr Mladek
pmladek at kemper.freedesktop.org
Wed May 2 07:16:10 PDT 2012
sysui/desktop/share/create_mime_xml.pl | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
New commits:
commit 515f26384510701be0b3ef21ddd445d1022198cc
Author: Petr Mladek <pmladek at suse.cz>
Date: Mon Sep 5 18:57:34 2011 +0200
better detect OASIS MIME types (bnc#711977)
check more elements; also set sub-class-of application/xml for Flat XML
diff --git a/sysui/desktop/share/create_mime_xml.pl b/sysui/desktop/share/create_mime_xml.pl
index e1fc890..5141dff 100755
--- a/sysui/desktop/share/create_mime_xml.pl
+++ b/sysui/desktop/share/create_mime_xml.pl
@@ -45,9 +45,24 @@ foreach $component (sort(keys %mimehash)) {
print (sort({customsort($a) cmp customsort($b)} @{$mimehash{$component}}));
print ' <glob pattern="'.$glob.'"/>';
if ( $component =~ /oasis/ ) {
- print ' <magic'.( $mimetype =~ /-/ ? ' priority="60"' : '').'>';
- print ' <match type="string" offset="38" value="'.$mimetype.'"/>';
- print ' </magic>';
+ if ( $component =~ /flat-xml/ ) {
+ print ' <sub-class-of type="application/xml"/>';
+ print ' <magic'.( $mimetype =~ /-/ ? ' priority="60"' : '').'>';
+ print ' <match value="<?xml" type="string" offset="0">';
+ print ' <match value="office:document" type="string" offset="4:100">';
+ print ' <match value="office:mimetype="' . $mimetype . '"" type="string" offset="100:4000"/>';
+ print ' </match>';
+ print ' </match>';
+ print ' </magic>';
+ } else {
+ print ' <magic'.( $mimetype =~ /-/ ? ' priority="60"' : '').'>';
+ print ' <match value="PK\003\004" type="string" offset="0">';
+ print ' <match value="mimetype" type="string" offset="30">';
+ print ' <match value="' . $mimetype . '" type="string" offset="38"/>';
+ print ' </match>';
+ print ' </match>';
+ print ' </magic>';
+ }
}
print ' </mime-type>';
}
More information about the Libreoffice-commits
mailing list