"This may go awfully wrong.");
imageAreaWidthVal = image.getWidth();
imageAreaHeightVal = image.getHeight();
}
final AttributeList frameList = new AttributeList();
frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "name", imageNames.generateName("Image"));
if (styleName != null)
{
frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "style-name", styleName);
}
frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", "paragraph");
frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", "0cm");
frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", "0cm");
Log.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal);
if (imageAreaWidthVal != null)
{
frameList.setAttribute(OfficeNamespaces.SVG_NS,
"width", String.valueOf(imageAreaWidthVal.getValue()) + imageAreaWidthVal.getType().getType());
}
if (imageAreaHeightVal != null)
{
frameList.setAttribute(OfficeNamespaces.SVG_NS,
"height", String.valueOf(imageAreaHeightVal.getValue()) + imageAreaHeightVal.getType().getType());
}
final AttributeList imageList = new AttributeList();
imageList.setAttribute(OfficeNamespaces.XLINK_NS, "href", image.getEmbeddableLink());
imageList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
imageList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
imageList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");
try
{
getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "frame", frameList, XmlWriterSupport.OPEN);