poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1647927 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model: ActiveXShape.java Freeform.java Line.java Picture.java Placeholder.java Polygon.java Shape.java SimpleShape.java Table.java TableCell.java TextShape.java
Date Fri, 26 Dec 2014 00:11:23 GMT
Author: kiwiwings
Date: Fri Dec 26 00:11:23 2014
New Revision: 1647927

URL: http://svn.apache.org/r1647927
Log:
Unified access to escher opt record 

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java Fri Dec 26 00:11:23
2014
@@ -159,7 +159,7 @@ public final class ActiveXShape extends
             String name = ctrl.getProgId() + "-" + getControlIndex();
             byte[] data = (name + '\u0000').getBytes("UTF-16LE");
             EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.GROUPSHAPE__SHAPENAME,
false, data);
-            EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+            EscherOptRecord opt = getEscherOptRecord();
             opt.addEscherProperty(prop);
         } catch (UnsupportedEncodingException e){
             throw new HSLFException(e);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java Fri Dec 26 00:11:23
2014
@@ -136,7 +136,7 @@ public final class Freeform extends Auto
         if(!isClosed) segInfo.add(SEGMENTINFO_LINETO);
         segInfo.add(new byte[]{0x00, (byte)0x80});
 
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__SHAPEPATH,
0x4));
 
         EscherArrayProperty verticesProp = new EscherArrayProperty((short)(EscherProperties.GEOMETRY__VERTICES
+ 0x4000), false, null);
@@ -176,7 +176,7 @@ public final class Freeform extends Auto
      * @return the freeform path
      */
      public GeneralPath getPath(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__SHAPEPATH,
0x4));
 
         EscherArrayProperty verticesProp = (EscherArrayProperty)getEscherProperty(opt, (short)(EscherProperties.GEOMETRY__VERTICES
+ 0x4000));

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java Fri Dec 26 00:11:23 2014
@@ -116,7 +116,7 @@ public final class Line extends SimpleSh
         spRecord.setOptions(type);
 
         //set default properties for a line
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
 
         //default line properties
         setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java Fri Dec 26 00:11:23
2014
@@ -111,7 +111,7 @@ public class Picture extends SimpleShape
      * @return the index to this picture (1 based).
      */
     public int getPictureIndex(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.BLIP__BLIPTODISPLAY);
         return prop == null ? 0 : prop.getPropertyValue();
     }
@@ -130,7 +130,7 @@ public class Picture extends SimpleShape
         spRecord.setOptions((short)((ShapeTypes.PictureFrame << 4) | 0x2));
 
         //set default properties for a picture
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x800080);
 
         //another weird feature of powerpoint: for picture id we must add 0x4000.
@@ -214,7 +214,7 @@ public class Picture extends SimpleShape
      * @return name of this picture
      */
     public String getPictureName(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherComplexProperty prop = (EscherComplexProperty)getEscherProperty(opt, EscherProperties.BLIP__BLIPFILENAME);
         String name = null;
         if(prop != null){
@@ -235,7 +235,7 @@ public class Picture extends SimpleShape
      * @param name of this picture
      */
     public void setPictureName(String name){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         try {
             byte[] data = (name + '\u0000').getBytes("UTF-16LE");
             EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME,
false, data);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java Fri Dec 26 00:11:23
2014
@@ -56,7 +56,7 @@ public final class Placeholder extends T
         EscherClientDataRecord cldata = new EscherClientDataRecord();
         cldata.setOptions((short)15);
 
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
 
         //Placeholders can't be grouped
         setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 262144);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java Fri Dec 26 00:11:23
2014
@@ -71,7 +71,7 @@ public final class Polygon extends AutoS
         float left   = findSmallest(xPoints);
         float top    = findSmallest(yPoints);
 
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT,
(int)((right - left)*POINT_DPI/MASTER_DPI)));
         opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM,
(int)((bottom - top)*POINT_DPI/MASTER_DPI)));
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java Fri Dec 26 00:11:23
2014
@@ -299,7 +299,7 @@ public abstract class Shape {
      * @param value     value of the property. If value = -1 then the property is removed.
      */
     public void setEscherProperty(short propId, int value){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, propId, value);
     }
 
@@ -309,7 +309,7 @@ public abstract class Shape {
      * @param propId    The id of the property. One of the constants defined in EscherOptRecord.
      */
    public int getEscherProperty(short propId){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, propId);
         return prop == null ? 0 : prop.getPropertyValue();
     }
@@ -320,7 +320,7 @@ public abstract class Shape {
      * @param propId    The id of the property. One of the constants defined in EscherOptRecord.
      */
    public int getEscherProperty(short propId, int defaultValue){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, propId);
         return prop == null ? defaultValue : prop.getPropertyValue();
     }
