Index: tika-parsers/src/main/java/org/apache/tika/detect/ContainerAwareDetector.java
===================================================================
--- tika-parsers/src/main/java/org/apache/tika/detect/ContainerAwareDetector.java	(revision 987225)
+++ tika-parsers/src/main/java/org/apache/tika/detect/ContainerAwareDetector.java	(working copy)
@@ -78,13 +78,45 @@
         
         // Is this an ole2 file?
         long ole2Signature = LittleEndian.getLong(first8, 0);
+        MediaType poiDetectorMediaType = null;
         if(ole2Signature == HeaderBlockConstants._signature) {
-            return poifsDetector.detect(input, metadata);
+            poiDetectorMediaType =  poifsDetector.detect(input, metadata);
+            input = TikaInputStream.get(input.getFile());
         }
         
-        // Not a supported container, ask our fall back
-        //  detector to figure it out
-        return fallbackDetector.detect(input, metadata);
+        if (poiDetectorMediaType == null || 
+        	poiDetectorMediaType.equals(MediaType.application("x-tika-msoffice"))) {
+            // Not a supported container, ask our fall back
+            // detector to figure it out, it's also possible that the fallback container
+        	// can return a more specific result than the container-aware
+            MediaType fallbackDetectorMediaType = fallbackDetector.detect(input, metadata);
+            
+            if (poiDetectorMediaType == null && fallbackDetectorMediaType == null) {
+            	return null;
+            } else if (poiDetectorMediaType == null && fallbackDetectorMediaType != null) {
+            	return fallbackDetectorMediaType;
+            } else if (poiDetectorMediaType != null && fallbackDetectorMediaType == null) {
+            	return poiDetectorMediaType;
+            } else if (fallbackDetector instanceof MimeTypes) {
+            	// use mime types to see which one is more specific
+            	MimeTypes mimeTypes = (MimeTypes)fallbackDetector;
+            	if (mimeTypes.getMediaTypeRegistry().isSpecializationOf(poiDetectorMediaType, fallbackDetectorMediaType)) {
+            		// return the more specific one
+            		return poiDetectorMediaType;
+            	} else if (mimeTypes.getMediaTypeRegistry().isSpecializationOf(fallbackDetectorMediaType, poiDetectorMediaType)) {
+            		// return the more specific one
+            		return fallbackDetectorMediaType;
+            	} else {
+            		// they aren't related, return the one from fallback
+            		return fallbackDetectorMediaType;
+            	}
+            } else {
+            	// we can't decide which is more specific, return the one from fallback
+            	return fallbackDetectorMediaType;
+            }
+        } else {
+        	return poiDetectorMediaType; // specific enough
+        }
     }
 }
 
Index: tika-parsers/src/test/java/org/apache/tika/detect/TestContainerAwareDetector.java
===================================================================
--- tika-parsers/src/test/java/org/apache/tika/detect/TestContainerAwareDetector.java	(revision 987225)
+++ tika-parsers/src/test/java/org/apache/tika/detect/TestContainerAwareDetector.java	(working copy)
@@ -16,6 +16,7 @@
  */
 package org.apache.tika.detect;
 
+import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 
 import junit.framework.TestCase;
@@ -26,6 +27,8 @@
 import org.apache.tika.io.TikaInputStream;
 import org.apache.tika.metadata.Metadata;
 import org.apache.tika.mime.MediaType;
