gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r2042 - Extractor/src/plugins/ole2


From: grothoff
Subject: [GNUnet-SVN] r2042 - Extractor/src/plugins/ole2
Date: Fri, 2 Sep 2005 03:04:05 -0700 (PDT)

Author: grothoff
Date: 2005-09-02 03:04:04 -0700 (Fri, 02 Sep 2005)
New Revision: 2042

Modified:
   Extractor/src/plugins/ole2/ole2extractor.c
Log:
ole2 improvements

Modified: Extractor/src/plugins/ole2/ole2extractor.c
===================================================================
--- Extractor/src/plugins/ole2/ole2extractor.c  2005-09-02 09:27:35 UTC (rev 
2041)
+++ Extractor/src/plugins/ole2/ole2extractor.c  2005-09-02 10:04:04 UTC (rev 
2042)
@@ -922,6 +922,7 @@
   struct GsfInfileMSOle * infile;
   struct GsfInput * src;
   const char * name;
+  const char * software = 0;
   int i;
 
   input = gsf_input_new((const unsigned char*) date,
@@ -956,6 +957,24 @@
       gsf_input_finalize(src);
   }
   gsf_infile_msole_finalize(infile);
+
+  /*
+   * Hack to return an appropriate mimetype
+   */
+  software = EXTRACTOR_extractLast(EXTRACTOR_SOFTWARE, prev);
+  if(NULL != software) {
+    const char * mimetype = "application/vnd.ms-files";
+ 
+    if(0 == strncmp(software, "Microsoft Word", 14))
+      mimetype = "application/msword";
+    else if(0 == strncmp(software, "Microsoft Excel", 15))
+      mimetype = "application/vnd.ms-excel";
+    else if(0 == strncmp(software, "Microsoft PowerPoint", 19))
+      mimetype = "application/vnd.ms-powerpoint";
+
+    prev = addKeyword(prev, mimetype, EXTRACTOR_MIMETYPE);
+  }
+
   return prev;
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]