poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1782712 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel: HSLFTextRun.java HSLFTextShape.java
Date Mon, 13 Feb 2017 00:52:39 GMT
Author: kiwiwings
Date: Mon Feb 13 00:52:38 2017
New Revision: 1782712

URL: http://svn.apache.org/viewvc?rev=1782712&view=rev
Log:
#60625 - Rendering issue with background and shape overlayed by image

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java?rev=1782712&r1=1782711&r2=1782712&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java Mon Feb 13
00:52:38 2017
@@ -26,10 +26,13 @@ import org.apache.poi.hslf.model.textpro
 import org.apache.poi.hslf.model.textproperties.TextPropCollection;
 import org.apache.poi.hslf.model.textproperties.TextPropCollection.TextPropType;
 import org.apache.poi.sl.draw.DrawPaint;
+import org.apache.poi.sl.usermodel.MasterSheet;
 import org.apache.poi.sl.usermodel.PaintStyle;
 import org.apache.poi.sl.usermodel.PaintStyle.SolidPaint;
 import org.apache.poi.sl.usermodel.Placeholder;
+import org.apache.poi.sl.usermodel.TextParagraph;
 import org.apache.poi.sl.usermodel.TextRun;
+import org.apache.poi.sl.usermodel.TextShape;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
@@ -426,7 +429,9 @@ public final class HSLFTextRun implement
     
     @Override
     public FieldType getFieldType() {
-        Placeholder ph = getTextParagraph().getParentShape().getPlaceholder();
+        HSLFTextShape ts = getTextParagraph().getParentShape();
+        Placeholder ph = ts.getPlaceholder();
+        
         if (ph != null) {
             switch (ph) {
             case SLIDE_NUMBER:
@@ -437,6 +442,16 @@ public final class HSLFTextRun implement
                 break;
             }
         }
+
+        if (ts.getSheet() instanceof MasterSheet) {
+            TextShape<?,? extends TextParagraph<?,?,TextRun>> ms = ts.getMetroShape();
+            if (ms == null) {
+                return null;
+            }
+            TextRun tr = ms.getTextParagraphs().get(0).getTextRuns().get(0);
+            return tr.getFieldType();
+        }
+        
         return null;
     }
 }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java?rev=1782712&r1=1782711&r2=1782712&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java Mon Feb
13 00:52:38 2017
@@ -47,6 +47,8 @@ import org.apache.poi.sl.draw.DrawTextSh
 import org.apache.poi.sl.usermodel.Insets2D;
 import org.apache.poi.sl.usermodel.Placeholder;
 import org.apache.poi.sl.usermodel.ShapeContainer;
+import org.apache.poi.sl.usermodel.TextParagraph;
+import org.apache.poi.sl.usermodel.TextRun;
 import org.apache.poi.sl.usermodel.TextShape;
 import org.apache.poi.sl.usermodel.VerticalAlignment;
 import org.apache.poi.util.POILogFactory;
@@ -925,8 +927,8 @@ implements TextShape<HSLFShape,HSLFTextP
      *
      * @return null, if there's no alternative representation, otherwise the text shape
      */
-    public TextShape<?,?> getMetroShape() {
-        HSLFMetroShape<TextShape<?,?>> mbs = new HSLFMetroShape<TextShape<?,?>>(this);
+    public TextShape<?,? extends TextParagraph<?,?,TextRun>> getMetroShape()
{
+        HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,TextRun>>>
mbs = new HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,TextRun>>>(this);
         return mbs.getShape();
     }
 }
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message