return;
}
for( Shape shape : shapes ) {
if( shape instanceof OLEShape ) {
OLEShape oleShape = (OLEShape)shape;
ObjectData data = null;
try {
data = oleShape.getObjectData();
} catch( NullPointerException e ) {
/* getObjectData throws NPE some times. */
}
if (data != null) {
String objID = Integer.toString(oleShape.getObjectID());
// Embedded Object: add a <div
// class="embedded" id="X"/> so consumer can see where
// in the main text each embedded document
// occurred:
AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute("", "class", "class", "CDATA", "embedded");
attributes.addAttribute("", "id", "id", "CDATA", objID);
xhtml.startElement("div", attributes);
xhtml.endElement("div");
TikaInputStream stream =
TikaInputStream.get(data.getData());
try {
String mediaType = null;
if ("Excel.Chart.8".equals(oleShape.getProgID())) {
mediaType = "application/vnd.ms-excel";
}
handleEmbeddedResource(
stream, objID, objID,
mediaType, xhtml, false);