+import org.apache.tika.mime.MimeTypes;
+import org.apache.tika.mime.MimeTypesFactory;
 
 /**
  * Junit test class for {@link ContainerAwareDetector}
@@ -154,4 +157,46 @@
                 d.detect(tis, new Metadata())
         );
     }
+    
+    public void testCorelPresentationsX3() throws Exception {
+    	MimeTypes mimeTypes = MimeTypesFactory.create("tika-mimetypes.xml");
+		ContainerAwareDetector detector = new ContainerAwareDetector(mimeTypes);
+		InputStream input = getTestDoc("corel-presentations-x3.shw");
+		Metadata metadata = new Metadata();
+		metadata.add(Metadata.RESOURCE_NAME_KEY, "corel-presentations-x3.shw");
+		MediaType mt = detector.detect(input, metadata);
+		assertEquals(MediaType.application("x-corelpresentations"),mt);
+    }
+    
+    public void testQuattroPro7() throws Exception {
+    	MimeTypes mimeTypes = MimeTypesFactory.create("tika-mimetypes.xml");
+		ContainerAwareDetector detector = new ContainerAwareDetector(mimeTypes);
+		InputStream input = getTestDoc("corel-quattro-pro-7.wb3");
+		Metadata metadata = new Metadata();
+		metadata.add(Metadata.RESOURCE_NAME_KEY, "corel-quattro-pro-7.wb3");
+		MediaType mt = detector.detect(input, metadata);
+		assertEquals(MediaType.application("x-quattropro"),mt);
+    }
+    
+    public void testQuattroProX3() throws Exception {
+    	MimeTypes mimeTypes = MimeTypesFactory.create("tika-mimetypes.xml");
+		ContainerAwareDetector detector = new ContainerAwareDetector(mimeTypes);
+		InputStream input = getTestDoc("corel-quattro-pro-x3.qpw");
+		Metadata metadata = new Metadata();
+		metadata.add(Metadata.RESOURCE_NAME_KEY, "corel-quattro-pro-x3.qpw");
+		MediaType mt = detector.detect(input, metadata);
+		assertEquals(MediaType.application("x-quattropro"),mt);
+    }
+    
+    public void testWorksWordProcessor70() throws Exception {
+    	MimeTypes mimeTypes = MimeTypesFactory.create("tika-mimetypes.xml");
+		ContainerAwareDetector detector = new ContainerAwareDetector(mimeTypes);
+		InputStream input = getTestDoc("microsoft-works-word-processor-7.0.wps");
+		Metadata metadata = new Metadata();
+		metadata.add(Metadata.RESOURCE_NAME_KEY, "microsoft-works-word-processor-7.0.wps");
+		MediaType mt = detector.detect(input, metadata);
+		assertEquals(MediaType.application("vnd.ms-works"),mt);
+    }
+
+
 }
Index: tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
===================================================================
--- tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml	(revision 987225)
+++ tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml	(working copy)
@@ -1310,10 +1310,30 @@
   </mime-type>
 
   <mime-type type="application/vnd.ms-works">
+  <!-- 
+     works spreadsheets are really weird
+     those from 3.0 use a Quattro Pro 6 magic number: 00 00 02 00                       and extension wks
+     those from 4.0 use their own magic number:       ff 00 02 00 04 04 05 54 02 00     and extension wks
+     those from 7.0 use the msoffice magic number:    d0 cf 11 e0 a1 b1 1a e1           and extension xlr
+     in tika this is not possible to express one glob can only occur in single mime-type
+                                             one mime-type can have only one supertype
+     word processor files all use the msoffice magic number, in versions 3.0, 4.0, 7.0, 2000
+     we settle on recognizing only the word processor and the new spreadsheets
+  -->
+    <sub-class-of type="application/x-tika-msoffice" />
     <glob pattern="*.wps"/>
     <glob pattern="*.wks"/>
     <glob pattern="*.wcm"/>
     <glob pattern="*.wdb"/>
+    <glob pattern="*.xlr"/>
+  </mime-type>
+  <!-- Quattro Pro 7 and higher                -->
+  <!-- uses the same magic number as ms office -->
+  <!-- versions 6 and below used their own magic number 00 00 02 00, and a different extension: wb2 -->
+  <mime-type type="application/x-quattropro">
+    <glob pattern="*.qpw"/>
+    <glob pattern="*.wb3"/>
+    <sub-class-of type="application/x-tika-msoffice" />
   </mime-type>
   <mime-type type="application/vnd.ms-wpl">
     <glob pattern="*.wpl"/>
@@ -2241,6 +2261,16 @@
   <mime-type type="application/x-csh">
     <glob pattern="*.csh"/>
   </mime-type>
+ 
+  <mime-type type="application/x-corelpresentations">
+  <!-- The idea for application/x-corelpresentations is from http://www.file-extensions.org/shw-file-extension -->
+  <!-- Corel Presentations 3.0 used a wordperfect magic number and an extension shw-->
+  <!-- Corel Presentations x3 used an msoffice magic number and the same extension -->
+  <!-- this is impossible to express in tika because one mime type can have only one parent -->
+  <!-- we settle on recognizing the newer ones -->
+    <glob pattern="*.shw"/>
+    <sub-class-of type="application/x-tika-msoffice"/>
+  </mime-type>
 
   <mime-type type="application/x-debian-package">
     <glob pattern="*.deb"/>
