]> source.dussan.org Git - poi.git/commitdiff
fix rendering of xslf shapes with no/external blip part
authorAndreas Beeker <kiwiwings@apache.org>
Sun, 23 Jun 2019 23:13:15 +0000 (23:13 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sun, 23 Jun 2019 23:13:15 +0000 (23:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1861958 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/sl/draw/DrawPaint.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java

index fea1da46614159d59714a16bd592eded192f2fd6..ea5e2ad39cf888ada5830b79f00b0c8cc7833dae 100644 (file)
@@ -237,6 +237,9 @@ public class DrawPaint {
         assert(graphics != null);
 
         final String contentType = fill.getContentType();
+        if (contentType == null || contentType.isEmpty()) {
+            return TRANSPARENT;
+        }
 
         ImageRenderer renderer = DrawPictureShape.getImageRenderer(graphics, contentType);
 
index 8b056847b8b2efd38b737a9a7a1fbce8bb9f3095..f9d58b8e5bcaa21173f49d64c71169f01c389461 100644 (file)
@@ -428,6 +428,9 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
 
             @Override
             public String getContentType() {
+                if (blip == null || !blip.isSetEmbed() || blip.getEmbed().isEmpty()) {
+                    return null;
+                }
                 /* TOOD: map content-type */
                 return getPart().getContentType();
             }