You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2019/10/12 16:32:53 UTC
svn commit: r1868352 [5/6] - in /poi/trunk/src: java/org/apache/poi/ddf/
java/org/apache/poi/hssf/model/ java/org/apache/poi/hssf/usermodel/
java/org/apache/poi/sl/usermodel/ scratchpad/src/org/apache/poi/hslf/model/
scratchpad/src/org/apache/poi/hslf/...
Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java Sat Oct 12 16:32:53 2019
@@ -17,8 +17,22 @@
package org.apache.poi.hssf.usermodel;
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.record.*;
+import org.apache.poi.ddf.DefaultEscherRecordFactory;
+import org.apache.poi.ddf.EscherBoolProperty;
+import org.apache.poi.ddf.EscherClientDataRecord;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherOptRecord;
+import org.apache.poi.ddf.EscherPropertyTypes;
+import org.apache.poi.ddf.EscherRGBProperty;
+import org.apache.poi.ddf.EscherRecord;
+import org.apache.poi.ddf.EscherSimpleProperty;
+import org.apache.poi.ddf.EscherSpRecord;
+import org.apache.poi.ddf.EscherTextboxRecord;
+import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
+import org.apache.poi.hssf.record.EndSubRecord;
+import org.apache.poi.hssf.record.EscherAggregate;
+import org.apache.poi.hssf.record.ObjRecord;
+import org.apache.poi.hssf.record.TextObjectRecord;
/**
* A textbox is a shape that may hold a rich text string.
@@ -94,23 +108,23 @@ public class HSSFTextbox extends HSSFSim
sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE);
opt.setRecordId(EscherOptRecord.RECORD_ID);
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTID, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__WRAPTEXT, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__ANCHORTEXT, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00080000));
-
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTLEFT, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTRIGHT, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTTOP, 0));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.TEXT__TEXTBOTTOM, 0));
-
- opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, LINESTYLE_SOLID));
- opt.setEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
- opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT));
- opt.setEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT));
- opt.setEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT));
- opt.setEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE));
- opt.setEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x080000));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTID, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__WRAPTEXT, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__ANCHORTEXT, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x00080000));
+
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTLEFT, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTRIGHT, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTTOP, 0));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTBOTTOM, 0));
+
+ opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEDASHING, LINESTYLE_SOLID));
+ opt.setEscherProperty(new EscherBoolProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
+ opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT));
+ opt.setEscherProperty(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT));
+ opt.setEscherProperty(new EscherRGBProperty(EscherPropertyTypes.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT));
+ opt.setEscherProperty(new EscherBoolProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE));
+ opt.setEscherProperty(new EscherBoolProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x080000));
EscherRecord anchor = getAnchor().getEscherAnchor();
clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
@@ -140,7 +154,7 @@ public class HSSFTextbox extends HSSFSim
* @return Returns the left margin within the textbox.
*/
public int getMarginLeft() {
- EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TEXT__TEXTLEFT);
+ EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TEXT__TEXTLEFT);
return property == null ? 0 : property.getPropertyValue();
}
@@ -148,14 +162,14 @@ public class HSSFTextbox extends HSSFSim
* Sets the left margin within the textbox.
*/
public void setMarginLeft(int marginLeft) {
- setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__TEXTLEFT, marginLeft));
+ setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTLEFT, marginLeft));
}
/**
* @return returns the right margin within the textbox.
*/
public int getMarginRight() {
- EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TEXT__TEXTRIGHT);
+ EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TEXT__TEXTRIGHT);
return property == null ? 0 : property.getPropertyValue();
}
@@ -163,14 +177,14 @@ public class HSSFTextbox extends HSSFSim
* Sets the right margin within the textbox.
*/
public void setMarginRight(int marginRight) {
- setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__TEXTRIGHT, marginRight));
+ setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTRIGHT, marginRight));
}
/**
* @return returns the top margin within the textbox.
*/
public int getMarginTop() {
- EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TEXT__TEXTTOP);
+ EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TEXT__TEXTTOP);
return property == null ? 0 : property.getPropertyValue();
}
@@ -178,14 +192,14 @@ public class HSSFTextbox extends HSSFSim
* Sets the top margin within the textbox.
*/
public void setMarginTop(int marginTop) {
- setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__TEXTTOP, marginTop));
+ setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTTOP, marginTop));
}
/**
* Gets the bottom margin within the textbox.
*/
public int getMarginBottom() {
- EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TEXT__TEXTBOTTOM);
+ EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TEXT__TEXTBOTTOM);
return property == null ? 0 : property.getPropertyValue();
}
@@ -193,7 +207,7 @@ public class HSSFTextbox extends HSSFSim
* Sets the bottom margin within the textbox.
*/
public void setMarginBottom(int marginBottom) {
- setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__TEXTBOTTOM, marginBottom));
+ setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTBOTTOM, marginBottom));
}
/**
Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/PictureData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/PictureData.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/usermodel/PictureData.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/usermodel/PictureData.java Sat Oct 12 16:32:53 2019
@@ -38,7 +38,7 @@ public interface PictureData {
/** GIF image format */
GIF(-1,8,"image/gif",".gif"),
/** Tag Image File (.tiff) */
- TIFF(-1,9,"image/tiff",".tif"),
+ TIFF(17,9,"image/tiff",".tif"),
/** Encapsulated Postscript (.eps) */
EPS(-1,10,"image/x-eps",".eps"),
/** Windows Bitmap (.bmp) */
@@ -48,7 +48,15 @@ public interface PictureData {
/** Microsoft Windows Media Photo image (.wdp) */
WDP(-1,13,"image/vnd.ms-photo",".wdp"),
/** Scalable vector graphics (.svg) - supported by Office 2016 and higher */
- SVG(-1, -1, "image/svg+xml", ".svg")
+ SVG(-1, -1, "image/svg+xml", ".svg"),
+ /** Unknown picture type - specific to escher bse record */
+ UNKNOWN(1, -1, "", ".dat"),
+ /** Picture type error - specific to escher bse record */
+ ERROR(0, -1, "", ".dat"),
+ /** JPEG in the YCCK or CMYK color space. */
+ CMYKJPEG( 18, -1, "image/jpeg", ".jpg"),
+ /** client defined blip type - native-id 32 to 255 */
+ CLIENT( 32, -1, "", ".dat")
;
public final int nativeId, ooxmlId;
@@ -65,7 +73,7 @@ public interface PictureData {
for (PictureType ans : values()) {
if (ans.nativeId == nativeId) return ans;
}
- return null;
+ return nativeId >= CLIENT.nativeId ? CLIENT : UNKNOWN;
}
public static PictureType forOoxmlID(int ooxmlId) {
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=1868352&r1=1868351&r2=1868352&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 Sat Oct 12 16:32:53 2019
@@ -20,7 +20,7 @@ package org.apache.poi.hslf.model;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherComplexProperty;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.hslf.exceptions.HSLFException;
import org.apache.poi.hslf.record.Document;
@@ -79,11 +79,11 @@ public final class ActiveXShape extends
spRecord.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE | EscherSpRecord.FLAG_OLESHAPE);
setShapeType(ShapeType.HOST_CONTROL);
- setEscherProperty(EscherProperties.BLIP__PICTUREID, idx);
- setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001);
- setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008);
- setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
- setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, -1);
+ setEscherProperty(EscherPropertyTypes.BLIP__PICTUREID, idx);
+ setEscherProperty(EscherPropertyTypes.LINESTYLE__COLOR, 0x8000001);
+ setEscherProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x80008);
+ setEscherProperty(EscherPropertyTypes.SHADOWSTYLE__COLOR, 0x8000002);
+ setEscherProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, -1);
HSLFEscherClientDataRecord cldata = getClientData(true);
cldata.addChild(new ExObjRefAtom());
@@ -155,7 +155,8 @@ public final class ActiveXShape extends
String name = ctrl.getProgId() + "-" + getControlIndex() + '\u0000';
byte[] data = StringUtil.getToUnicodeLE(name);
- EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.GROUPSHAPE__SHAPENAME, false, data);
+ EscherComplexProperty prop = new EscherComplexProperty(EscherPropertyTypes.GROUPSHAPE__SHAPENAME, false, data.length);
+ prop.setComplexData(data);
AbstractEscherOptRecord opt = getEscherOptRecord();
opt.addEscherProperty(prop);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/HSLFMetroShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/HSLFMetroShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/HSLFMetroShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/HSLFMetroShape.java Sat Oct 12 16:32:53 2019
@@ -21,7 +21,7 @@ import java.lang.reflect.Method;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherComplexProperty;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherTertiaryOptRecord;
import org.apache.poi.hslf.usermodel.HSLFShape;
import org.apache.poi.sl.usermodel.Shape;
@@ -60,7 +60,7 @@ public class HSLFMetroShape<T extends Sh
private EscherComplexProperty getMetroProp() {
AbstractEscherOptRecord opt = shape.getEscherChild(EscherTertiaryOptRecord.RECORD_ID);
- return (opt == null) ? null : (EscherComplexProperty)opt.lookup(EscherProperties.GROUPSHAPE__METROBLOB);
+ return (opt == null) ? null : (EscherComplexProperty)opt.lookup(EscherPropertyTypes.GROUPSHAPE__METROBLOB.propNumber);
}
/**
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java Sat Oct 12 16:32:53 2019
@@ -18,7 +18,7 @@
package org.apache.poi.hslf.model;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.hslf.record.AnimationInfo;
import org.apache.poi.hslf.record.AnimationInfoAtom;
import org.apache.poi.hslf.record.ExMCIMovie;
@@ -90,8 +90,8 @@ public final class MovieShape extends HS
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
EscherContainerRecord ecr = super.createSpContainer(idx, isChild);
- setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x1000100);
- setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x10001);
+ setEscherProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 0x1000100);
+ setEscherProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, 0x10001);
ExObjRefAtom oe = new ExObjRefAtom();
InteractiveInfo info = new InteractiveInfo();
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=1868352&r1=1868351&r2=1868352&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 Sat Oct 12 16:32:53 2019
@@ -17,15 +17,22 @@
package org.apache.poi.hslf.model;
-import org.apache.poi.ddf.*;
-import org.apache.poi.hslf.usermodel.*;
+import java.awt.geom.Point2D;
+
+import org.apache.poi.ddf.AbstractEscherOptRecord;
+import org.apache.poi.ddf.EscherArrayProperty;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherPropertyTypes;
+import org.apache.poi.ddf.EscherSimpleProperty;
+import org.apache.poi.hslf.usermodel.HSLFAutoShape;
+import org.apache.poi.hslf.usermodel.HSLFGroupShape;
+import org.apache.poi.hslf.usermodel.HSLFShape;
+import org.apache.poi.hslf.usermodel.HSLFTextParagraph;
import org.apache.poi.sl.usermodel.ShapeContainer;
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.Units;
-import java.awt.geom.Point2D;
-
/**
* A simple closed polygon shape
*
@@ -76,8 +83,8 @@ public final class Polygon extends HSLFA
float top = findSmallest(yPoints);
AbstractEscherOptRecord opt = getEscherOptRecord();
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, Units.pointsToMaster(right - left)));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, Units.pointsToMaster(bottom - top)));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__RIGHT, Units.pointsToMaster(right - left)));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__BOTTOM, Units.pointsToMaster(bottom - top)));
for (int i = 0; i < xPoints.length; i++) {
xPoints[i] += -left;
@@ -86,7 +93,7 @@ public final class Polygon extends HSLFA
int numpoints = xPoints.length;
- EscherArrayProperty verticesProp = new EscherArrayProperty(EscherProperties.GEOMETRY__VERTICES, false, new byte[0] );
+ EscherArrayProperty verticesProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__VERTICES, false, 0);
verticesProp.setNumberOfElementsInArray(numpoints+1);
verticesProp.setNumberOfElementsInMemory(numpoints+1);
verticesProp.setSizeOfElements(0xFFF0);
@@ -103,7 +110,7 @@ public final class Polygon extends HSLFA
verticesProp.setElement(numpoints, data);
opt.addEscherProperty(verticesProp);
- EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherProperties.GEOMETRY__SEGMENTINFO, false, null );
+ EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__SEGMENTINFO, false, 0);
segmentsProp.setSizeOfElements(0x0002);
segmentsProp.setNumberOfElementsInArray(numpoints * 2 + 4);
segmentsProp.setNumberOfElementsInMemory(numpoints * 2 + 4);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java Sat Oct 12 16:32:53 2019
@@ -94,16 +94,6 @@ public class EscherPlaceholder extends E
}
@Override
- protected Object[][] getAttributeMap() {
- return new Object[][] {
- { "position", position },
- { "placementId", placementId },
- { "placehoder size", size },
- { "unused", unused }
- };
- }
-
- @Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java Sat Oct 12 16:32:53 2019
@@ -35,7 +35,7 @@ import org.apache.poi.ddf.EscherBoolProp
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherDgRecord;
import org.apache.poi.ddf.EscherOptRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRGBProperty;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
@@ -331,14 +331,14 @@ public final class PPDrawing extends Rec
EscherOptRecord opt = new EscherOptRecord();
opt.setRecordId(EscherOptRecord.RECORD_ID);
- opt.addEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, 134217728));
- opt.addEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLBACKCOLOR, 134217733));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.FILL__RECTRIGHT, 10064750));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.FILL__RECTBOTTOM, 7778750));
- opt.addEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, 1179666));
- opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 524288));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.SHAPE__BLACKANDWHITESETTINGS, 9));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.SHAPE__BACKGROUNDSHAPE, 65537));
+ opt.addEscherProperty(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, 134217728));
+ opt.addEscherProperty(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLBACKCOLOR, 134217733));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.FILL__RECTRIGHT, 10064750));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.FILL__RECTBOTTOM, 7778750));
+ opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, 1179666));
+ opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 524288));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.SHAPE__BLACKANDWHITESETTINGS, 9));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.SHAPE__BACKGROUNDSHAPE, 65537));
spContainer.addChildRecord(opt);
dgContainer.addChildRecord(spContainer);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFAutoShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFAutoShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFAutoShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFAutoShape.java Sat Oct 12 16:32:53 2019
@@ -27,8 +27,7 @@ import java.util.List;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherArrayProperty;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
-import org.apache.poi.ddf.EscherProperty;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.sl.draw.binding.CTAdjPoint2D;
import org.apache.poi.sl.draw.binding.CTCustomGeometry2D;
@@ -73,6 +72,19 @@ public class HSLFAutoShape extends HSLFT
private static final BitField PATH_INFO = BitFieldFactory.getInstance(0xE000);
private static final BitField ESCAPE_INFO = BitFieldFactory.getInstance(0x1F00);
+ private static final EscherPropertyTypes[] ADJUST_VALUES = {
+ EscherPropertyTypes.GEOMETRY__ADJUSTVALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST2VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST3VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST4VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST5VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST6VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST7VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST8VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST9VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST10VALUE
+ };
+
enum PathInfo {
lineTo(0),curveTo(1),moveTo(2),close(3),end(4),escape(5),clientEscape(6);
private final int flag;
@@ -153,14 +165,14 @@ public class HSLFAutoShape extends HSLFT
setShapeType(shapeType);
//set default properties for an autoshape
- setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x40000);
- setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004);
- setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004);
- setEscherProperty(EscherProperties.FILL__FILLBACKCOLOR, 0x8000000);
- setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x100010);
- setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001);
- setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008);
- setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
+ setEscherProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 0x40000);
+ setEscherProperty(EscherPropertyTypes.FILL__FILLCOLOR, 0x8000004);
+ setEscherProperty(EscherPropertyTypes.FILL__FILLCOLOR, 0x8000004);
+ setEscherProperty(EscherPropertyTypes.FILL__FILLBACKCOLOR, 0x8000000);
+ setEscherProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, 0x100010);
+ setEscherProperty(EscherPropertyTypes.LINESTYLE__COLOR, 0x8000001);
+ setEscherProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x80008);
+ setEscherProperty(EscherPropertyTypes.SHADOWSTYLE__COLOR, 0x8000002);
return ecr;
}
@@ -184,8 +196,7 @@ public class HSLFAutoShape extends HSLFT
*/
public int getAdjustmentValue(int idx){
if(idx < 0 || idx > 9) throw new IllegalArgumentException("The index of an adjustment value must be in the [0, 9] range");
-
- return getEscherProperty((short)(EscherProperties.GEOMETRY__ADJUSTVALUE + idx));
+ return getEscherProperty(ADJUST_VALUES[idx]);
}
/**
@@ -200,8 +211,7 @@ public class HSLFAutoShape extends HSLFT
*/
public void setAdjustmentValue(int idx, int val){
if(idx < 0 || idx > 9) throw new IllegalArgumentException("The index of an adjustment value must be in the [0, 9] range");
-
- setEscherProperty((short)(EscherProperties.GEOMETRY__ADJUSTVALUE + idx), val);
+ setEscherProperty(ADJUST_VALUES[idx], val);
}
@Override
@@ -219,8 +229,8 @@ public class HSLFAutoShape extends HSLFT
final AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherArrayProperty verticesProp = getShapeProp(opt, EscherProperties.GEOMETRY__VERTICES);
- EscherArrayProperty segmentsProp = getShapeProp(opt, EscherProperties.GEOMETRY__SEGMENTINFO);
+ EscherArrayProperty verticesProp = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__VERTICES);
+ EscherArrayProperty segmentsProp = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__SEGMENTINFO);
// return empty path if either GEOMETRY__VERTICES or GEOMETRY__SEGMENTINFO is missing, see Bugzilla 54188
@@ -299,17 +309,17 @@ public class HSLFAutoShape extends HSLFT
}
}
- EscherSimpleProperty shapePath = getShapeProp(opt, EscherProperties.GEOMETRY__SHAPEPATH);
+ EscherSimpleProperty shapePath = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__SHAPEPATH);
HSLFFreeformShape.ShapePath sp = HSLFFreeformShape.ShapePath.valueOf(shapePath == null ? 1 : shapePath.getPropertyValue());
if ((sp == HSLFFreeformShape.ShapePath.LINES_CLOSED || sp == HSLFFreeformShape.ShapePath.CURVES_CLOSED) && !isClosed) {
moveLst.add(of.createCTPath2DClose());
path2D.closePath();
}
- EscherSimpleProperty geoLeft = getShapeProp(opt, EscherProperties.GEOMETRY__LEFT);
- EscherSimpleProperty geoRight = getShapeProp(opt, EscherProperties.GEOMETRY__RIGHT);
- EscherSimpleProperty geoTop = getShapeProp(opt, EscherProperties.GEOMETRY__TOP);
- EscherSimpleProperty geoBottom = getShapeProp(opt, EscherProperties.GEOMETRY__BOTTOM);
+ EscherSimpleProperty geoLeft = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__LEFT);
+ EscherSimpleProperty geoRight = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__RIGHT);
+ EscherSimpleProperty geoTop = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__TOP);
+ EscherSimpleProperty geoBottom = getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__BOTTOM);
final Rectangle2D bounds;
if (geoLeft != null && geoRight != null && geoTop != null && geoBottom != null) {
@@ -438,14 +448,6 @@ public class HSLFAutoShape extends HSLFT
}
- private static <T extends EscherProperty> T getShapeProp(AbstractEscherOptRecord opt, int propId) {
- T prop = getEscherProperty(opt, (short)(propId + 0x4000));
- if (prop == null) {
- prop = getEscherProperty(opt, propId);
- }
- return prop;
- }
-
private CTAdjPoint2D fillPoint(byte[] xyMaster, int[] xyPoints) {
if (xyMaster == null || xyPoints == null) {
LOG.log(POILogger.WARN, "Master bytes or points not set - ignore point");
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFill.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFill.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFill.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFill.java Sat Oct 12 16:32:53 2019
@@ -27,7 +27,7 @@ import org.apache.poi.ddf.EscherArrayPro
import org.apache.poi.ddf.EscherBSERecord;
import org.apache.poi.ddf.EscherColorRef;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
@@ -258,14 +258,14 @@ public final class HSLFFill {
// NOFILLHITTEST can be in the normal escher opt record but also in the tertiary record
// the extended bit fields seem to be in the second
AbstractEscherOptRecord opt = shape.getEscherChild(EscherRecordTypes.USER_DEFINED);
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST);
int propVal = (p == null) ? 0 : p.getPropertyValue();
return FILL_USE_USE_SHAPE_ANCHOR.isSet(propVal) && FILL_USE_SHAPE_ANCHOR.isSet(propVal);
}
private GradientPaint getGradientPaint(final GradientType gradientType) {
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- final EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
+ final EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__SHADECOLORS);
final int colorCnt = (ep == null) ? 0 : ep.getNumberOfElementsInArray();
return new GradientPaint() {
@@ -274,7 +274,7 @@ public final class HSLFFill {
// A value of type FixedPoint, as specified in [MS-OSHARED] section 2.2.1.6,
// that specifies the angle of the gradient fill. Zero degrees represents a vertical vector from
// bottom to top. The default value for this property is 0x00000000.
- int rot = shape.getEscherProperty(EscherProperties.FILL__ANGLE);
+ int rot = shape.getEscherProperty(EscherPropertyTypes.FILL__ANGLE);
return 90-Units.fixedPointToDouble(rot);
}
@@ -348,7 +348,7 @@ public final class HSLFFill {
@Override
public int getAlpha() {
- return (int)(shape.getAlpha(EscherProperties.FILL__FILLOPACITY)*100000.0);
+ return (int)(shape.getAlpha(EscherPropertyTypes.FILL__FILLOPACITY)*100000.0);
}
@Override
@@ -366,13 +366,13 @@ public final class HSLFFill {
*/
public int getFillType(){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- EscherSimpleProperty prop = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__FILLTYPE);
+ EscherSimpleProperty prop = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__FILLTYPE);
return prop == null ? FILL_SOLID : prop.getPropertyValue();
}
void afterInsert(HSLFSheet sh){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__PATTERNTEXTURE);
if(p != null) {
int idx = p.getPropertyValue();
EscherBSERecord bse = getEscherBSERecord(idx);
@@ -409,7 +409,7 @@ public final class HSLFFill {
*/
public void setFillType(int type){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLTYPE, type);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__FILLTYPE, type);
}
/**
@@ -417,11 +417,11 @@ public final class HSLFFill {
*/
public Color getForegroundColor(){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST);
int propVal = (p == null) ? 0 : p.getPropertyValue();
return (FILL_USE_FILLED.isSet(propVal) && FILL_FILLED.isSet(propVal))
- ? shape.getColor(EscherProperties.FILL__FILLCOLOR, EscherProperties.FILL__FILLOPACITY)
+ ? shape.getColor(EscherPropertyTypes.FILL__FILLCOLOR, EscherPropertyTypes.FILL__FILLOPACITY)
: null;
}
@@ -430,20 +430,20 @@ public final class HSLFFill {
*/
public void setForegroundColor(Color color){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- opt.removeEscherProperty(EscherProperties.FILL__FILLOPACITY);
- opt.removeEscherProperty(EscherProperties.FILL__FILLCOLOR);
+ opt.removeEscherProperty(EscherPropertyTypes.FILL__FILLOPACITY);
+ opt.removeEscherProperty(EscherPropertyTypes.FILL__FILLCOLOR);
if (color != null) {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 0).getRGB();
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLCOLOR, rgb);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__FILLCOLOR, rgb);
int alpha = color.getAlpha();
if (alpha < 255) {
int alphaFP = Units.doubleToFixedPoint(alpha/255d);
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLOPACITY, alphaFP);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__FILLOPACITY, alphaFP);
}
}
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST);
int propVal = (p == null) ? 0 : p.getPropertyValue();
propVal = FILL_FILLED.setBoolean(propVal, color != null);
propVal = FILL_NO_FILL_HIT_TEST.setBoolean(propVal, color != null);
@@ -453,7 +453,7 @@ public final class HSLFFill {
// TODO: check why we always clear this ...
propVal = FILL_FILL_SHAPE.clear(propVal);
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, propVal);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST, propVal);
}
/**
@@ -461,11 +461,11 @@ public final class HSLFFill {
*/
public Color getBackgroundColor(){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST);
int propVal = (p == null) ? 0 : p.getPropertyValue();
return (FILL_USE_FILLED.isSet(propVal) && FILL_FILLED.isSet(propVal))
- ? shape.getColor(EscherProperties.FILL__FILLBACKCOLOR, EscherProperties.FILL__FILLOPACITY)
+ ? shape.getColor(EscherPropertyTypes.FILL__FILLBACKCOLOR, EscherPropertyTypes.FILL__FILLOPACITY)
: null;
}
@@ -475,11 +475,11 @@ public final class HSLFFill {
public void setBackgroundColor(Color color){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
if (color == null) {
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLBACKCOLOR, -1);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__FILLBACKCOLOR, -1);
}
else {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 0).getRGB();
- HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLBACKCOLOR, rgb);
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__FILLBACKCOLOR, rgb);
}
}
@@ -489,7 +489,7 @@ public final class HSLFFill {
@SuppressWarnings("resource")
public HSLFPictureData getPictureData(){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
+ EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__PATTERNTEXTURE);
if (p == null) {
return null;
}
@@ -524,7 +524,7 @@ public final class HSLFFill {
*/
public void setPictureData(HSLFPictureData data){
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
- HSLFShape.setEscherProperty(opt, (short)(EscherProperties.FILL__PATTERNTEXTURE + 0x4000), (data == null ? 0 : data.getIndex()));
+ HSLFShape.setEscherProperty(opt, EscherPropertyTypes.FILL__PATTERNTEXTURE, true, (data == null ? 0 : data.getIndex()));
if(data != null && shape.getSheet() != null) {
EscherBSERecord bse = getEscherBSERecord(data.getIndex());
if (bse != null) {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java Sat Oct 12 16:32:53 2019
@@ -28,7 +28,7 @@ import java.util.List;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherArrayProperty;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.sl.usermodel.FreeformShape;
import org.apache.poi.sl.usermodel.ShapeContainer;
@@ -162,9 +162,9 @@ public final class HSLFFreeformShape ext
segInfo.add(SEGMENTINFO_END);
AbstractEscherOptRecord opt = getEscherOptRecord();
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__SHAPEPATH, 0x4));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__SHAPEPATH, 0x4));
- EscherArrayProperty verticesProp = new EscherArrayProperty((short)(EscherProperties.GEOMETRY__VERTICES + 0x4000), false, null);
+ EscherArrayProperty verticesProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__VERTICES, true, 0);
verticesProp.setNumberOfElementsInArray(pntInfo.size());
verticesProp.setNumberOfElementsInMemory(pntInfo.size());
verticesProp.setSizeOfElements(8);
@@ -177,7 +177,7 @@ public final class HSLFFreeformShape ext
}
opt.addEscherProperty(verticesProp);
- EscherArrayProperty segmentsProp = new EscherArrayProperty((short)(EscherProperties.GEOMETRY__SEGMENTINFO + 0x4000), false, null);
+ EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__SEGMENTINFO, true, 0);
segmentsProp.setNumberOfElementsInArray(segInfo.size());
segmentsProp.setNumberOfElementsInMemory(segInfo.size());
segmentsProp.setSizeOfElements(0x2);
@@ -187,8 +187,8 @@ public final class HSLFFreeformShape ext
}
opt.addEscherProperty(segmentsProp);
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, Units.pointsToMaster(bounds.getWidth())));
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, Units.pointsToMaster(bounds.getHeight())));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__RIGHT, Units.pointsToMaster(bounds.getWidth())));
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__BOTTOM, Units.pointsToMaster(bounds.getHeight())));
opt.sortProperties();
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java Sat Oct 12 16:32:53 2019
@@ -19,7 +19,7 @@ package org.apache.poi.hslf.usermodel;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.sl.usermodel.Line;
import org.apache.poi.sl.usermodel.ShapeContainer;
@@ -58,12 +58,12 @@ public final class HSLFLine extends HSLF
AbstractEscherOptRecord opt = getEscherOptRecord();
//default line properties
- setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);
- setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000);
- setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000);
- setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001);
- setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
- setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
+ setEscherProperty(opt, EscherPropertyTypes.GEOMETRY__SHAPEPATH, 4);
+ setEscherProperty(opt, EscherPropertyTypes.GEOMETRY__FILLOK, 0x10000);
+ setEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST, 0x100000);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__COLOR, 0x8000001);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
+ setEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__COLOR, 0x8000002);
return ecr;
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFObjectShape.java Sat Oct 12 16:32:53 2019
@@ -23,7 +23,7 @@ import java.io.IOException;
import java.io.OutputStream;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.hslf.record.ExEmbed;
import org.apache.poi.hslf.record.ExObjList;
@@ -86,7 +86,7 @@ public final class HSLFObjectShape exten
* @return the unique identifier for the OLE object
*/
public int getObjectID(){
- return getEscherProperty(EscherProperties.BLIP__PICTUREID);
+ return getEscherProperty(EscherPropertyTypes.BLIP__PICTUREID);
}
/**
@@ -96,7 +96,7 @@ public final class HSLFObjectShape exten
* @param objectId the unique identifier for the OLE object
*/
public void setObjectID(int objectId){
- setEscherProperty(EscherProperties.BLIP__PICTUREID, objectId);
+ setEscherProperty(EscherPropertyTypes.BLIP__PICTUREID, objectId);
EscherContainerRecord ecr = getSpContainer();
EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java Sat Oct 12 16:32:53 2019
@@ -25,7 +25,7 @@ import org.apache.poi.ddf.AbstractEscher
import org.apache.poi.ddf.EscherBSERecord;
import org.apache.poi.ddf.EscherComplexProperty;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
@@ -86,7 +86,7 @@ public class HSLFPictureShape extends HS
*/
public int getPictureIndex(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.BLIP__BLIPTODISPLAY);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.BLIP__BLIPTODISPLAY);
return prop == null ? 0 : prop.getPropertyValue();
}
@@ -104,10 +104,10 @@ public class HSLFPictureShape extends HS
//set default properties for a picture
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x800080);
+ setEscherProperty(opt, EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 0x800080);
//another weird feature of powerpoint: for picture id we must add 0x4000.
- setEscherProperty(opt, (short)(EscherProperties.BLIP__BLIPTODISPLAY + 0x4000), idx);
+ setEscherProperty(opt, EscherPropertyTypes.BLIP__BLIPTODISPLAY, true, idx);
return ecr;
}
@@ -158,7 +158,7 @@ public class HSLFPictureShape extends HS
*/
public String getPictureName(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherComplexProperty prop = getEscherProperty(opt, EscherProperties.BLIP__BLIPFILENAME);
+ EscherComplexProperty prop = getEscherProperty(opt, EscherPropertyTypes.BLIP__BLIPFILENAME);
if (prop == null) return null;
String name = StringUtil.getFromUnicodeLE(prop.getComplexData());
return name.trim();
@@ -172,7 +172,8 @@ public class HSLFPictureShape extends HS
public void setPictureName(String name){
AbstractEscherOptRecord opt = getEscherOptRecord();
byte[] data = StringUtil.getToUnicodeLE(name + '\u0000');
- EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, false, data);
+ EscherComplexProperty prop = new EscherComplexProperty(EscherPropertyTypes.BLIP__BLIPFILENAME, false, data.length);
+ prop.setComplexData(data);
opt.addEscherProperty(prop);
}
@@ -199,10 +200,10 @@ public class HSLFPictureShape extends HS
// i.e. the size of the already clipped image
AbstractEscherOptRecord opt = getEscherOptRecord();
- double top = getFractProp(opt, EscherProperties.BLIP__CROPFROMTOP);
- double bottom = getFractProp(opt, EscherProperties.BLIP__CROPFROMBOTTOM);
- double left = getFractProp(opt, EscherProperties.BLIP__CROPFROMLEFT);
- double right = getFractProp(opt, EscherProperties.BLIP__CROPFROMRIGHT);
+ double top = getFractProp(opt, EscherPropertyTypes.BLIP__CROPFROMTOP);
+ double bottom = getFractProp(opt, EscherPropertyTypes.BLIP__CROPFROMBOTTOM);
+ double left = getFractProp(opt, EscherPropertyTypes.BLIP__CROPFROMLEFT);
+ double right = getFractProp(opt, EscherPropertyTypes.BLIP__CROPFROMRIGHT);
// if all crop values are zero (the default) then no crop rectangle is set, return null
return (top==0 && bottom==0 && left==0 && right==0)
@@ -220,8 +221,8 @@ public class HSLFPictureShape extends HS
/**
* @return the fractional property or 0 if not defined
*/
- private static double getFractProp(AbstractEscherOptRecord opt, short propertyId) {
- EscherSimpleProperty prop = getEscherProperty(opt, propertyId);
+ private static double getFractProp(AbstractEscherOptRecord opt, EscherPropertyTypes type) {
+ EscherSimpleProperty prop = getEscherProperty(opt, type);
if (prop == null) return 0;
int fixedPoint = prop.getPropertyValue();
return Units.fixedPointToDouble(fixedPoint);
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java Sat Oct 12 16:32:53 2019
@@ -32,8 +32,8 @@ import org.apache.poi.ddf.EscherColorRef
import org.apache.poi.ddf.EscherColorRef.SysIndexSource;
import org.apache.poi.ddf.EscherComplexProperty;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherProperty;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
@@ -50,6 +50,7 @@ import org.apache.poi.sl.usermodel.Shape
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
+import org.apache.poi.util.Removal;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.Units;
@@ -127,7 +128,7 @@ public abstract class HSLFShape implemen
*/
@Override
public String getShapeName(){
- final EscherComplexProperty ep = getEscherProperty(getEscherOptRecord(), EscherProperties.GROUPSHAPE__SHAPENAME);
+ final EscherComplexProperty ep = getEscherProperty(getEscherOptRecord(), EscherPropertyTypes.GROUPSHAPE__SHAPENAME);
if (ep != null) {
final byte[] cd = ep.getComplexData();
return StringUtil.getFromUnicodeLE0Terminated(cd, 0, cd.length/2);
@@ -260,20 +261,37 @@ public abstract class HSLFShape implemen
* Returns escher property by id.
*
* @return escher property or <code>null</code> if not found.
+ *
+ * @deprecated use {@link #getEscherProperty(EscherPropertyTypes)} instead
*/
+ @Deprecated
+ @Removal(version = "5.0.0")
public static <T extends EscherProperty> T getEscherProperty(AbstractEscherOptRecord opt, int propId){
return (opt == null) ? null : opt.lookup(propId);
}
/**
+ * Returns escher property by type.
+ *
+ * @return escher property or <code>null</code> if not found.
+ */
+ public static <T extends EscherProperty> T getEscherProperty(AbstractEscherOptRecord opt, EscherPropertyTypes type){
+ return (opt == null) ? null : opt.lookup(type);
+ }
+
+ /**
* Set an escher property for this shape.
*
* @param opt The opt record to set the properties to.
* @param propId The id of the property. One of the constants defined in EscherOptRecord.
* @param value value of the property. If value = -1 then the property is removed.
+ *
+ * @deprecated use {@link #setEscherProperty(AbstractEscherOptRecord, EscherPropertyTypes, int)}
*/
- public static void setEscherProperty(AbstractEscherOptRecord opt, short propId, int value){
- java.util.List<EscherProperty> props = opt.getEscherProperties();
+ @Deprecated
+ @Removal(version = "5.0.0")
+ public static void setEscherProperty(AbstractEscherOptRecord opt, short propId, int value){
+ List<EscherProperty> props = opt.getEscherProperties();
for ( Iterator<EscherProperty> iterator = props.iterator(); iterator.hasNext(); ) {
if (iterator.next().getPropertyNumber() == propId){
iterator.remove();
@@ -287,23 +305,65 @@ public abstract class HSLFShape implemen
}
/**
+ * Set an escher property for this shape.
+ *
+ * @param opt The opt record to set the properties to.
+ * @param propType The type of the property.
+ * @param value value of the property. If value = -1 then the property is removed.
+ */
+ public static void setEscherProperty(AbstractEscherOptRecord opt, EscherPropertyTypes propType, int value){
+ setEscherProperty(opt, propType, false, value);
+ }
+
+ public static void setEscherProperty(AbstractEscherOptRecord opt, EscherPropertyTypes propType, boolean isBlipId, int value){
+ List<EscherProperty> props = opt.getEscherProperties();
+ for ( Iterator<EscherProperty> iterator = props.iterator(); iterator.hasNext(); ) {
+ if (iterator.next().getPropertyNumber() == propType.propNumber){
+ iterator.remove();
+ break;
+ }
+ }
+ if (value != -1) {
+ opt.addEscherProperty(new EscherSimpleProperty(propType, false, isBlipId, value));
+ opt.sortProperties();
+ }
+ }
+
+
+
+ /**
* Set an simple escher property for this shape.
*
* @param propId The id of the property. One of the constants defined in EscherOptRecord.
* @param value value of the property. If value = -1 then the property is removed.
+ *
+ * @deprecated use {@link #setEscherProperty(EscherPropertyTypes, int)}
*/
+ @Deprecated
+ @Removal(version = "5.0.0")
public void setEscherProperty(short propId, int value){
AbstractEscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, propId, value);
}
/**
+ * Set an simple escher property for this shape.
+ *
+ * @param propType The type of the property.
+ * @param value value of the property. If value = -1 then the property is removed.
+ */
+ public void setEscherProperty(EscherPropertyTypes propType, int value){
+ AbstractEscherOptRecord opt = getEscherOptRecord();
+ setEscherProperty(opt, propType, value);
+ }
+
+ /**
* Get the value of a simple escher property for this shape.
*
* @param propId The id of the property. One of the constants defined in EscherOptRecord.
*/
- public int getEscherProperty(short propId){
- AbstractEscherOptRecord opt = getEscherOptRecord();
+ public int getEscherProperty(short propId){
+ AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, propId);
return prop == null ? 0 : prop.getPropertyValue();
}
@@ -311,15 +371,41 @@ public abstract class HSLFShape implemen
/**
* Get the value of a simple escher property for this shape.
*
+ * @param propType The type of the property. One of the constants defined in EscherOptRecord.
+ */
+ public int getEscherProperty(EscherPropertyTypes propType){
+ AbstractEscherOptRecord opt = getEscherOptRecord();
+ EscherSimpleProperty prop = getEscherProperty(opt, propType);
+ return prop == null ? 0 : prop.getPropertyValue();
+ }
+
+ /**
+ * Get the value of a simple escher property for this shape.
+ *
* @param propId The id of the property. One of the constants defined in EscherOptRecord.
+ *
+ * @deprecated use {@link #getEscherProperty(EscherPropertyTypes, int)} instead
*/
- public int getEscherProperty(short propId, int defaultValue){
- AbstractEscherOptRecord opt = getEscherOptRecord();
+ @Deprecated
+ @Removal(version = "5.0.0")
+ public int getEscherProperty(short propId, int defaultValue){
+ AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, propId);
return prop == null ? defaultValue : prop.getPropertyValue();
}
/**
+ * Get the value of a simple escher property for this shape.
+ *
+ * @param type The type of the property.
+ */
+ public int getEscherProperty(EscherPropertyTypes type, int defaultValue){
+ AbstractEscherOptRecord opt = getEscherOptRecord();
+ EscherSimpleProperty prop = getEscherProperty(opt, type);
+ return prop == null ? defaultValue : prop.getPropertyValue();
+ }
+
+ /**
* @return The shape container and it's children that can represent this
* shape.
*/
@@ -358,7 +444,7 @@ public abstract class HSLFShape implemen
_sheet = sheet;
}
- Color getColor(short colorProperty, short opacityProperty){
+ Color getColor(EscherPropertyTypes colorProperty, EscherPropertyTypes opacityProperty){
final AbstractEscherOptRecord opt = getEscherOptRecord();
final EscherSimpleProperty colProp = getEscherProperty(opt, colorProperty);
final Color col;
@@ -509,7 +595,7 @@ public abstract class HSLFShape implemen
return col;
}
- double getAlpha(short opacityProperty) {
+ double getAlpha(EscherPropertyTypes opacityProperty) {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty op = getEscherProperty(opt, opacityProperty);
int defaultOpacity = 0x00010000;
@@ -607,13 +693,13 @@ public abstract class HSLFShape implemen
}
public double getRotation(){
- int rot = getEscherProperty(EscherProperties.TRANSFORM__ROTATION);
+ int rot = getEscherProperty(EscherPropertyTypes.TRANSFORM__ROTATION);
return Units.fixedPointToDouble(rot);
}
public void setRotation(double theta){
int rot = Units.doubleToFixedPoint(theta % 360.0);
- setEscherProperty(EscherProperties.TRANSFORM__ROTATION, rot);
+ setEscherProperty(EscherPropertyTypes.TRANSFORM__ROTATION, rot);
}
public boolean isPlaceholder() {
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java Sat Oct 12 16:32:53 2019
@@ -23,9 +23,9 @@ import org.apache.poi.ddf.AbstractEscher
import org.apache.poi.ddf.EscherClientDataRecord;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherOptRecord;
-import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherProperty;
import org.apache.poi.ddf.EscherPropertyFactory;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
@@ -71,7 +71,7 @@ public final class HSLFShapeFactory {
EscherPropertyFactory f = new EscherPropertyFactory();
List<EscherProperty> props = f.createProperties( opt.serialize(), 8, opt.getInstance() );
for (EscherProperty ep : props) {
- if (ep.getPropertyNumber() == EscherProperties.GROUPSHAPE__TABLEPROPERTIES
+ if (ep.getPropertyNumber() == EscherPropertyTypes.GROUPSHAPE__TABLEPROPERTIES.propNumber
&& ep instanceof EscherSimpleProperty
&& (((EscherSimpleProperty)ep).getPropertyValue() & 1) == 1) {
isTable = true;
@@ -150,7 +150,7 @@ public final class HSLFShapeFactory {
private static HSLFShape createNonPrimitive(EscherContainerRecord spContainer, ShapeContainer<HSLFShape,HSLFTextParagraph> parent) {
AbstractEscherOptRecord opt = HSLFShape.getEscherChild(spContainer, EscherOptRecord.RECORD_ID);
- EscherProperty prop = HSLFShape.getEscherProperty(opt, EscherProperties.GEOMETRY__VERTICES);
+ EscherProperty prop = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.GEOMETRY__VERTICES);
if(prop != null) {
return new HSLFFreeformShape(spContainer, parent);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapePlaceholderDetails.java Sat Oct 12 16:32:53 2019
@@ -17,7 +17,7 @@
package org.apache.poi.hslf.usermodel;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.hslf.exceptions.HSLFException;
import org.apache.poi.hslf.record.HSLFEscherClientDataRecord;
@@ -96,7 +96,7 @@ public class HSLFShapePlaceholderDetails
spRecord.setFlags(flags);
// Placeholders can't be grouped
- shape.setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, (placeholder == null ? -1 : 262144));
+ shape.setEscherProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, (placeholder == null ? -1 : 262144));
if (placeholder == null) {
removePlaceholder();
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java Sat Oct 12 16:32:53 2019
@@ -24,8 +24,8 @@ import org.apache.poi.ddf.EscherChildAnc
import org.apache.poi.ddf.EscherClientAnchorRecord;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherOptRecord;
-import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherProperty;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
@@ -62,6 +62,19 @@ public abstract class HSLFSimpleShape ex
public final static double DEFAULT_LINE_WIDTH = 0.75;
+ private static final EscherPropertyTypes[] ADJUST_VALUES = {
+ EscherPropertyTypes.GEOMETRY__ADJUSTVALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST2VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST3VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST4VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST5VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST6VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST7VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST8VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST9VALUE,
+ EscherPropertyTypes.GEOMETRY__ADJUST10VALUE
+ };
+
/**
* Hyperlink
*/
@@ -124,7 +137,7 @@ public abstract class HSLFSimpleShape ex
*/
public double getLineWidth(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEWIDTH);
return (prop == null) ? DEFAULT_LINE_WIDTH : Units.toPoints(prop.getPropertyValue());
}
@@ -134,7 +147,7 @@ public abstract class HSLFSimpleShape ex
*/
public void setLineWidth(double width){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH, Units.toEMU(width));
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEWIDTH, Units.toEMU(width));
}
/**
@@ -145,11 +158,11 @@ public abstract class HSLFSimpleShape ex
public void setLineColor(Color color){
AbstractEscherOptRecord opt = getEscherOptRecord();
if (color == null) {
- setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x80000);
} else {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 0).getRGB();
- setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, rgb);
- setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x180018);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__COLOR, rgb);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x180018);
}
}
@@ -159,13 +172,12 @@ public abstract class HSLFSimpleShape ex
public Color getLineColor(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty p = getEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH);
+ EscherSimpleProperty p = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH);
if(p != null && (p.getPropertyValue() & 0x8) == 0) {
return null;
}
- Color clr = getColor(EscherProperties.LINESTYLE__COLOR, EscherProperties.LINESTYLE__OPACITY);
- return clr == null ? null : clr;
+ return getColor(EscherPropertyTypes.LINESTYLE__COLOR, EscherPropertyTypes.LINESTYLE__OPACITY);
}
/**
@@ -174,13 +186,12 @@ public abstract class HSLFSimpleShape ex
public Color getLineBackgroundColor(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty p = getEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH);
+ EscherSimpleProperty p = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH);
if(p != null && (p.getPropertyValue() & 0x8) == 0) {
return null;
}
- Color clr = getColor(EscherProperties.LINESTYLE__BACKCOLOR, EscherProperties.LINESTYLE__OPACITY);
- return clr == null ? null : clr;
+ return getColor(EscherPropertyTypes.LINESTYLE__BACKCOLOR, EscherPropertyTypes.LINESTYLE__OPACITY);
}
/**
@@ -191,12 +202,12 @@ public abstract class HSLFSimpleShape ex
public void setLineBackgroundColor(Color color){
AbstractEscherOptRecord opt = getEscherOptRecord();
if (color == null) {
- setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000);
- opt.removeEscherProperty(EscherProperties.LINESTYLE__BACKCOLOR);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x80000);
+ opt.removeEscherProperty(EscherPropertyTypes.LINESTYLE__BACKCOLOR);
} else {
int rgb = new Color(color.getBlue(), color.getGreen(), color.getRed(), 0).getRGB();
- setEscherProperty(opt, EscherProperties.LINESTYLE__BACKCOLOR, rgb);
- setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x180018);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__BACKCOLOR, rgb);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x180018);
}
}
@@ -207,7 +218,7 @@ public abstract class HSLFSimpleShape ex
*/
public LineCap getLineCap(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDCAPSTYLE);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDCAPSTYLE);
return (prop == null) ? LineCap.FLAT : LineCap.fromNativeId(prop.getPropertyValue());
}
@@ -218,7 +229,7 @@ public abstract class HSLFSimpleShape ex
*/
public void setLineCap(LineCap pen){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDCAPSTYLE, pen == LineCap.FLAT ? -1 : pen.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDCAPSTYLE, pen == LineCap.FLAT ? -1 : pen.nativeId);
}
/**
@@ -228,7 +239,7 @@ public abstract class HSLFSimpleShape ex
*/
public LineDash getLineDash(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEDASHING);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEDASHING);
return (prop == null) ? LineDash.SOLID : LineDash.fromNativeId(prop.getPropertyValue());
}
@@ -239,7 +250,7 @@ public abstract class HSLFSimpleShape ex
*/
public void setLineDash(LineDash pen){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEDASHING, pen == LineDash.SOLID ? -1 : pen.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEDASHING, pen == LineDash.SOLID ? -1 : pen.nativeId);
}
/**
@@ -249,7 +260,7 @@ public abstract class HSLFSimpleShape ex
*/
public LineCompound getLineCompound() {
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTYLE);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTYLE);
return (prop == null) ? LineCompound.SINGLE : LineCompound.fromNativeId(prop.getPropertyValue());
}
@@ -260,7 +271,7 @@ public abstract class HSLFSimpleShape ex
*/
public void setLineCompound(LineCompound style){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINESTYLE, style == LineCompound.SINGLE ? -1 : style.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTYLE, style == LineCompound.SINGLE ? -1 : style.nativeId);
}
/**
@@ -295,7 +306,6 @@ public abstract class HSLFSimpleShape ex
public double getLineWidth() {
return HSLFSimpleShape.this.getLineWidth();
}
-
};
}
@@ -322,22 +332,13 @@ public abstract class HSLFSimpleShape ex
}
final int adjInt = Integer.parseInt(name);
-
- short escherProp;
- switch (adjInt) {
- case 1: escherProp = EscherProperties.GEOMETRY__ADJUSTVALUE; break;
- case 2: escherProp = EscherProperties.GEOMETRY__ADJUST2VALUE; break;
- case 3: escherProp = EscherProperties.GEOMETRY__ADJUST3VALUE; break;
- case 4: escherProp = EscherProperties.GEOMETRY__ADJUST4VALUE; break;
- case 5: escherProp = EscherProperties.GEOMETRY__ADJUST5VALUE; break;
- case 6: escherProp = EscherProperties.GEOMETRY__ADJUST6VALUE; break;
- case 7: escherProp = EscherProperties.GEOMETRY__ADJUST7VALUE; break;
- case 8: escherProp = EscherProperties.GEOMETRY__ADJUST8VALUE; break;
- case 9: escherProp = EscherProperties.GEOMETRY__ADJUST9VALUE; break;
- case 10: escherProp = EscherProperties.GEOMETRY__ADJUST10VALUE; break;
- default: throw new HSLFException();
+ if (adjInt < 1 || adjInt > 10) {
+ throw new HSLFException("invalid adjust value: "+adjInt);
}
+
+ EscherPropertyTypes escherProp = ADJUST_VALUES[adjInt];
+
int adjval = getEscherProperty(escherProp, -1);
if (adjval == -1) {
@@ -389,18 +390,18 @@ public abstract class HSLFSimpleShape ex
public double getShadowAngle() {
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETX);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__OFFSETX);
int offX = (prop == null) ? 0 : prop.getPropertyValue();
- prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETY);
+ prop = getEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__OFFSETY);
int offY = (prop == null) ? 0 : prop.getPropertyValue();
return Math.toDegrees(Math.atan2(offY, offX));
}
public double getShadowDistance() {
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETX);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__OFFSETX);
int offX = (prop == null) ? 0 : prop.getPropertyValue();
- prop = getEscherProperty(opt, EscherProperties.SHADOWSTYLE__OFFSETY);
+ prop = getEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__OFFSETY);
int offY = (prop == null) ? 0 : prop.getPropertyValue();
return Units.toPoints((long)Math.hypot(offX, offY));
}
@@ -409,7 +410,7 @@ public abstract class HSLFSimpleShape ex
* @return color of the line. If color is not set returns <code>java.awt.Color.black</code>
*/
public Color getShadowColor(){
- Color clr = getColor(EscherProperties.SHADOWSTYLE__COLOR, EscherProperties.SHADOWSTYLE__OPACITY);
+ Color clr = getColor(EscherPropertyTypes.SHADOWSTYLE__COLOR, EscherPropertyTypes.SHADOWSTYLE__OPACITY);
return clr == null ? Color.black : clr;
}
@@ -419,7 +420,7 @@ public abstract class HSLFSimpleShape ex
if (opt == null) {
return null;
}
- EscherProperty shadowType = opt.lookup(EscherProperties.SHADOWSTYLE__TYPE);
+ EscherProperty shadowType = opt.lookup(EscherPropertyTypes.SHADOWSTYLE__TYPE);
if (shadowType == null) {
return null;
}
@@ -456,68 +457,68 @@ public abstract class HSLFSimpleShape ex
public DecorationShape getLineHeadDecoration(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWHEAD);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWHEAD);
return (prop == null) ? null : DecorationShape.fromNativeId(prop.getPropertyValue());
}
public void setLineHeadDecoration(DecorationShape decoShape){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWHEAD, decoShape == null ? -1 : decoShape.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWHEAD, decoShape == null ? -1 : decoShape.nativeId);
}
public DecorationSize getLineHeadWidth(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWWIDTH);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWWIDTH);
return (prop == null) ? null : DecorationSize.fromNativeId(prop.getPropertyValue());
}
public void setLineHeadWidth(DecorationSize decoSize){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWWIDTH, decoSize == null ? -1 : decoSize.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWWIDTH, decoSize == null ? -1 : decoSize.nativeId);
}
public DecorationSize getLineHeadLength(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWLENGTH);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWLENGTH);
return (prop == null) ? null : DecorationSize.fromNativeId(prop.getPropertyValue());
}
public void setLineHeadLength(DecorationSize decoSize){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINESTARTARROWLENGTH, decoSize == null ? -1 : decoSize.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINESTARTARROWLENGTH, decoSize == null ? -1 : decoSize.nativeId);
}
public DecorationShape getLineTailDecoration(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWHEAD);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWHEAD);
return (prop == null) ? null : DecorationShape.fromNativeId(prop.getPropertyValue());
}
public void setLineTailDecoration(DecorationShape decoShape){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWHEAD, decoShape == null ? -1 : decoShape.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWHEAD, decoShape == null ? -1 : decoShape.nativeId);
}
public DecorationSize getLineTailWidth(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWWIDTH);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWWIDTH);
return (prop == null) ? null : DecorationSize.fromNativeId(prop.getPropertyValue());
}
public void setLineTailWidth(DecorationSize decoSize){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWWIDTH, decoSize == null ? -1 : decoSize.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWWIDTH, decoSize == null ? -1 : decoSize.nativeId);
}
public DecorationSize getLineTailLength(){
AbstractEscherOptRecord opt = getEscherOptRecord();
- EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWLENGTH);
+ EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWLENGTH);
return (prop == null) ? null : DecorationSize.fromNativeId(prop.getPropertyValue());
}
public void setLineTailLength(DecorationSize decoSize){
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWLENGTH, decoSize == null ? -1 : decoSize.nativeId);
+ setEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEENDARROWLENGTH, decoSize == null ? -1 : decoSize.nativeId);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java Sat Oct 12 16:32:53 2019
@@ -30,7 +30,7 @@ import org.apache.poi.ddf.AbstractEscher
import org.apache.poi.ddf.EscherArrayProperty;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherOptRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.sl.usermodel.ShapeContainer;
@@ -101,8 +101,8 @@ implements HSLFShapeContainer, TableShap
EscherContainerRecord spCont = (EscherContainerRecord) getSpContainer().getChild(0);
AbstractEscherOptRecord opt = new EscherOptRecord();
opt.setRecordId(EscherRecordTypes.USER_DEFINED.typeID);
- opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__TABLEPROPERTIES, 1));
- EscherArrayProperty p = new EscherArrayProperty((short)(0x4000 | EscherProperties.GROUPSHAPE__TABLEROWPROPERTIES), false, null);
+ opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__TABLEPROPERTIES, 1));
+ EscherArrayProperty p = new EscherArrayProperty(EscherPropertyTypes.GROUPSHAPE__TABLEROWPROPERTIES, true, 0);
p.setSizeOfElements(0x0004);
p.setNumberOfElementsInArray(numRows);
p.setNumberOfElementsInMemory(numRows);
@@ -368,7 +368,7 @@ implements HSLFShapeContainer, TableShap
// update row height in the table properties
AbstractEscherOptRecord opt = getEscherChild(EscherRecordTypes.USER_DEFINED);
- EscherArrayProperty p = opt.lookup(EscherProperties.GROUPSHAPE__TABLEROWPROPERTIES);
+ EscherArrayProperty p = opt.lookup(EscherPropertyTypes.GROUPSHAPE__TABLEROWPROPERTIES);
byte[] masterBytes = p.getElement(row);
double currentHeight = Units.masterToPoints(LittleEndian.getInt(masterBytes, 0));
LittleEndian.putInt(masterBytes, 0, Units.pointsToMaster(height));
@@ -461,7 +461,7 @@ implements HSLFShapeContainer, TableShap
private void updateRowHeightsProperty() {
AbstractEscherOptRecord opt = getEscherChild(EscherRecordTypes.USER_DEFINED);
- EscherArrayProperty p = opt.lookup(EscherProperties.GROUPSHAPE__TABLEROWPROPERTIES);
+ EscherArrayProperty p = opt.lookup(EscherPropertyTypes.GROUPSHAPE__TABLEROWPROPERTIES);
byte[] val = new byte[4];
for (int rowIdx = 0; rowIdx < cells.length; rowIdx++) {
int rowHeight = Units.pointsToMaster(cells[rowIdx][0].getAnchor().getHeight());
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java?rev=1868352&r1=1868351&r2=1868352&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java Sat Oct 12 16:32:53 2019
@@ -22,7 +22,7 @@ import java.awt.geom.Rectangle2D;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherContainerRecord;
-import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.sl.draw.DrawPaint;
import org.apache.poi.sl.usermodel.PaintStyle;
import org.apache.poi.sl.usermodel.ShapeType;
@@ -81,11 +81,11 @@ public final class HSLFTableCell extends
protected EscherContainerRecord createSpContainer(boolean isChild){
EscherContainerRecord ecr = super.createSpContainer(isChild);
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.TEXT__TEXTID, 0);
- setEscherProperty(opt, EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20000);
- setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x150001);
- setEscherProperty(opt, EscherProperties.SHADOWSTYLE__SHADOWOBSURED, 0x20000);
- setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x40000);
+ setEscherProperty(opt, EscherPropertyTypes.TEXT__TEXTID, 0);
+ setEscherProperty(opt, EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20000);
+ setEscherProperty(opt, EscherPropertyTypes.FILL__NOFILLHITTEST, 0x150001);
+ setEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__SHADOWOBSURED, 0x20000);
+ setEscherProperty(opt, EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 0x40000);
return ecr;
}
@@ -390,10 +390,10 @@ public final class HSLFTableCell extends
table.addShape(line);
AbstractEscherOptRecord opt = getEscherOptRecord();
- setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, -1);
- setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, -1);
- setEscherProperty(opt, EscherProperties.SHADOWSTYLE__SHADOWOBSURED, 0x20000);
- setEscherProperty(opt, EscherProperties.THREED__LIGHTFACE, 0x80000);
+ setEscherProperty(opt, EscherPropertyTypes.GEOMETRY__SHAPEPATH, -1);
+ setEscherProperty(opt, EscherPropertyTypes.GEOMETRY__FILLOK, -1);
+ setEscherProperty(opt, EscherPropertyTypes.SHADOWSTYLE__SHADOWOBSURED, 0x20000);
+ setEscherProperty(opt, EscherPropertyTypes.THREED__LIGHTFACE, 0x80000);
anchorBorder(edge, line);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org