@@ -364,7 +364,7 @@ public abstract class Shape {
     }
 
     Color getColor(short colorProperty, short opacityProperty, int defaultColor){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty p = (EscherSimpleProperty)getEscherProperty(opt, colorProperty);
         if(p == null && defaultColor == -1) return null;
 
@@ -483,4 +483,8 @@ public abstract class Shape {
     public java.awt.Shape getOutline(){
         return getLogicalAnchor2D();
     }
+    
+    protected EscherOptRecord getEscherOptRecord() {
+        return (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+    }
 }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java Fri Dec 26 00:11:23
2014
@@ -102,7 +102,7 @@ public abstract class SimpleShape extend
      *  Returns width of the line in in points
      */
     public double getLineWidth(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH);
         double width = prop == null ? DEFAULT_LINE_WIDTH : (double)prop.getPropertyValue()/EMU_PER_POINT;
         return width;
@@ -113,7 +113,7 @@ public abstract class SimpleShape extend
      *  @param width  the width of line in in points
      */
     public void setLineWidth(double width){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH, (int)(width*EMU_PER_POINT));
     }
 
@@ -123,7 +123,7 @@ public abstract class SimpleShape extend
      * @param color new color of the line
      */
     public void setLineColor(Color color){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         if (color == null) {
             setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000);
         } else {
@@ -137,7 +137,7 @@ public abstract class SimpleShape extend
      * @return color of the line. If color is not set returns <code>java.awt.Color.black</code>
      */
     public Color getLineColor(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
 
         EscherSimpleProperty p = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH);
         if(p != null && (p.getPropertyValue() & 0x8) == 0) return null;
@@ -152,7 +152,7 @@ public abstract class SimpleShape extend
      * @return dashing of the line.
      */
     public int getLineDashing(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
 
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.LINESTYLE__LINEDASHING);
         return prop == null ? Line.PEN_SOLID : prop.getPropertyValue();
@@ -164,7 +164,7 @@ public abstract class SimpleShape extend
      * @param pen new style of the line.
      */
     public void setLineDashing(int pen){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
 
         setEscherProperty(opt, EscherProperties.LINESTYLE__LINEDASHING, pen == Line.PEN_SOLID
? -1 : pen);
     }
@@ -175,7 +175,7 @@ public abstract class SimpleShape extend
      * @param style new style of the line.
      */
     public void setLineStyle(int style){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, EscherProperties.LINESTYLE__LINESTYLE, style == Line.LINE_SIMPLE
? -1 : style);
     }
 
@@ -185,7 +185,7 @@ public abstract class SimpleShape extend
      * @return style of the line.
      */
     public int getLineStyle(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTYLE);
         return prop == null ? Line.LINE_SIMPLE : prop.getPropertyValue();
     }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Table.java Fri Dec 26 00:11:23
2014
@@ -332,7 +332,7 @@ public final class Table extends ShapeGr
     public Line createBorder(){
         Line line = new Line(this);
 
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(line.getSpContainer(), EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, -1);
         setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, -1);
         setEscherProperty(opt, EscherProperties.SHADOWSTYLE__SHADOWOBSURED, 0x20000);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java Fri Dec 26 00:11:23
2014
@@ -61,7 +61,7 @@ public final class TableCell extends Tex
 
     protected EscherContainerRecord createSpContainer(boolean isChild){
         _escherContainer = super.createSpContainer(isChild);
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         setEscherProperty(opt, EscherProperties.TEXT__TEXTID, 0);
         setEscherProperty(opt, EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20000);
         setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x150001);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java?rev=1647927&r1=1647926&r2=1647927&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java Fri Dec 26 00:11:23
2014
@@ -280,7 +280,7 @@ public abstract class TextShape extends
      * @return the type of alignment
      */
     public int getVerticalAlignment(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__ANCHORTEXT);
         int valign = TextShape.AnchorTop;
         if (prop == null){
@@ -351,7 +351,7 @@ public abstract class TextShape extends
      * @return the botom margin
      */
     public float getMarginBottom(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTBOTTOM);
         int val = prop == null ? EMU_PER_INCH/20 : prop.getPropertyValue();
         return (float)val/EMU_PER_POINT;
@@ -376,7 +376,7 @@ public abstract class TextShape extends
      * @return the left margin
      */
     public float getMarginLeft(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTLEFT);
         int val = prop == null ? EMU_PER_INCH/10 : prop.getPropertyValue();
         return (float)val/EMU_PER_POINT;
@@ -401,7 +401,7 @@ public abstract class TextShape extends
      * @return the right margin
      */
     public float getMarginRight(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTRIGHT);
         int val = prop == null ? EMU_PER_INCH/10 : prop.getPropertyValue();
         return (float)val/EMU_PER_POINT;
@@ -425,7 +425,7 @@ public abstract class TextShape extends
      * @return the top margin
      */
     public float getMarginTop(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTTOP);
         int val = prop == null ? EMU_PER_INCH/20 : prop.getPropertyValue();
         return (float)val/EMU_PER_POINT;
@@ -449,7 +449,7 @@ public abstract class TextShape extends
      *  Must be one of the <code>Wrap*</code> constants defined in this class.
      */
     public int getWordWrap(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__WRAPTEXT);
         return prop == null ? WrapSquare : prop.getPropertyValue();
     }
@@ -468,7 +468,7 @@ public abstract class TextShape extends
      * @return id for the text.
      */
     public int getTextId(){
-        EscherOptRecord opt = (EscherOptRecord)getEscherChild(_escherContainer, EscherOptRecord.RECORD_ID);
+        EscherOptRecord opt = getEscherOptRecord();
         EscherSimpleProperty prop = (EscherSimpleProperty)getEscherProperty(opt, EscherProperties.TEXT__TEXTID);
         return prop == null ? 0 : prop.getPropertyValue();
     }



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


Mime
View raw message