#63745 - Add traversing and debugging interface

Replace EscherProperty.getAttributeMap by GenericRecord interface

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1868352 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2019-10-12 16:32:53 +00:00
parent e81a348864
commit 9982ec4e79
85 changed files with 2031 additions and 2974 deletions

View File

@ -24,6 +24,7 @@ import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.Removal;
/**
* Common abstract class for {@link EscherOptRecord} and
@ -96,18 +97,13 @@ public abstract class AbstractEscherOptRecord extends EscherRecord
return 8 + getPropertiesSize();
}
public <T extends EscherProperty> T lookup( int propId )
{
for ( EscherProperty prop : properties )
{
if ( prop.getPropertyNumber() == propId )
{
@SuppressWarnings( "unchecked" )
final T result = (T) prop;
return result;
}
}
return null;
public <T extends EscherProperty> T lookup( EscherPropertyTypes propType ) {
return lookup(propType.propNumber);
}
@SuppressWarnings( "unchecked" )
public <T extends EscherProperty> T lookup( int propId ) {
return (T)properties.stream().filter(p -> p.getPropertyNumber() == propId).findFirst().orElse(null);
}
@Override
@ -140,8 +136,7 @@ public abstract class AbstractEscherOptRecord extends EscherRecord
}
/**
* Set an escher property. If a property with given propId already
exists it is replaced.
* Set an escher property. If a property with given propId already exists it is replaced.
*
* @param value the property to set.
*/
@ -151,32 +146,22 @@ public abstract class AbstractEscherOptRecord extends EscherRecord
sortProperties();
}
@Deprecated
@Removal(version = "5.0.0")
public void removeEscherProperty(int num){
properties.removeIf(prop -> prop.getPropertyNumber() == num);
}
@Override
protected Object[][] getAttributeMap() {
List<Object> attrList = new ArrayList<>(properties.size() * 2 + 2);
attrList.add("properties");
attrList.add(properties.size());
for ( EscherProperty property : properties ) {
attrList.add(property.getName());
attrList.add(property);
}
return new Object[][]{
{ "isContainer", isContainerRecord() },
{ "numchildren", getChildRecords().size() },
attrList.toArray()
};
public void removeEscherProperty(EscherPropertyTypes type){
properties.removeIf(prop -> prop.getPropertyNumber() == type.propNumber);
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"isContainer", this::isContainerRecord
"isContainer", this::isContainerRecord,
"properties", this::getEscherProperties
);
}
}

View File

@ -18,11 +18,17 @@
package org.apache.poi.ddf;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.Removal;
/**
* Escher array properties are the most weird construction ever invented
@ -30,17 +36,15 @@ import org.apache.poi.util.LittleEndian;
*/
public final class EscherArrayProperty extends EscherComplexProperty implements Iterable<byte[]> {
//arbitrarily selected; may need to increase
// arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000;
/**
* The size of the header that goes at the
* start of the array, before the data
* The size of the header that goes at the start of the array, before the data
*/
private static final int FIXED_SIZE = 3 * 2;
/**
* Normally, the size recorded in the simple data (for the complex
* data) includes the size of the header.
* Normally, the size recorded in the simple data (for the complex data) includes the size of the header.
* There are a few cases when it doesn't though...
*/
private boolean sizeIncludesHeaderSize = true;
@ -48,50 +52,105 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
/**
* When reading a property from data stream remember if the complex part is empty and set this flag.
*/
private boolean emptyComplexPart;
private final boolean emptyComplexPart;
/**
* Create an instance of an escher array property.
* This constructor defaults to a 6 bytes header if the complexData is null or byte[0].
*
* @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
* indicating that this is a complex property.
* @param complexData The value of this property.
*
* @deprecated use {@link #EscherArrayProperty(EscherPropertyTypes, boolean, int)} and {@link #setComplexData(byte[])}
*/
@Deprecated
@Removal(version = "5.0.0")
@Internal
public EscherArrayProperty(short id, byte[] complexData) {
super(id, checkComplexData(complexData));
emptyComplexPart = (complexData == null || complexData.length == 0);
this(id, safeSize(complexData == null ? 0 : complexData.length));
setComplexData(complexData);
}
/**
* Create an instance of an escher array property.
* This constructor can be used to create emptyComplexParts with a complexSize = 0.
* Preferably use {@link #EscherArrayProperty(EscherPropertyTypes, boolean, int)} with {@link #setComplexData(byte[])}.
*
* @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
* indicating that this is a complex property.
* @param complexSize the data size
*/
@Internal
public EscherArrayProperty(short id, int complexSize) {
// this is called by EscherPropertyFactory which happens to call it with empty parts
// if a part is initial empty, don't allow it to contain something again
super(id, complexSize);
emptyComplexPart = (complexSize == 0);
}
/**
* Create an instance of an escher array property.
* This constructor defaults to a 6 bytes header if the complexData is null or byte[0].
*
* @param propertyNumber the property number part of the property id
* @param isBlipId {@code true}, if it references a blip
* @param complexData the data
*
* @deprecated use {@link #EscherArrayProperty(EscherPropertyTypes, boolean, int)} and {@link #setComplexData(byte[])}
*/
@Deprecated
@Removal(version = "5.0.0")
public EscherArrayProperty(short propertyNumber, boolean isBlipId, byte[] complexData) {
super(propertyNumber, isBlipId, checkComplexData(complexData));
// this is called by user code, if the complexData is empty/null, allocate a space for a valid header
// be aware, that there are complex data areas with less than 6 bytes
this((short)(propertyNumber | (isBlipId ? IS_BLIP : 0)), safeSize(complexData == null ? 0 : complexData.length));
setComplexData(complexData);
}
private static byte[] checkComplexData(byte[] complexData) {
if (complexData == null || complexData.length == 0) {
return new byte[6];
}
return complexData;
/**
* Create an instance of an escher array property.
* This constructor defaults to a 6 bytes header if the complexSize is 0.
*
* @param type the property type of the property id
* @param isBlipId {@code true}, if it references a blip
* @param complexSize the data size
*/
public EscherArrayProperty(EscherPropertyTypes type, boolean isBlipId, int complexSize) {
this((short)(type.propNumber | (isBlipId ? IS_BLIP : 0)), safeSize(complexSize));
}
private static int safeSize(int complexSize) {
// when called by user code, fix the size to be valid for the header
return complexSize == 0 ? 6 : complexSize;
}
public int getNumberOfElementsInArray() {
return (emptyComplexPart) ? 0 : LittleEndian.getUShort(getComplexData(), 0);
}
public void setNumberOfElementsInArray(int numberOfElements) {
int expectedArraySize = numberOfElements * getActualSizeOfElements(getSizeOfElements()) + FIXED_SIZE;
if (expectedArraySize != getComplexData().length) {
byte[] newArray = IOUtils.safelyAllocate(expectedArraySize, MAX_RECORD_LENGTH);
System.arraycopy(getComplexData(), 0, newArray, 0, getComplexData().length);
setComplexData(newArray);
if (emptyComplexPart) {
return;
}
rewriteArray(numberOfElements, false);
LittleEndian.putShort(getComplexData(), 0, (short) numberOfElements);
}
private void rewriteArray(int numberOfElements, boolean copyToNewLen) {
int expectedArraySize = numberOfElements * getActualSizeOfElements(getSizeOfElements()) + FIXED_SIZE;
resizeComplexData(expectedArraySize, copyToNewLen ? expectedArraySize : getComplexData().length);
}
public int getNumberOfElementsInMemory() {
return (emptyComplexPart) ? 0 : LittleEndian.getUShort(getComplexData(), 2);
}
public void setNumberOfElementsInMemory(int numberOfElements) {
int expectedArraySize = numberOfElements * getActualSizeOfElements(getSizeOfElements()) + FIXED_SIZE;
if (expectedArraySize != getComplexData().length) {
byte[] newArray = IOUtils.safelyAllocate(expectedArraySize, MAX_RECORD_LENGTH);
System.arraycopy(getComplexData(), 0, newArray, 0, expectedArraySize);
setComplexData(newArray);
if (emptyComplexPart) {
return;
}
rewriteArray(numberOfElements, true);
LittleEndian.putShort(getComplexData(), 2, (short) numberOfElements);
}
@ -100,15 +159,14 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
}
public void setSizeOfElements(int sizeOfElements) {
if (emptyComplexPart) {
return;
}
LittleEndian.putShort( getComplexData(), 4, (short) sizeOfElements );
int expectedArraySize = getNumberOfElementsInArray() * getActualSizeOfElements(getSizeOfElements()) + FIXED_SIZE;
if (expectedArraySize != getComplexData().length) {
// Keep just the first 6 bytes. The rest is no good to us anyway.
byte[] newArray = IOUtils.safelyAllocate(expectedArraySize, MAX_RECORD_LENGTH);
System.arraycopy( getComplexData(), 0, newArray, 0, 6 );
setComplexData(newArray);
}
// Keep just the first 6 bytes. The rest is no good to us anyway.
resizeComplexData(expectedArraySize, 6);
}
public byte[] getElement(int index) {
@ -119,43 +177,13 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
}
public void setElement(int index, byte[] element) {
if (emptyComplexPart) {
return;
}
int actualSize = getActualSizeOfElements(getSizeOfElements());
System.arraycopy( element, 0, getComplexData(), FIXED_SIZE + index * actualSize, actualSize);
}
@Override
public String toString() {
StringBuilder results = new StringBuilder();
results.append("propNum: ").append(getPropertyNumber());
results.append(", propName: ").append(EscherProperties.getPropertyName( getPropertyNumber() ));
results.append(", complex: ").append(isComplex());
results.append(", blipId: ").append(isBlipId());
results.append(", data: \n");
results.append(" {EscherArrayProperty:" + '\n');
results.append(" Num Elements: ").append(getNumberOfElementsInArray()).append('\n');
results.append(" Num Elements In Memory: ").append(getNumberOfElementsInMemory()).append('\n');
results.append(" Size of elements: ").append(getSizeOfElements()).append('\n');
for (int i = 0; i < getNumberOfElementsInArray(); i++) {
results.append(" Element ").append(i).append(": ").append(HexDump.toHex(getElement(i))).append('\n');
}
results.append("}" + '\n');
return results.toString();
}
@Override
public String toXml(String tab){
StringBuilder builder = new StringBuilder();
builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"0x").append(HexDump.toHex(getId()))
.append("\" name=\"").append(getName()).append("\" blipId=\"")
.append(isBlipId()).append("\">\n");
for (int i = 0; i < getNumberOfElementsInArray(); i++) {
builder.append("\t").append(tab).append("<Element>").append(HexDump.toHex(getElement(i))).append("</Element>\n");
}
builder.append(tab).append("</").append(getClass().getSimpleName()).append(">");
return builder.toString();
}
/**
* We have this method because the way in which arrays in escher works
* is screwed for seemly arbitrary reasons. While most properties are
@ -167,8 +195,8 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
* @return the number of bytes used by this complex property.
*/
public int setArrayData(byte[] data, int offset) {
if (emptyComplexPart){
setComplexData(new byte[0]);
if (emptyComplexPart) {
resizeComplexData(0);
} else {
short numElements = LittleEndian.getShort(data, offset);
// LittleEndian.getShort(data, offset + 2); // numReserved
@ -176,13 +204,14 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
// the code here seems to depend on complexData already being
// sized correctly via the constructor
int cdLen = getComplexData().length;
int arraySize = getActualSizeOfElements(sizeOfElements) * numElements;
if (arraySize == getComplexData().length) {
if (arraySize == cdLen) {
// The stored data size in the simple block excludes the header size
setComplexData(new byte[arraySize + 6]);
resizeComplexData(arraySize + 6, 0);
sizeIncludesHeaderSize = false;
}
System.arraycopy(data, offset, getComplexData(), 0, getComplexData().length );
setComplexData(data, offset);
}
return getComplexData().length;
}
@ -197,7 +226,7 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
public int serializeSimplePart(byte[] data, int pos) {
LittleEndian.putShort(data, pos, getId());
int recordSize = getComplexData().length;
if(!sizeIncludesHeaderSize) {
if (!sizeIncludesHeaderSize) {
recordSize -= 6;
}
LittleEndian.putInt(data, pos + 2, recordSize);
@ -238,6 +267,15 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
}
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"numElements", this::getNumberOfElementsInArray,
"numElementsInMemory", this::getNumberOfElementsInMemory,
"sizeOfElements", this::getSizeOfElements,
"elements", () -> StreamSupport.stream(spliterator(), false).collect(Collectors.toList())
);
}
}

View File

@ -22,6 +22,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndian;
@ -39,15 +40,6 @@ public final class EscherBSERecord extends EscherRecord {
public static final short RECORD_ID = EscherRecordTypes.BSE.typeID;
public static final byte BT_ERROR = 0;
public static final byte BT_UNKNOWN = 1;
public static final byte BT_EMF = 2;
public static final byte BT_WMF = 3;
public static final byte BT_PICT = 4;
public static final byte BT_JPEG = 5;
public static final byte BT_PNG = 6;
public static final byte BT_DIB = 7;
private byte field_1_blipTypeWin32;
private byte field_2_blipTypeMacOS;
private final byte[] field_3_uid = new byte[16];
@ -164,6 +156,10 @@ public final class EscherBSERecord extends EscherRecord {
return field_1_blipTypeWin32;
}
public PictureType getPictureTypeWin32() {
return PictureType.forNativeID(field_1_blipTypeWin32);
}
/**
* Set the expected win32 blip type
*
@ -183,6 +179,10 @@ public final class EscherBSERecord extends EscherRecord {
return field_2_blipTypeMacOS;
}
public PictureType getPictureTypeMacOS() {
return PictureType.forNativeID(field_2_blipTypeMacOS);
}
/**
* Set the expected MacOS blip type
*
@ -363,54 +363,13 @@ public final class EscherBSERecord extends EscherRecord {
_remainingData = (remainingData == null) ? new byte[0] : remainingData.clone();
}
/**
* Retrieve the string representation given a blip id.
*
* @param b the blip type byte-encoded
*
* @return the blip type as string
*/
public static String getBlipType(byte b) {
switch (b) {
case BT_ERROR: return " ERROR";
case BT_UNKNOWN: return " UNKNOWN";
case BT_EMF: return " EMF";
case BT_WMF: return " WMF";
case BT_PICT: return " PICT";
case BT_JPEG: return " JPEG";
case BT_PNG: return " PNG";
case BT_DIB: return " DIB";
}
if ( b < 32 ) {
return " NotKnown";
}
return " Client";
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "BlipTypeWin32", field_1_blipTypeWin32 },
{ "BlipTypeMacOS", field_2_blipTypeMacOS },
{ "SUID", field_3_uid },
{ "Tag", field_4_tag },
{ "Size", field_5_size },
{ "Ref", field_6_ref },
{ "Offset", field_7_offset },
{ "Usage", field_8_usage },
{ "Name", field_9_name },
{ "Unused2", field_10_unused2 },
{ "Unused3", field_11_unused3 },
{ "Blip Record", field_12_blipRecord },
{ "Extra Data", _remainingData }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
final Map<String, Supplier<?>> m = new LinkedHashMap<>(super.getGenericProperties());
m.put("blipTypeWin32", this::getBlipTypeWin32);
m.put("pictureTypeWin32", this::getPictureTypeWin32);
m.put("blipTypeMacOS", this::getBlipTypeMacOS);
m.put("pictureTypeMacOS", this::getPictureTypeMacOS);
m.put("suid", this::getUid);
m.put("tag", this::getTag);
m.put("size", this::getSize);

View File

@ -17,11 +17,10 @@
package org.apache.poi.ddf;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndian;
public class EscherBitmapBlip extends EscherBlipRecord {
@ -113,21 +112,13 @@ public class EscherBitmapBlip extends EscherBlipRecord {
this.field_2_marker = field_2_marker;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "Marker", field_2_marker },
{ "Extra Data", getPicturedata() }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
final Map<String, Supplier<?>> m = new LinkedHashMap<>(super.getGenericProperties());
m.put("uid", this::getUID);
m.put("marker", this::getMarker);
return Collections.unmodifiableMap(m);
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"uid", this::getUID,
"marker", this::getMarker
);
}
}

View File

@ -107,13 +107,6 @@ public class EscherBlipRecord extends EscherRecord {
System.arraycopy(pictureData, offset, field_pictureData, 0, length);
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "Extra Data", getPicturedata() }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -18,8 +18,6 @@
package org.apache.poi.ddf;
import org.apache.poi.util.HexDump;
/**
* Represents a boolean property. The actual utility of this property is in doubt because many
* of the properties marked as boolean seem to actually contain special values. In other words
@ -42,6 +40,18 @@ public class EscherBoolProperty
super(propertyNumber, value);
}
/**
* Create an instance of an escher boolean property.
*
* @param propertyType The property type
* @param value The 32 bit value of this bool property
*/
public EscherBoolProperty( EscherPropertyTypes propertyType, int value )
{
super(propertyType.propNumber, value);
}
/**
* Whether this boolean property is true
*
@ -51,21 +61,4 @@ public class EscherBoolProperty
{
return getPropertyValue() != 0;
}
// public String toString()
// {
// return "propNum: " + getPropertyNumber()
// + ", complex: " + isComplex()
// + ", blipId: " + isBlipId()
// + ", value: " + (getValue() != 0);
// }
@Override
public String toXml(String tab){
StringBuilder builder = new StringBuilder();
builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"0x").append(HexDump.toHex(getId()))
.append("\" name=\"").append(getName()).append("\" simpleValue=\"").append(getPropertyValue()).append("\" blipId=\"")
.append(isBlipId()).append("\" value=\"").append(isTrue()).append("\"").append("/>");
return builder.toString();
}
}

View File

@ -176,16 +176,6 @@ public class EscherChildAnchorRecord extends EscherRecord {
this.field_4_dy2 = field_4_dy2;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "X1", field_1_dx1 },
{ "Y1", field_2_dy1 },
{ "X2", field_3_dx2 },
{ "Y2", field_4_dy2 }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -348,22 +348,6 @@ public class EscherClientAnchorRecord extends EscherRecord {
}
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "Flag", field_1_flag },
{ "Col1", field_2_col1 },
{ "DX1", field_3_dx1 },
{ "Row1", field_4_row1 },
{ "DY1", field_5_dy1 },
{ "Col2", field_6_col2 },
{ "DX2", field_7_dx2 },
{ "Row2", field_8_row2 },
{ "DY2", field_9_dy2 },
{ "Extra Data", remainingData }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
final Map<String,Supplier<?>> m = new LinkedHashMap<>(super.getGenericProperties());

View File

@ -102,13 +102,6 @@ public class EscherClientDataRecord
: remainingData.clone();
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "Extra Data", getRemainingData() }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -18,9 +18,13 @@
package org.apache.poi.ddf;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.Removal;
/**
* A complex property differs from a simple property in that the data can not fit inside a 32 bit
@ -28,7 +32,10 @@ import org.apache.poi.util.LittleEndian;
* stored here.
*/
public class EscherComplexProperty extends EscherProperty {
private byte[] _complexData;
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000_000;
private byte[] complexData;
/**
* Create a complex property using the property id and a byte array containing the complex
@ -38,12 +45,11 @@ public class EscherComplexProperty extends EscherProperty {
* indicating that this is a complex property.
* @param complexData The value of this property.
*/
@Deprecated
@Removal(version = "5.0.0")
public EscherComplexProperty(short id, byte[] complexData) {
super(id);
if (complexData == null) {
throw new IllegalArgumentException("complexData can't be null");
}
_complexData = complexData.clone();
this(id, complexData == null ? 0 : complexData.length);
setComplexData(complexData);
}
/**
@ -54,12 +60,48 @@ public class EscherComplexProperty extends EscherProperty {
* @param isBlipId Whether this is a blip id. Should be false.
* @param complexData The value of this complex property.
*/
@Deprecated
@Removal(version = "5.0.0")
public EscherComplexProperty(short propertyNumber, boolean isBlipId, byte[] complexData) {
super(propertyNumber, true, isBlipId);
if (complexData == null) {
throw new IllegalArgumentException("complexData can't be null");
}
_complexData = complexData.clone();
this(propertyNumber, isBlipId, complexData == null ? 0 : complexData.length);
setComplexData(complexData);
}
/**
* Create a complex property using the property id and a byte array containing the complex
* data value size.
*
* @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
* indicating that this is a complex property.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(short id, int complexSize) {
super((short)(id | IS_COMPLEX));
complexData = IOUtils.safelyAllocate(complexSize, MAX_RECORD_LENGTH);
}
/**
* Create a complex property using the property number, a flag to indicate whether this is a
* blip reference and the complex property data size.
*
* @param propertyNumber The property number
* @param isBlipId Whether this is a blip id. Should be false.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(short propertyNumber, boolean isBlipId, int complexSize) {
this((short)(propertyNumber | (isBlipId ? IS_BLIP : 0)), complexSize);
}
/**
* Create a complex property using the property type, a flag to indicate whether this is a
* blip reference and the complex property data size.
*
* @param type The property type
* @param isBlipId Whether this is a blip id. Should be false.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(EscherPropertyTypes type, boolean isBlipId, int complexSize) {
this((short)(type.propNumber | (isBlipId ? IS_BLIP : 0)), complexSize);
}
/**
@ -68,7 +110,7 @@ public class EscherComplexProperty extends EscherProperty {
@Override
public int serializeSimplePart(byte[] data, int pos) {
LittleEndian.putShort(data, pos, getId());
LittleEndian.putInt(data, pos + 2, _complexData.length);
LittleEndian.putInt(data, pos + 2, complexData.length);
return 6;
}
@ -81,8 +123,8 @@ public class EscherComplexProperty extends EscherProperty {
*/
@Override
public int serializeComplexPart(byte[] data, int pos) {
System.arraycopy(_complexData, 0, data, pos, _complexData.length);
return _complexData.length;
System.arraycopy(complexData, 0, data, pos, complexData.length);
return complexData.length;
}
/**
@ -91,11 +133,36 @@ public class EscherComplexProperty extends EscherProperty {
* @return the complex bytes
*/
public byte[] getComplexData() {
return _complexData;
return complexData;
}
protected void setComplexData(byte[] _complexData) {
this._complexData = _complexData;
public int setComplexData(byte[] complexData) {
return setComplexData(complexData, 0);
}
public int setComplexData(byte[] complexData, int offset) {
if (complexData == null) {
return 0;
} else {
int copySize = Math.max(0, Math.min(this.complexData.length, complexData.length - offset));
System.arraycopy(complexData, offset, this.complexData, 0, copySize);
return copySize;
}
}
protected void resizeComplexData(int newSize) {
resizeComplexData(newSize, Integer.MAX_VALUE);
}
protected void resizeComplexData(int newSize, int copyLen) {
if (newSize == complexData.length) {
return;
}
byte[] newArray = IOUtils.safelyAllocate(newSize, MAX_RECORD_LENGTH);
System.arraycopy(complexData, 0, newArray, 0, Math.min(Math.min(complexData.length, copyLen),newSize));
complexData = newArray;
}
/**
@ -109,14 +176,13 @@ public class EscherComplexProperty extends EscherProperty {
if (this == o) {
return true;
}
if (o == null || !(o instanceof EscherComplexProperty)) {
if (!(o instanceof EscherComplexProperty)) {
return false;
}
EscherComplexProperty escherComplexProperty = (EscherComplexProperty) o;
return Arrays.equals(_complexData, escherComplexProperty._complexData);
return Arrays.equals(complexData, escherComplexProperty.complexData);
}
/**
@ -126,7 +192,7 @@ public class EscherComplexProperty extends EscherProperty {
*/
@Override
public int getPropertySize() {
return 6 + _complexData.length;
return 6 + complexData.length;
}
@Override
@ -134,26 +200,11 @@ public class EscherComplexProperty extends EscherProperty {
return getId() * 11;
}
/**
* Retrieves the string representation for this property.
*/
@Override
public String toString() {
String dataStr = HexDump.toHex( _complexData, 32);
return "propNum: " + getPropertyNumber()
+ ", propName: " + EscherProperties.getPropertyName( getPropertyNumber() )
+ ", complex: " + isComplex()
+ ", blipId: " + isBlipId()
+ ", data: " + System.getProperty("line.separator") + dataStr;
}
@Override
public String toXml(String tab){
return tab + "<" + getClass().getSimpleName() + " id=\"0x" + HexDump.toHex(getId()) +
"\" name=\"" + getName() + "\" blipId=\"" +
isBlipId() + "\">\n" +
tab + "</" + getClass().getSimpleName() + ">";
//builder.append("\t").append(tab).append(dataStr);
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"data", this::getComplexData
);
}
}

View File

@ -272,23 +272,6 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl
}
}
@Override
protected Object[][] getAttributeMap() {
List<Object> chList = new ArrayList<>(_childRecords.size() * 2 + 2);
chList.add("children");
chList.add(_childRecords.size());
int count = 0;
for ( EscherRecord record : this ) {
chList.add("Child "+count);
chList.add(record);
count++;
}
return new Object[][] {
{ "isContainer", isContainerRecord() },
chList.toArray()
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -144,14 +144,6 @@ public class EscherDgRecord extends EscherRecord {
this.field_1_numShapes++;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "NumShapes", field_1_numShapes },
{ "LastMSOSPID", field_2_lastMSOSPID }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -335,26 +335,6 @@ public final class EscherDggRecord extends EscherRecord {
return shapeId;
}
@Override
protected Object[][] getAttributeMap() {
List<Object> fldIds = new ArrayList<>();
fldIds.add("FileId Clusters");
fldIds.add(field_5_fileIdClusters.size());
for (FileIdCluster fic : field_5_fileIdClusters) {
fldIds.add("Group"+fic.field_1_drawingGroupId);
fldIds.add(fic.field_2_numShapeIdsUsed);
}
return new Object[][] {
{ "ShapeIdMax", field_1_shapeIdMax },
{ "NumIdClusters", getNumIdClusters() },
{ "NumShapesSaved", field_3_numShapesSaved },
{ "DrawingsSaved", field_4_drawingsSaved },
fldIds.toArray()
};
}
@Override
public Enum getGenericRecordType() {

View File

@ -17,25 +17,13 @@
package org.apache.poi.ddf;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.zip.InflaterInputStream;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.apache.poi.util.LittleEndian;
/**
* Used to dump the contents of escher records to a PrintStream.
*/
public final class EscherDump {
public EscherDump() {
//
}
/**
* Decodes the escher stream from a byte array and dumps the results to
* a print stream.
@ -58,869 +46,6 @@ public final class EscherDump {
}
}
/**
* This version of dump is a translation from the open office escher dump routine.
*
* @param maxLength The number of bytes to read
* @param in An input stream to read from.
* @param out An output stream to write to.
*
* @throws IOException if the data can't be read or written
* @throws LittleEndian.BufferUnderrunException if an buffer underrun occurs
*/
public void dumpOld(long maxLength, InputStream in, PrintStream out)
throws IOException, LittleEndian.BufferUnderrunException {
long remainingBytes = maxLength;
short options; // 4 bits for the version and 12 bits for the instance
short recordId;
int recordBytesRemaining; // including enclosing records
short nDumpSize;
String recordName;
boolean atEOF = false;
while (!atEOF && (remainingBytes > 0)) {
options = LittleEndian.readShort( in );
recordId = LittleEndian.readShort( in );
recordBytesRemaining = LittleEndian.readInt( in );
remainingBytes -= 2 + 2 + 4;
switch ( recordId )
{
case (short) 0xF000:
recordName = "MsofbtDggContainer";
break;
case (short) 0xF006:
recordName = "MsofbtDgg";
break;
case (short) 0xF016:
recordName = "MsofbtCLSID";
break;
case (short) 0xF00B:
recordName = "MsofbtOPT";
break;
case (short) 0xF11A:
recordName = "MsofbtColorMRU";
break;
case (short) 0xF11E:
recordName = "MsofbtSplitMenuColors";
break;
case (short) 0xF001:
recordName = "MsofbtBstoreContainer";
break;
case (short) 0xF007:
recordName = "MsofbtBSE";
break;
case (short) 0xF002:
recordName = "MsofbtDgContainer";
break;
case (short) 0xF008:
recordName = "MsofbtDg";
break;
case (short) 0xF118:
recordName = "MsofbtRegroupItem";
break;
case (short) 0xF120:
recordName = "MsofbtColorScheme";
break;
case (short) 0xF003:
recordName = "MsofbtSpgrContainer";
break;
case (short) 0xF004:
recordName = "MsofbtSpContainer";
break;
case (short) 0xF009:
recordName = "MsofbtSpgr";
break;
case (short) 0xF00A:
recordName = "MsofbtSp";
break;
case (short) 0xF00C:
recordName = "MsofbtTextbox";
break;
case (short) 0xF00D:
recordName = "MsofbtClientTextbox";
break;
case (short) 0xF00E:
recordName = "MsofbtAnchor";
break;
case (short) 0xF00F:
recordName = "MsofbtChildAnchor";
break;
case (short) 0xF010:
recordName = "MsofbtClientAnchor";
break;
case (short) 0xF011:
recordName = "MsofbtClientData";
break;
case (short) 0xF11F:
recordName = "MsofbtOleObject";
break;
case (short) 0xF11D:
recordName = "MsofbtDeletedPspl";
break;
case (short) 0xF005:
recordName = "MsofbtSolverContainer";
break;
case (short) 0xF012:
recordName = "MsofbtConnectorRule";
break;
case (short) 0xF013:
recordName = "MsofbtAlignRule";
break;
case (short) 0xF014:
recordName = "MsofbtArcRule";
break;
case (short) 0xF015:
recordName = "MsofbtClientRule";
break;
case (short) 0xF017:
recordName = "MsofbtCalloutRule";
break;
case (short) 0xF119:
recordName = "MsofbtSelection";
break;
case (short) 0xF122:
recordName = "MsofbtUDefProp";
break;
default:
if ( recordId >= (short) 0xF018 && recordId <= (short) 0xF117 ) {
recordName = "MsofbtBLIP";
} else if ( ( options & (short) 0x000F ) == (short) 0x000F ) {
recordName = "UNKNOWN container";
} else {
recordName = "UNKNOWN ID";
}
}
StringBuilder stringBuf = new StringBuilder();
stringBuf.append( " " );
stringBuf.append( HexDump.toHex( recordId ) );
stringBuf.append( " " ).append( recordName ).append( " [" );
stringBuf.append( HexDump.toHex( options ) );
stringBuf.append( ',' );
stringBuf.append( HexDump.toHex( recordBytesRemaining ) );
stringBuf.append( "] instance: " );
stringBuf.append( HexDump.toHex( ( (short) ( options >> 4 ) ) ) );
out.println(stringBuf);
stringBuf.setLength(0);
if ( recordId == (short) 0xF007 && 36 <= remainingBytes && 36 <= recordBytesRemaining )
{ // BSE, FBSE
// ULONG nP = pIn->GetRecPos();
byte n8;
// short n16;
// int n32;
stringBuf = stringBuf.append( " btWin32: " );
n8 = (byte) in.read();
stringBuf.append( HexDump.toHex( n8 ) );
stringBuf.append( getBlipType( n8 ) );
stringBuf.append( " btMacOS: " );
n8 = (byte) in.read();
stringBuf.append( HexDump.toHex( n8 ) );
stringBuf.append( getBlipType( n8 ) );
out.println(stringBuf);
out.println( " rgbUid:" );
HexDump.dump( in, out, 0, 16 );
out.print( " tag: " );
outHex( 2, in, out );
out.println();
out.print( " size: " );
outHex( 4, in, out );
out.println();
out.print( " cRef: " );
outHex( 4, in, out );
out.println();
out.print( " offs: " );
outHex( 4, in, out );
out.println();
out.print( " usage: " );
outHex( 1, in, out );
out.println();
out.print( " cbName: " );
outHex( 1, in, out );
out.println();
out.print( " unused2: " );
outHex( 1, in, out );
out.println();
out.print( " unused3: " );
outHex( 1, in, out );
out.println();
// subtract the number of bytes we've read
remainingBytes -= 36;
//n -= pIn->GetRecPos() - nP;
recordBytesRemaining = 0; // loop to MsofbtBLIP
}
else if ( recordId == (short) 0xF010 && 0x12 <= remainingBytes && 0x12 <= recordBytesRemaining )
{ // ClientAnchor
//ULONG nP = pIn->GetRecPos();
// short n16;
out.print( " Flag: " );
outHex( 2, in, out );
out.println();
out.print( " Col1: " );
outHex( 2, in, out );
out.print( " dX1: " );
outHex( 2, in, out );
out.print( " Row1: " );
outHex( 2, in, out );
out.print( " dY1: " );
outHex( 2, in, out );
out.println();
out.print( " Col2: " );
outHex( 2, in, out );
out.print( " dX2: " );
outHex( 2, in, out );
out.print( " Row2: " );
outHex( 2, in, out );
out.print( " dY2: " );
outHex( 2, in, out );
out.println();
remainingBytes -= 18;
recordBytesRemaining -= 18;
}
else if ( recordId == (short) 0xF00B || recordId == (short) 0xF122 )
{ // OPT
int nComplex = 0;
out.println( " PROPID VALUE" );
while ( recordBytesRemaining >= 6 + nComplex && remainingBytes >= 6 + nComplex )
{
short n16;
int n32;
n16 = LittleEndian.readShort( in );
n32 = LittleEndian.readInt( in );
recordBytesRemaining -= 6;
remainingBytes -= 6;
out.print( " " );
out.print( HexDump.toHex( n16 ) );
out.print( " (" );
int propertyId = n16 & (short) 0x3FFF;
out.print( " " + propertyId );
if ( ( n16 & (short) 0x8000 ) == 0 )
{
if ( ( n16 & (short) 0x4000 ) != 0 ) {
out.print( ", fBlipID" );
}
out.print( ") " );
out.print( HexDump.toHex( n32 ) );
if ( ( n16 & (short) 0x4000 ) == 0 )
{
out.print( " (" );
out.print( dec1616( n32 ) );
out.print( ')' );
out.print( " {" + propName( (short)propertyId ) + "}" );
}
out.println();
}
else
{
out.print( ", fComplex) " );
out.print( HexDump.toHex( n32 ) );
out.print( " - Complex prop len" );
out.println( " {" + propName( (short)propertyId ) + "}" );
nComplex += n32;
}
}
// complex property data
while ( ( nComplex & remainingBytes ) > 0 )
{
nDumpSize = ( nComplex > (int) remainingBytes ) ? (short) remainingBytes : (short) nComplex;
HexDump.dump( in, out, 0, nDumpSize );
nComplex -= nDumpSize;
recordBytesRemaining -= nDumpSize;
remainingBytes -= nDumpSize;
}
}
else if ( recordId == (short) 0xF012 )
{
out.print( " Connector rule: " );
out.print( LittleEndian.readInt( in ) );
out.print( " ShapeID A: " );
out.print( LittleEndian.readInt( in ) );
out.print( " ShapeID B: " );
out.print( LittleEndian.readInt( in ) );
out.print( " ShapeID connector: " );
out.print( LittleEndian.readInt( in ) );
out.print( " Connect pt A: " );
out.print( LittleEndian.readInt( in ) );
out.print( " Connect pt B: " );
out.println( LittleEndian.readInt( in ) );
recordBytesRemaining -= 24;
remainingBytes -= 24;
}
else if ( recordId >= (short) 0xF018 && recordId < (short) 0xF117 )
{
out.println( " Secondary UID: " );
HexDump.dump( in, out, 0, 16 );
out.println( " Cache of size: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Boundary top: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Boundary left: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Boundary width: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Boundary height: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " X: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Y: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Cache of saved size: " + HexDump.toHex( LittleEndian.readInt( in ) ) );
out.println( " Compression Flag: " + HexDump.toHex( (byte) in.read() ) );
out.println( " Filter: " + HexDump.toHex( (byte) in.read() ) );
out.println( " Data (after decompression): " );
recordBytesRemaining -= 34 + 16;
remainingBytes -= 34 + 16;
nDumpSize = ( recordBytesRemaining > (int) remainingBytes ) ? (short) remainingBytes : (short) recordBytesRemaining;
byte[] buf = new byte[nDumpSize];
int read = in.read( buf );
while ( read != -1 && read < nDumpSize ) {
read += in.read( buf, read, buf.length );
}
ByteArrayInputStream bin = new ByteArrayInputStream( buf );
InputStream in1 = new InflaterInputStream( bin );
int bytesToDump = -1;
HexDump.dump( in1, out, 0, bytesToDump );
recordBytesRemaining -= nDumpSize;
remainingBytes -= nDumpSize;
}
boolean isContainer = ( options & (short) 0x000F ) == (short) 0x000F;
if ( isContainer && remainingBytes >= 0 )
{ // Container
if ( recordBytesRemaining <= (int) remainingBytes ) {
out.println( " completed within" );
} else {
out.println( " continued elsewhere" );
}
}
else if ( remainingBytes >= 0 )
// -> 0x0000 ... 0x0FFF
{
nDumpSize = ( recordBytesRemaining > (int) remainingBytes ) ? (short) remainingBytes : (short) recordBytesRemaining;
if ( nDumpSize != 0 )
{
HexDump.dump( in, out, 0, nDumpSize );
remainingBytes -= nDumpSize;
}
} else {
out.println( " >> OVERRUN <<" );
}
}
}
/**
* Returns a property name given a property id. This is used only by the
* old escher dump routine.
*
* @param propertyId The property number for the name
* @return A descriptive name.
*/
private String propName(short propertyId) {
final class PropName {
final int _id;
final String _name;
public PropName(int id, String name) {
_id = id;
_name = name;
}
}
final PropName[] props = new PropName[] {
new PropName(4, "transform.rotation"),
new PropName(119, "protection.lockrotation"),
new PropName(120, "protection.lockaspectratio"),
new PropName(121, "protection.lockposition"),
new PropName(122, "protection.lockagainstselect"),
new PropName(123, "protection.lockcropping"),
new PropName(124, "protection.lockvertices"),
new PropName(125, "protection.locktext"),
new PropName(126, "protection.lockadjusthandles"),
new PropName(127, "protection.lockagainstgrouping"),
new PropName(128, "text.textid"),
new PropName(129, "text.textleft"),
new PropName(130, "text.texttop"),
new PropName(131, "text.textright"),
new PropName(132, "text.textbottom"),
new PropName(133, "text.wraptext"),
new PropName(134, "text.scaletext"),
new PropName(135, "text.anchortext"),
new PropName(136, "text.textflow"),
new PropName(137, "text.fontrotation"),
new PropName(138, "text.idofnextshape"),
new PropName(139, "text.bidir"),
new PropName(187, "text.singleclickselects"),
new PropName(188, "text.usehostmargins"),
new PropName(189, "text.rotatetextwithshape"),
new PropName(190, "text.sizeshapetofittext"),
new PropName(191, "text.sizetexttofitshape"),
new PropName(192, "geotext.unicode"),
new PropName(193, "geotext.rtftext"),
new PropName(194, "geotext.alignmentoncurve"),
new PropName(195, "geotext.defaultpointsize"),
new PropName(196, "geotext.textspacing"),
new PropName(197, "geotext.fontfamilyname"),
new PropName(240, "geotext.reverseroworder"),
new PropName(241, "geotext.hastexteffect"),
new PropName(242, "geotext.rotatecharacters"),
new PropName(243, "geotext.kerncharacters"),
new PropName(244, "geotext.tightortrack"),
new PropName(245, "geotext.stretchtofitshape"),
new PropName(246, "geotext.charboundingbox"),
new PropName(247, "geotext.scaletextonpath"),
new PropName(248, "geotext.stretchcharheight"),
new PropName(249, "geotext.nomeasurealongpath"),
new PropName(250, "geotext.boldfont"),
new PropName(251, "geotext.italicfont"),
new PropName(252, "geotext.underlinefont"),
new PropName(253, "geotext.shadowfont"),
new PropName(254, "geotext.smallcapsfont"),
new PropName(255, "geotext.strikethroughfont"),
new PropName(256, "blip.cropfromtop"),
new PropName(257, "blip.cropfrombottom"),
new PropName(258, "blip.cropfromleft"),
new PropName(259, "blip.cropfromright"),
new PropName(260, "blip.bliptodisplay"),
new PropName(261, "blip.blipfilename"),
new PropName(262, "blip.blipflags"),
new PropName(263, "blip.transparentcolor"),
new PropName(264, "blip.contrastsetting"),
new PropName(265, "blip.brightnesssetting"),
new PropName(266, "blip.gamma"),
new PropName(267, "blip.pictureid"),
new PropName(268, "blip.doublemod"),
new PropName(269, "blip.picturefillmod"),
new PropName(270, "blip.pictureline"),
new PropName(271, "blip.printblip"),
new PropName(272, "blip.printblipfilename"),
new PropName(273, "blip.printflags"),
new PropName(316, "blip.nohittestpicture"),
new PropName(317, "blip.picturegray"),
new PropName(318, "blip.picturebilevel"),
new PropName(319, "blip.pictureactive"),
new PropName(320, "geometry.left"),
new PropName(321, "geometry.top"),
new PropName(322, "geometry.right"),
new PropName(323, "geometry.bottom"),
new PropName(324, "geometry.shapepath"),
new PropName(325, "geometry.vertices"),
new PropName(326, "geometry.segmentinfo"),
new PropName(327, "geometry.adjustvalue"),
new PropName(328, "geometry.adjust2value"),
new PropName(329, "geometry.adjust3value"),
new PropName(330, "geometry.adjust4value"),
new PropName(331, "geometry.adjust5value"),
new PropName(332, "geometry.adjust6value"),
new PropName(333, "geometry.adjust7value"),
new PropName(334, "geometry.adjust8value"),
new PropName(335, "geometry.adjust9value"),
new PropName(336, "geometry.adjust10value"),
new PropName(378, "geometry.shadowOK"),
new PropName(379, "geometry.3dok"),
new PropName(380, "geometry.lineok"),
new PropName(381, "geometry.geotextok"),
new PropName(382, "geometry.fillshadeshapeok"),
new PropName(383, "geometry.fillok"),
new PropName(384, "fill.filltype"),
new PropName(385, "fill.fillcolor"),
new PropName(386, "fill.fillopacity"),
new PropName(387, "fill.fillbackcolor"),
new PropName(388, "fill.backopacity"),
new PropName(389, "fill.crmod"),
new PropName(390, "fill.patterntexture"),
new PropName(391, "fill.blipfilename"),
new PropName(392, "fill.blipflags"),
new PropName(393, "fill.width"),
new PropName(394, "fill.height"),
new PropName(395, "fill.angle"),
new PropName(396, "fill.focus"),
new PropName(397, "fill.toleft"),
new PropName(398, "fill.totop"),
new PropName(399, "fill.toright"),
new PropName(400, "fill.tobottom"),
new PropName(401, "fill.rectleft"),
new PropName(402, "fill.recttop"),
new PropName(403, "fill.rectright"),
new PropName(404, "fill.rectbottom"),
new PropName(405, "fill.dztype"),
new PropName(406, "fill.shadepreset"),
new PropName(407, "fill.shadecolors"),
new PropName(408, "fill.originx"),
new PropName(409, "fill.originy"),
new PropName(410, "fill.shapeoriginx"),
new PropName(411, "fill.shapeoriginy"),
new PropName(412, "fill.shadetype"),
new PropName(443, "fill.filled"),
new PropName(444, "fill.hittestfill"),
new PropName(445, "fill.shape"),
new PropName(446, "fill.userect"),
new PropName(447, "fill.nofillhittest"),
new PropName(448, "linestyle.color"),
new PropName(449, "linestyle.opacity"),
new PropName(450, "linestyle.backcolor"),
new PropName(451, "linestyle.crmod"),
new PropName(452, "linestyle.linetype"),
new PropName(453, "linestyle.fillblip"),
new PropName(454, "linestyle.fillblipname"),
new PropName(455, "linestyle.fillblipflags"),
new PropName(456, "linestyle.fillwidth"),
new PropName(457, "linestyle.fillheight"),
new PropName(458, "linestyle.filldztype"),
new PropName(459, "linestyle.linewidth"),
new PropName(460, "linestyle.linemiterlimit"),
new PropName(461, "linestyle.linestyle"),
new PropName(462, "linestyle.linedashing"),
new PropName(463, "linestyle.linedashstyle"),
new PropName(464, "linestyle.linestartarrowhead"),
new PropName(465, "linestyle.lineendarrowhead"),
new PropName(466, "linestyle.linestartarrowwidth"),
new PropName(467, "linestyle.lineestartarrowlength"),
new PropName(468, "linestyle.lineendarrowwidth"),
new PropName(469, "linestyle.lineendarrowlength"),
new PropName(470, "linestyle.linejoinstyle"),
new PropName(471, "linestyle.lineendcapstyle"),
new PropName(507, "linestyle.arrowheadsok"),
new PropName(508, "linestyle.anyline"),
new PropName(509, "linestyle.hitlinetest"),
new PropName(510, "linestyle.linefillshape"),
new PropName(511, "linestyle.nolinedrawdash"),
new PropName(512, "shadowstyle.type"),
new PropName(513, "shadowstyle.color"),
new PropName(514, "shadowstyle.highlight"),
new PropName(515, "shadowstyle.crmod"),
new PropName(516, "shadowstyle.opacity"),
new PropName(517, "shadowstyle.offsetx"),
new PropName(518, "shadowstyle.offsety"),
new PropName(519, "shadowstyle.secondoffsetx"),
new PropName(520, "shadowstyle.secondoffsety"),
new PropName(521, "shadowstyle.scalextox"),
new PropName(522, "shadowstyle.scaleytox"),
new PropName(523, "shadowstyle.scalextoy"),
new PropName(524, "shadowstyle.scaleytoy"),
new PropName(525, "shadowstyle.perspectivex"),
new PropName(526, "shadowstyle.perspectivey"),
new PropName(527, "shadowstyle.weight"),
new PropName(528, "shadowstyle.originx"),
new PropName(529, "shadowstyle.originy"),
new PropName(574, "shadowstyle.shadow"),
new PropName(575, "shadowstyle.shadowobsured"),
new PropName(576, "perspective.type"),
new PropName(577, "perspective.offsetx"),
new PropName(578, "perspective.offsety"),
new PropName(579, "perspective.scalextox"),
new PropName(580, "perspective.scaleytox"),
new PropName(581, "perspective.scalextoy"),
new PropName(582, "perspective.scaleytox"),
new PropName(583, "perspective.perspectivex"),
new PropName(584, "perspective.perspectivey"),
new PropName(585, "perspective.weight"),
new PropName(586, "perspective.originx"),
new PropName(587, "perspective.originy"),
new PropName(639, "perspective.perspectiveon"),
new PropName(640, "3d.specularamount"),
new PropName(661, "3d.diffuseamount"),
new PropName(662, "3d.shininess"),
new PropName(663, "3d.edgethickness"),
new PropName(664, "3d.extrudeforward"),
new PropName(665, "3d.extrudebackward"),
new PropName(666, "3d.extrudeplane"),
new PropName(667, "3d.extrusioncolor"),
new PropName(648, "3d.crmod"),
new PropName(700, "3d.3deffect"),
new PropName(701, "3d.metallic"),
new PropName(702, "3d.useextrusioncolor"),
new PropName(703, "3d.lightface"),
new PropName(704, "3dstyle.yrotationangle"),
new PropName(705, "3dstyle.xrotationangle"),
new PropName(706, "3dstyle.rotationaxisx"),
new PropName(707, "3dstyle.rotationaxisy"),
new PropName(708, "3dstyle.rotationaxisz"),
new PropName(709, "3dstyle.rotationangle"),
new PropName(710, "3dstyle.rotationcenterx"),
new PropName(711, "3dstyle.rotationcentery"),
new PropName(712, "3dstyle.rotationcenterz"),
new PropName(713, "3dstyle.rendermode"),
new PropName(714, "3dstyle.tolerance"),
new PropName(715, "3dstyle.xviewpoint"),
new PropName(716, "3dstyle.yviewpoint"),
new PropName(717, "3dstyle.zviewpoint"),
new PropName(718, "3dstyle.originx"),
new PropName(719, "3dstyle.originy"),
new PropName(720, "3dstyle.skewangle"),
new PropName(721, "3dstyle.skewamount"),
new PropName(722, "3dstyle.ambientintensity"),
new PropName(723, "3dstyle.keyx"),
new PropName(724, "3dstyle.keyy"),
new PropName(725, "3dstyle.keyz"),
new PropName(726, "3dstyle.keyintensity"),
new PropName(727, "3dstyle.fillx"),
new PropName(728, "3dstyle.filly"),
new PropName(729, "3dstyle.fillz"),
new PropName(730, "3dstyle.fillintensity"),
new PropName(763, "3dstyle.constrainrotation"),
new PropName(764, "3dstyle.rotationcenterauto"),
new PropName(765, "3dstyle.parallel"),
new PropName(766, "3dstyle.keyharsh"),
new PropName(767, "3dstyle.fillharsh"),
new PropName(769, "shape.master"),
new PropName(771, "shape.connectorstyle"),
new PropName(772, "shape.blackandwhitesettings"),
new PropName(773, "shape.wmodepurebw"),
new PropName(774, "shape.wmodebw"),
new PropName(826, "shape.oleicon"),
new PropName(827, "shape.preferrelativeresize"),
new PropName(828, "shape.lockshapetype"),
new PropName(830, "shape.deleteattachedobject"),
new PropName(831, "shape.backgroundshape"),
new PropName(832, "callout.callouttype"),
new PropName(833, "callout.xycalloutgap"),
new PropName(834, "callout.calloutangle"),
new PropName(835, "callout.calloutdroptype"),
new PropName(836, "callout.calloutdropspecified"),
new PropName(837, "callout.calloutlengthspecified"),
new PropName(889, "callout.iscallout"),
new PropName(890, "callout.calloutaccentbar"),
new PropName(891, "callout.callouttextborder"),
new PropName(892, "callout.calloutminusx"),
new PropName(893, "callout.calloutminusy"),
new PropName(894, "callout.dropauto"),
new PropName(895, "callout.lengthspecified"),
new PropName(896, "groupshape.shapename"),
new PropName(897, "groupshape.description"),
new PropName(898, "groupshape.hyperlink"),
new PropName(899, "groupshape.wrappolygonvertices"),
new PropName(900, "groupshape.wrapdistleft"),
new PropName(901, "groupshape.wrapdisttop"),
new PropName(902, "groupshape.wrapdistright"),
new PropName(903, "groupshape.wrapdistbottom"),
new PropName(904, "groupshape.regroupid"),
new PropName(953, "groupshape.editedwrap"),
new PropName(954, "groupshape.behinddocument"),
new PropName(955, "groupshape.ondblclicknotify"),
new PropName(956, "groupshape.isbutton"),
new PropName(957, "groupshape.1dadjustment"),
new PropName(958, "groupshape.hidden"),
new PropName(959, "groupshape.print"),
};
for (int i = 0; i < props.length; i++) {
if (props[i]._id == propertyId) {
return props[i]._name;
}
}
return "unknown property";
}
/**
* Returns the blip description given a blip id.
*
* @param b blip id
* @return A description.
*/
private static String getBlipType(byte b) {
return EscherBSERecord.getBlipType(b);
}
/**
* Straight conversion from OO. Converts a type of float.
*/
private String dec1616( int n32 )
{
String result = "";
result += (short) ( n32 >> 16 );
result += '.';
result += (short) ( n32 & 0xFFFF );
return result;
}
/**
* Dumps out a hex value by reading from a input stream.
*
* @param bytes How many bytes this hex value consists of.
* @param in The stream to read the hex value from.
* @param out The stream to write the nicely formatted hex value to.
*/
private void outHex( int bytes, InputStream in, PrintStream out ) throws IOException, LittleEndian.BufferUnderrunException
{
switch ( bytes )
{
case 1:
out.print( HexDump.toHex( (byte) in.read() ) );
break;
case 2:
out.print( HexDump.toHex( LittleEndian.readShort( in ) ) );
break;
case 4:
out.print( HexDump.toHex( LittleEndian.readInt( in ) ) );
break;
default:
throw new IOException( "Unable to output variable of that width" );
}
}
/**
* A simple test stub.
*
* @param args the args
*/
public static void main( String[] args ) {
main(args, System.out);
}
public static void main( String[] args, PrintStream out ) {
String dump =
"0F 00 00 F0 89 07 00 00 00 00 06 F0 18 00 00 00 " +
"05 04 00 00 02 00 00 00 05 00 00 00 01 00 00 00 " +
"01 00 00 00 05 00 00 00 4F 00 01 F0 2F 07 00 00 " +
"42 00 07 F0 B7 01 00 00 03 04 3F 14 AE 6B 0F 65 " +
"B0 48 BF 5E 94 63 80 E8 91 73 FF 00 93 01 00 00 " +
"01 00 00 00 00 00 00 00 00 00 FF FF 20 54 1C F0 " +
"8B 01 00 00 3F 14 AE 6B 0F 65 B0 48 BF 5E 94 63 " +
"80 E8 91 73 92 0E 00 00 00 00 00 00 00 00 00 00 " +
"D1 07 00 00 DD 05 00 00 4A AD 6F 00 8A C5 53 00 " +
"59 01 00 00 00 FE 78 9C E3 9B C4 00 04 AC 77 D9 " +
"2F 32 08 32 FD E7 61 F8 FF 0F C8 FD 05 C5 30 19 " +
"10 90 63 90 FA 0F 06 0C 8C 0C 5C 70 19 43 30 EB " +
"0E FB 05 86 85 0C DB 18 58 80 72 8C 70 16 0B 83 " +
"05 56 51 29 88 C9 60 D9 69 0C 6C 20 26 23 03 C8 " +
"74 B0 A8 0E 03 07 FB 45 56 C7 A2 CC C4 1C 06 66 " +
"A0 0D 2C 40 39 5E 86 4C 06 3D A0 4E 10 D0 60 D9 " +
"C8 58 CC E8 CF B0 80 61 3A 8A 7E 0D C6 23 AC 4F " +
"E0 E2 98 B6 12 2B 06 73 9D 12 E3 52 56 59 F6 08 " +
"8A CC 52 66 A3 50 FF 96 2B 94 E9 DF 4C A1 FE 2D " +
"3A 03 AB 9F 81 C2 F0 A3 54 BF 0F 85 EE A7 54 FF " +
"40 FB 7F A0 E3 9F D2 F4 4F 71 FE 19 58 FF 2B 31 " +
"7F 67 36 3B 25 4F 99 1B 4E 53 A6 5F 89 25 95 E9 " +
"C4 00 C7 83 12 F3 1F 26 35 4A D3 D2 47 0E 0A C3 " +
"41 8E C9 8A 52 37 DC 15 A1 D0 0D BC 4C 06 0C 2B " +
"28 2C 13 28 D4 EF 43 61 5A A0 58 3F 85 71 E0 4B " +
"69 9E 64 65 FE 39 C0 E5 22 30 1D 30 27 0E 74 3A " +
"18 60 FD 4A CC B1 2C 13 7D 07 36 2D 2A 31 85 B2 " +
"6A 0D 74 1D 1D 22 4D 99 FE 60 0A F5 9B EC 1C 58 " +
"FD 67 06 56 3F 38 0D 84 3C A5 30 0E 28 D3 AF C4 " +
"A4 CA FA 44 7A 0D 65 6E 60 7F 4D A1 1B 24 58 F7 " +
"49 AF A5 CC 0D CC DF 19 FE 03 00 F0 B1 25 4D 42 " +
"00 07 F0 E1 01 00 00 03 04 39 50 BE 98 B0 6F 57 " +
"24 31 70 5D 23 2F 9F 10 66 FF 00 BD 01 00 00 01 " +
"00 00 00 00 00 00 00 00 00 FF FF 20 54 1C F0 B5 " +
"01 00 00 39 50 BE 98 B0 6F 57 24 31 70 5D 23 2F " +
"9F 10 66 DA 03 00 00 00 00 00 00 00 00 00 00 D1 " +
"07 00 00 DD 05 00 00 4A AD 6F 00 8A C5 53 00 83 " +
"01 00 00 00 FE 78 9C A5 52 BF 4B 42 51 14 3E F7 " +
"DC 77 7A 16 45 48 8B 3C 48 A8 16 15 0D 6C 88 D0 " +
"04 C3 40 A3 32 1C 84 96 08 21 04 A1 C5 5C A2 35 " +
"82 C0 35 6A AB 1C 6A 6B A8 24 5A 83 68 08 84 84 " +
"96 A2 86 A0 7F C2 86 5E E7 5E F5 41 E4 10 BC 03 " +
"1F E7 FB F1 CE B9 F7 F1 9E 7C 05 2E 7A 37 9B E0 " +
"45 7B 10 EC 6F 96 5F 1D 74 13 55 7E B0 6C 5D 20 " +
"60 C0 49 A2 9A BD 99 4F 50 83 1B 30 38 13 0E 33 " +
"60 A6 A7 6B B5 37 EB F4 10 FA 14 15 A0 B6 6B 37 " +
"0C 1E B3 49 73 5B A5 C2 26 48 3E C1 E0 6C 08 4A " +
"30 C9 93 AA 02 B8 20 13 62 05 4E E1 E8 D7 7C C0 " +
"B8 14 95 5E BE B8 A7 CF 1E BE 55 2C 56 B9 78 DF " +
"08 7E 88 4C 27 FF 7B DB FF 7A DD B7 1A 17 67 34 " +
"6A AE BA DA 35 D1 E7 72 BE FE EC 6E FE DA E5 7C " +
"3D EC 7A DE 03 FD 50 06 0B 23 F2 0E F3 B2 A5 11 " +
"91 0D 4C B5 B5 F3 BF 94 C1 8F 24 F7 D9 6F 60 94 " +
"3B C9 9A F3 1C 6B E7 BB F0 2E 49 B2 25 2B C6 B1 " +
"EE 69 EE 15 63 4F 71 7D CE 85 CC C8 35 B9 C3 28 " +
"28 CE D0 5C 67 79 F2 4A A2 14 23 A4 38 43 73 9D " +
"2D 69 2F C1 08 31 9F C5 5C 9B EB 7B C5 69 19 B3 " +
"B4 81 F3 DC E3 B4 8E 8B CC B3 94 53 5A E7 41 2A " +
"63 9A AA 38 C5 3D 48 BB EC 57 59 6F 2B AD 73 1F " +
"1D 60 92 AE 70 8C BB 8F CE 31 C1 3C 49 27 4A EB " +
"DC A4 5B 8C D1 0B 0E 73 37 E9 11 A7 99 C7 E8 41 " +
"69 B0 7F 00 96 F2 A7 E8 42 00 07 F0 B4 01 00 00 " +
"03 04 1A BA F9 D6 A9 B9 3A 03 08 61 E9 90 FF 7B " +
"9E E6 FF 00 90 01 00 00 01 00 00 00 00 00 00 00 " +
"00 00 FF FF 20 54 1C F0 88 01 00 00 1A BA F9 D6 " +
"A9 B9 3A 03 08 61 E9 90 FF 7B 9E E6 12 0E 00 00 " +
"00 00 00 00 00 00 00 00 D1 07 00 00 DD 05 00 00 " +
"4A AD 6F 00 8A C5 53 00 56 01 00 00 00 FE 78 9C " +
"E3 13 62 00 02 D6 BB EC 17 19 04 99 FE F3 30 FC " +
"FF 07 E4 FE 82 62 98 0C 08 C8 31 48 FD 07 03 06 " +
"46 06 2E B8 8C 21 98 75 87 FD 02 C3 42 86 6D 0C " +
"2C 40 39 46 38 8B 85 C1 02 AB A8 14 C4 64 B0 EC " +
"34 06 36 10 93 91 01 64 3A 58 54 87 81 83 FD 22 " +
"AB 63 51 66 62 0E 03 33 D0 06 16 A0 1C 2F 43 26 " +
"83 1E 50 27 08 68 B0 6C 64 2C 66 F4 67 58 C0 30 " +
"1D 45 BF 06 E3 11 D6 27 70 71 4C 5B 89 15 83 B9 " +
"4E 89 71 29 AB 2C 7B 04 45 66 29 B3 51 A8 7F CB " +
"15 CA F4 6F A6 50 FF 16 9D 81 D5 CF 40 61 F8 51 " +
"AA DF 87 42 F7 53 AA 7F A0 FD 3F D0 F1 4F 69 FA " +
"A7 38 FF 0C AC FF 95 98 BF 33 9B 9D 92 A7 CC 0D " +
"A7 29 D3 AF C4 92 CA 74 62 80 E3 41 89 F9 0F 93 " +
"1A A5 69 E9 23 07 85 E1 20 C7 64 45 A9 1B EE 8A " +
"50 E8 06 5E 26 03 86 15 14 96 09 14 EA F7 A1 30 " +
"2D 50 AC 9F C2 38 F0 A5 34 4F B2 32 FF 1C E0 72 " +
"11 98 0E 98 13 07 38 1D 28 31 C7 B2 4C F4 1D D8 " +
"B4 A0 C4 14 CA AA 35 D0 75 64 88 34 65 FA 83 29 " +
"D4 6F B2 73 60 F5 9F A1 54 FF 0E CA D3 40 C8 53 " +
"0A E3 E0 09 85 6E 50 65 7D 22 BD 86 32 37 B0 BF " +
"A6 D0 0D 12 AC FB A4 D7 52 E6 06 E6 EF 0C FF 01 " +
"97 1D 12 C7 42 00 07 F0 C3 01 00 00 03 04 BA 4C " +
"B6 23 BA 8B 27 BE C8 55 59 86 24 9F 89 D4 FF 00 " +
"9F 01 00 00 01 00 00 00 00 00 00 00 00 00 FF FF " +
"20 54 1C F0 97 01 00 00 BA 4C B6 23 BA 8B 27 BE " +
"C8 55 59 86 24 9F 89 D4 AE 0E 00 00 00 00 00 00 " +
"00 00 00 00 D1 07 00 00 DD 05 00 00 4A AD 6F 00 " +
"8A C5 53 00 65 01 00 00 00 FE 78 9C E3 5B C7 00 " +
"04 AC 77 D9 2F 32 08 32 FD E7 61 F8 FF 0F C8 FD " +
"05 C5 30 19 10 90 63 90 FA 0F 06 0C 8C 0C 5C 70 " +
"19 43 30 EB 0E FB 05 86 85 0C DB 18 58 80 72 8C " +
"70 16 0B 83 05 56 51 29 88 C9 60 D9 69 0C 6C 20 " +
"26 23 03 C8 74 B0 A8 0E 03 07 FB 45 56 C7 A2 CC " +
"C4 1C 06 66 A0 0D 2C 40 39 5E 86 4C 06 3D A0 4E " +
"10 D0 60 99 C6 B8 98 D1 9F 61 01 C3 74 14 FD 1A " +
"8C 2B D8 84 B1 88 4B A5 A5 75 03 01 50 DF 59 46 " +
"77 46 0F A8 3C A6 AB 88 15 83 B9 5E 89 B1 8B D5 " +
"97 2D 82 22 B3 94 29 D5 BF E5 CA C0 EA DF AC 43 " +
"A1 FD 14 EA 67 A0 30 FC 28 D5 EF 43 A1 FB 7D 87 " +
"B8 FF 07 3A FE 07 3A FD 53 EA 7E 0A C3 4F 89 F9 " +
"0E 73 EA 69 79 CA DC 70 8A 32 FD 4A 2C 5E 4C DF " +
"87 7A 3C BC E0 A5 30 1E 3E 31 C5 33 AC A0 30 2F " +
"52 A8 DF 87 C2 30 A4 54 3F A5 65 19 85 65 A9 12 " +
"D3 2B 16 0D 8A CB 13 4A F3 E3 27 E6 09 03 9D 0E " +
"06 58 BF 12 B3 13 CB C1 01 4E 8B 4A 4C 56 AC 91 " +
"03 5D 37 86 48 53 A6 3F 98 42 FD 26 3B 07 56 FF " +
"99 1D 14 EA A7 CC 7E 70 1A 08 79 42 61 1C 3C A5 " +
"D0 0D 9C 6C C2 32 6B 29 73 03 DB 6B CA DC C0 F8 " +
"97 F5 AD CC 1A CA DC C0 F4 83 32 37 B0 A4 30 CE " +
"FC C7 48 99 1B FE 33 32 FC 07 00 6C CC 2E 23 33 " +
"00 0B F0 12 00 00 00 BF 00 08 00 08 00 81 01 09 " +
"00 00 08 C0 01 40 00 00 08 40 00 1E F1 10 00 00 " +
"00 0D 00 00 08 0C 00 00 08 17 00 00 08 F7 00 00 " +
"10 ";
// Decode the stream to bytes
byte[] bytes = HexRead.readFromString(dump);
// Create a new instance of the escher dumper
EscherDump dumper = new EscherDump();
// Dump the contents of scher to screen.
// dumper.dumpOld( bytes.length, new ByteArrayInputStream( bytes ), System.out );
dumper.dump(bytes, 0, bytes.length, out);
}
public void dump( int recordSize, byte[] data, PrintStream out ) {
dump( data, 0, recordSize, out );

View File

@ -386,22 +386,6 @@ public final class EscherMetafileBlip extends EscherBlipRecord {
setCompressed(true);
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][]{
// record, version, instance are directly fetched
{ "UID", field_1_UID, "UID2", field_2_UID },
{ "Uncompressed Size", field_2_cb },
{ "Bounds", getBounds().toString() },
{ "Size in EMU", getSizeEMU().toString() },
{ "Compressed Size", field_5_cbSave },
{ "Compression", field_6_fCompression },
{ "Filter", field_7_fFilter },
{ "Extra Data", "" },
{ "Remaining Data", remainingData }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
final Map<String, Supplier<?>> m = new LinkedHashMap<>(super.getGenericProperties());

View File

@ -284,20 +284,6 @@ public final class EscherPictBlip extends EscherBlipRecord {
field_7_fFilter = filter;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][]{
{ "UID", field_1_UID },
{ "Uncompressed Size", field_2_cb },
{ "Bounds", getBounds().toString() },
{ "Size in EMU", getSizeEMU().toString() },
{ "Compressed Size", field_5_cbSave },
{ "Compression", field_6_fCompression },
{ "Filter", field_7_fFilter },
{ "Extra Data", getPicturedata() },
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
final Map<String, Supplier<?>> m = new LinkedHashMap<>(super.getGenericProperties());

View File

@ -17,666 +17,334 @@
package org.apache.poi.ddf;
import java.util.HashMap;
import java.util.Map;
import org.apache.poi.util.Removal;
/**
* Provides a list of all known escher properties including the description and
* type.
* Provides a list of all known escher properties including the description and type.
*
* @author Glen Stampoultzis (glens at apache.org)
* @deprecated use {@link EscherPropertyTypes} enum instead
*/
@SuppressWarnings("WeakerAccess")
public final class EscherProperties {
@SuppressWarnings({"unused"})
@Deprecated
@Removal(version = "5.0.0")
public interface EscherProperties {
short TRANSFORM__ROTATION = EscherPropertyTypes.TRANSFORM__ROTATION.propNumber;
short PROTECTION__LOCKROTATION = EscherPropertyTypes.PROTECTION__LOCKROTATION.propNumber;
short PROTECTION__LOCKASPECTRATIO = EscherPropertyTypes.PROTECTION__LOCKASPECTRATIO.propNumber;
short PROTECTION__LOCKPOSITION = EscherPropertyTypes.PROTECTION__LOCKPOSITION.propNumber;
short PROTECTION__LOCKAGAINSTSELECT = EscherPropertyTypes.PROTECTION__LOCKAGAINSTSELECT.propNumber;
short PROTECTION__LOCKCROPPING = EscherPropertyTypes.PROTECTION__LOCKCROPPING.propNumber;
short PROTECTION__LOCKVERTICES = EscherPropertyTypes.PROTECTION__LOCKVERTICES.propNumber;
short PROTECTION__LOCKTEXT = EscherPropertyTypes.PROTECTION__LOCKTEXT.propNumber;
short PROTECTION__LOCKADJUSTHANDLES = EscherPropertyTypes.PROTECTION__LOCKADJUSTHANDLES.propNumber;
short PROTECTION__LOCKAGAINSTGROUPING = EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING.propNumber;
short TEXT__TEXTID = EscherPropertyTypes.TEXT__TEXTID.propNumber;
short TEXT__TEXTLEFT = EscherPropertyTypes.TEXT__TEXTLEFT.propNumber;
short TEXT__TEXTTOP = EscherPropertyTypes.TEXT__TEXTTOP.propNumber;
short TEXT__TEXTRIGHT = EscherPropertyTypes.TEXT__TEXTRIGHT.propNumber;
short TEXT__TEXTBOTTOM = EscherPropertyTypes.TEXT__TEXTBOTTOM.propNumber;
short TEXT__WRAPTEXT = EscherPropertyTypes.TEXT__WRAPTEXT.propNumber;
short TEXT__SCALETEXT = EscherPropertyTypes.TEXT__SCALETEXT.propNumber;
short TEXT__ANCHORTEXT = EscherPropertyTypes.TEXT__ANCHORTEXT.propNumber;
short TEXT__TEXTFLOW = EscherPropertyTypes.TEXT__TEXTFLOW.propNumber;
short TEXT__FONTROTATION = EscherPropertyTypes.TEXT__FONTROTATION.propNumber;
short TEXT__IDOFNEXTSHAPE = EscherPropertyTypes.TEXT__IDOFNEXTSHAPE.propNumber;
short TEXT__BIDIR = EscherPropertyTypes.TEXT__BIDIR.propNumber;
short TEXT__SINGLECLICKSELECTS = EscherPropertyTypes.TEXT__SINGLECLICKSELECTS.propNumber;
short TEXT__USEHOSTMARGINS = EscherPropertyTypes.TEXT__USEHOSTMARGINS.propNumber;
short TEXT__ROTATETEXTWITHSHAPE = EscherPropertyTypes.TEXT__ROTATETEXTWITHSHAPE.propNumber;
short TEXT__SIZESHAPETOFITTEXT = EscherPropertyTypes.TEXT__SIZESHAPETOFITTEXT.propNumber;
short TEXT__SIZE_TEXT_TO_FIT_SHAPE = EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE.propNumber;
short GEOTEXT__UNICODE = EscherPropertyTypes.GEOTEXT__UNICODE.propNumber;
short GEOTEXT__RTFTEXT = EscherPropertyTypes.GEOTEXT__RTFTEXT.propNumber;
short GEOTEXT__ALIGNMENTONCURVE = EscherPropertyTypes.GEOTEXT__ALIGNMENTONCURVE.propNumber;
short GEOTEXT__DEFAULTPOINTSIZE = EscherPropertyTypes.GEOTEXT__DEFAULTPOINTSIZE.propNumber;
short GEOTEXT__TEXTSPACING = EscherPropertyTypes.GEOTEXT__TEXTSPACING.propNumber;
short GEOTEXT__FONTFAMILYNAME = EscherPropertyTypes.GEOTEXT__FONTFAMILYNAME.propNumber;
short GEOTEXT__REVERSEROWORDER = EscherPropertyTypes.GEOTEXT__REVERSEROWORDER.propNumber;
short GEOTEXT__HASTEXTEFFECT = EscherPropertyTypes.GEOTEXT__HASTEXTEFFECT.propNumber;
short GEOTEXT__ROTATECHARACTERS = EscherPropertyTypes.GEOTEXT__ROTATECHARACTERS.propNumber;
short GEOTEXT__KERNCHARACTERS = EscherPropertyTypes.GEOTEXT__KERNCHARACTERS.propNumber;
short GEOTEXT__TIGHTORTRACK = EscherPropertyTypes.GEOTEXT__TIGHTORTRACK.propNumber;
short GEOTEXT__STRETCHTOFITSHAPE = EscherPropertyTypes.GEOTEXT__STRETCHTOFITSHAPE.propNumber;
short GEOTEXT__CHARBOUNDINGBOX = EscherPropertyTypes.GEOTEXT__CHARBOUNDINGBOX.propNumber;
short GEOTEXT__SCALETEXTONPATH = EscherPropertyTypes.GEOTEXT__SCALETEXTONPATH.propNumber;
short GEOTEXT__STRETCHCHARHEIGHT = EscherPropertyTypes.GEOTEXT__STRETCHCHARHEIGHT.propNumber;
short GEOTEXT__NOMEASUREALONGPATH = EscherPropertyTypes.GEOTEXT__NOMEASUREALONGPATH.propNumber;
short GEOTEXT__BOLDFONT = EscherPropertyTypes.GEOTEXT__BOLDFONT.propNumber;
short GEOTEXT__ITALICFONT = EscherPropertyTypes.GEOTEXT__ITALICFONT.propNumber;
short GEOTEXT__UNDERLINEFONT = EscherPropertyTypes.GEOTEXT__UNDERLINEFONT.propNumber;
short GEOTEXT__SHADOWFONT = EscherPropertyTypes.GEOTEXT__SHADOWFONT.propNumber;
short GEOTEXT__SMALLCAPSFONT = EscherPropertyTypes.GEOTEXT__SMALLCAPSFONT.propNumber;
short GEOTEXT__STRIKETHROUGHFONT = EscherPropertyTypes.GEOTEXT__STRIKETHROUGHFONT.propNumber;
short BLIP__CROPFROMTOP = EscherPropertyTypes.BLIP__CROPFROMTOP.propNumber;
short BLIP__CROPFROMBOTTOM = EscherPropertyTypes.BLIP__CROPFROMBOTTOM.propNumber;
short BLIP__CROPFROMLEFT = EscherPropertyTypes.BLIP__CROPFROMLEFT.propNumber;
short BLIP__CROPFROMRIGHT = EscherPropertyTypes.BLIP__CROPFROMRIGHT.propNumber;
short BLIP__BLIPTODISPLAY = EscherPropertyTypes.BLIP__BLIPTODISPLAY.propNumber;
short BLIP__BLIPFILENAME = EscherPropertyTypes.BLIP__BLIPFILENAME.propNumber;
short BLIP__BLIPFLAGS = EscherPropertyTypes.BLIP__BLIPFLAGS.propNumber;
short BLIP__TRANSPARENTCOLOR = EscherPropertyTypes.BLIP__TRANSPARENTCOLOR.propNumber;
short BLIP__CONTRASTSETTING = EscherPropertyTypes.BLIP__CONTRASTSETTING.propNumber;
short BLIP__BRIGHTNESSSETTING = EscherPropertyTypes.BLIP__BRIGHTNESSSETTING.propNumber;
short BLIP__GAMMA = EscherPropertyTypes.BLIP__GAMMA.propNumber;
short BLIP__PICTUREID = EscherPropertyTypes.BLIP__PICTUREID.propNumber;
short BLIP__DOUBLEMOD = EscherPropertyTypes.BLIP__DOUBLEMOD.propNumber;
short BLIP__PICTUREFILLMOD = EscherPropertyTypes.BLIP__PICTUREFILLMOD.propNumber;
short BLIP__PICTURELINE = EscherPropertyTypes.BLIP__PICTURELINE.propNumber;
short BLIP__PRINTBLIP = EscherPropertyTypes.BLIP__PRINTBLIP.propNumber;
short BLIP__PRINTBLIPFILENAME = EscherPropertyTypes.BLIP__PRINTBLIPFILENAME.propNumber;
short BLIP__PRINTFLAGS = EscherPropertyTypes.BLIP__PRINTFLAGS.propNumber;
short BLIP__NOHITTESTPICTURE = EscherPropertyTypes.BLIP__NOHITTESTPICTURE.propNumber;
short BLIP__PICTUREGRAY = EscherPropertyTypes.BLIP__PICTUREGRAY.propNumber;
short BLIP__PICTUREBILEVEL = EscherPropertyTypes.BLIP__PICTUREBILEVEL.propNumber;
short BLIP__PICTUREACTIVE = EscherPropertyTypes.BLIP__PICTUREACTIVE.propNumber;
short GEOMETRY__LEFT = EscherPropertyTypes.GEOMETRY__LEFT.propNumber;
short GEOMETRY__TOP = EscherPropertyTypes.GEOMETRY__TOP.propNumber;
short GEOMETRY__RIGHT = EscherPropertyTypes.GEOMETRY__RIGHT.propNumber;
short GEOMETRY__BOTTOM = EscherPropertyTypes.GEOMETRY__BOTTOM.propNumber;
short GEOMETRY__SHAPEPATH = EscherPropertyTypes.GEOMETRY__SHAPEPATH.propNumber;
short GEOMETRY__VERTICES = EscherPropertyTypes.GEOMETRY__VERTICES.propNumber;
short GEOMETRY__SEGMENTINFO = EscherPropertyTypes.GEOMETRY__SEGMENTINFO.propNumber;
short GEOMETRY__ADJUSTVALUE = EscherPropertyTypes.GEOMETRY__ADJUSTVALUE.propNumber;
short GEOMETRY__ADJUST2VALUE = EscherPropertyTypes.GEOMETRY__ADJUST2VALUE.propNumber;
short GEOMETRY__ADJUST3VALUE = EscherPropertyTypes.GEOMETRY__ADJUST3VALUE.propNumber;
short GEOMETRY__ADJUST4VALUE = EscherPropertyTypes.GEOMETRY__ADJUST4VALUE.propNumber;
short GEOMETRY__ADJUST5VALUE = EscherPropertyTypes.GEOMETRY__ADJUST5VALUE.propNumber;
short GEOMETRY__ADJUST6VALUE = EscherPropertyTypes.GEOMETRY__ADJUST6VALUE.propNumber;
short GEOMETRY__ADJUST7VALUE = EscherPropertyTypes.GEOMETRY__ADJUST7VALUE.propNumber;
short GEOMETRY__ADJUST8VALUE = EscherPropertyTypes.GEOMETRY__ADJUST8VALUE.propNumber;
short GEOMETRY__ADJUST9VALUE = EscherPropertyTypes.GEOMETRY__ADJUST9VALUE.propNumber;
short GEOMETRY__ADJUST10VALUE = EscherPropertyTypes.GEOMETRY__ADJUST10VALUE.propNumber;
short GEOMETRY__PCONNECTIONSITES = EscherPropertyTypes.GEOMETRY__PCONNECTIONSITES.propNumber;
short GEOMETRY__PCONNECTIONSITESDIR = EscherPropertyTypes.GEOMETRY__PCONNECTIONSITESDIR.propNumber;
short GEOMETRY__XLIMO = EscherPropertyTypes.GEOMETRY__XLIMO.propNumber;
short GEOMETRY__YLIMO = EscherPropertyTypes.GEOMETRY__YLIMO.propNumber;
short GEOMETRY__PADJUSTHANDLES = EscherPropertyTypes.GEOMETRY__PADJUSTHANDLES.propNumber;
short GEOMETRY__PGUIDES = EscherPropertyTypes.GEOMETRY__PGUIDES.propNumber;
short GEOMETRY__PINSCRIBE = EscherPropertyTypes.GEOMETRY__PINSCRIBE.propNumber;
short GEOMETRY__CXK = EscherPropertyTypes.GEOMETRY__CXK.propNumber;
short GEOMETRY__PFRAGMENTS = EscherPropertyTypes.GEOMETRY__PFRAGMENTS.propNumber;
short GEOMETRY__SHADOWok = EscherPropertyTypes.GEOMETRY__SHADOWOK.propNumber;
short GEOMETRY__3DOK = EscherPropertyTypes.GEOMETRY__3DOK.propNumber;
short GEOMETRY__LINEOK = EscherPropertyTypes.GEOMETRY__LINEOK.propNumber;
short GEOMETRY__GEOTEXTOK = EscherPropertyTypes.GEOMETRY__GEOTEXTOK.propNumber;
short GEOMETRY__FILLSHADESHAPEOK = EscherPropertyTypes.GEOMETRY__FILLSHADESHAPEOK.propNumber;
short GEOMETRY__FILLOK = EscherPropertyTypes.GEOMETRY__FILLOK.propNumber;
short FILL__FILLTYPE = EscherPropertyTypes.FILL__FILLTYPE.propNumber;
short FILL__FILLCOLOR = EscherPropertyTypes.FILL__FILLCOLOR.propNumber;
short FILL__FILLOPACITY = EscherPropertyTypes.FILL__FILLOPACITY.propNumber;
short FILL__FILLBACKCOLOR = EscherPropertyTypes.FILL__FILLBACKCOLOR.propNumber;
short FILL__BACKOPACITY = EscherPropertyTypes.FILL__BACKOPACITY.propNumber;
short FILL__CRMOD = EscherPropertyTypes.FILL__CRMOD.propNumber;
short FILL__PATTERNTEXTURE = EscherPropertyTypes.FILL__PATTERNTEXTURE.propNumber;
short FILL__BLIPFILENAME = EscherPropertyTypes.FILL__BLIPFILENAME.propNumber;
short FILL__BLIPFLAGS = EscherPropertyTypes.FILL__BLIPFLAGS.propNumber;
short FILL__WIDTH = EscherPropertyTypes.FILL__WIDTH.propNumber;
short FILL__HEIGHT = EscherPropertyTypes.FILL__HEIGHT.propNumber;
short FILL__ANGLE = EscherPropertyTypes.FILL__ANGLE.propNumber;
short FILL__FOCUS = EscherPropertyTypes.FILL__FOCUS.propNumber;
short FILL__TOLEFT = EscherPropertyTypes.FILL__TOLEFT.propNumber;
short FILL__TOTOP = EscherPropertyTypes.FILL__TOTOP.propNumber;
short FILL__TORIGHT = EscherPropertyTypes.FILL__TORIGHT.propNumber;
short FILL__TOBOTTOM = EscherPropertyTypes.FILL__TOBOTTOM.propNumber;
short FILL__RECTLEFT = EscherPropertyTypes.FILL__RECTLEFT.propNumber;
short FILL__RECTTOP = EscherPropertyTypes.FILL__RECTTOP.propNumber;
short FILL__RECTRIGHT = EscherPropertyTypes.FILL__RECTRIGHT.propNumber;
short FILL__RECTBOTTOM = EscherPropertyTypes.FILL__RECTBOTTOM.propNumber;
short FILL__DZTYPE = EscherPropertyTypes.FILL__DZTYPE.propNumber;
short FILL__SHADEPRESET = EscherPropertyTypes.FILL__SHADEPRESET.propNumber;
short FILL__SHADECOLORS = EscherPropertyTypes.FILL__SHADECOLORS.propNumber;
short FILL__ORIGINX = EscherPropertyTypes.FILL__ORIGINX.propNumber;
short FILL__ORIGINY = EscherPropertyTypes.FILL__ORIGINY.propNumber;
short FILL__SHAPEORIGINX = EscherPropertyTypes.FILL__SHAPEORIGINX.propNumber;
short FILL__SHAPEORIGINY = EscherPropertyTypes.FILL__SHAPEORIGINY.propNumber;
short FILL__SHADETYPE = EscherPropertyTypes.FILL__SHADETYPE.propNumber;
short FILL__FILLED = EscherPropertyTypes.FILL__FILLED.propNumber;
short FILL__HITTESTFILL = EscherPropertyTypes.FILL__HITTESTFILL.propNumber;
short FILL__SHAPE = EscherPropertyTypes.FILL__SHAPE.propNumber;
short FILL__USERECT = EscherPropertyTypes.FILL__USERECT.propNumber;
short FILL__NOFILLHITTEST = EscherPropertyTypes.FILL__NOFILLHITTEST.propNumber;
short LINESTYLE__COLOR = EscherPropertyTypes.LINESTYLE__COLOR.propNumber;
short LINESTYLE__OPACITY = EscherPropertyTypes.LINESTYLE__OPACITY.propNumber;
short LINESTYLE__BACKCOLOR = EscherPropertyTypes.LINESTYLE__BACKCOLOR.propNumber;
short LINESTYLE__CRMOD = EscherPropertyTypes.LINESTYLE__CRMOD.propNumber;
short LINESTYLE__LINETYPE = EscherPropertyTypes.LINESTYLE__LINETYPE.propNumber;
short LINESTYLE__FILLBLIP = EscherPropertyTypes.LINESTYLE__FILLBLIP.propNumber;
short LINESTYLE__FILLBLIPNAME = EscherPropertyTypes.LINESTYLE__FILLBLIPNAME.propNumber;
short LINESTYLE__FILLBLIPFLAGS = EscherPropertyTypes.LINESTYLE__FILLBLIPFLAGS.propNumber;
short LINESTYLE__FILLWIDTH = EscherPropertyTypes.LINESTYLE__FILLWIDTH.propNumber;
short LINESTYLE__FILLHEIGHT = EscherPropertyTypes.LINESTYLE__FILLHEIGHT.propNumber;
short LINESTYLE__FILLDZTYPE = EscherPropertyTypes.LINESTYLE__FILLDZTYPE.propNumber;
short LINESTYLE__LINEWIDTH = EscherPropertyTypes.LINESTYLE__LINEWIDTH.propNumber;
short LINESTYLE__LINEMITERLIMIT = EscherPropertyTypes.LINESTYLE__LINEMITERLIMIT.propNumber;
short LINESTYLE__LINESTYLE = EscherPropertyTypes.LINESTYLE__LINESTYLE.propNumber;
short LINESTYLE__LINEDASHING = EscherPropertyTypes.LINESTYLE__LINEDASHING.propNumber;
short LINESTYLE__LINEDASHSTYLE = EscherPropertyTypes.LINESTYLE__LINEDASHSTYLE.propNumber;
short LINESTYLE__LINESTARTARROWHEAD = EscherPropertyTypes.LINESTYLE__LINESTARTARROWHEAD.propNumber;
short LINESTYLE__LINEENDARROWHEAD = EscherPropertyTypes.LINESTYLE__LINEENDARROWHEAD.propNumber;
short LINESTYLE__LINESTARTARROWWIDTH = EscherPropertyTypes.LINESTYLE__LINESTARTARROWWIDTH.propNumber;
short LINESTYLE__LINESTARTARROWLENGTH = EscherPropertyTypes.LINESTYLE__LINESTARTARROWLENGTH.propNumber;
short LINESTYLE__LINEENDARROWWIDTH = EscherPropertyTypes.LINESTYLE__LINEENDARROWWIDTH.propNumber;
short LINESTYLE__LINEENDARROWLENGTH = EscherPropertyTypes.LINESTYLE__LINEENDARROWLENGTH.propNumber;
short LINESTYLE__LINEJOINSTYLE = EscherPropertyTypes.LINESTYLE__LINEJOINSTYLE.propNumber;
short LINESTYLE__LINEENDCAPSTYLE = EscherPropertyTypes.LINESTYLE__LINEENDCAPSTYLE.propNumber;
short LINESTYLE__ARROWHEADSOK = EscherPropertyTypes.LINESTYLE__ARROWHEADSOK.propNumber;
short LINESTYLE__ANYLINE = EscherPropertyTypes.LINESTYLE__ANYLINE.propNumber;
short LINESTYLE__HITLINETEST = EscherPropertyTypes.LINESTYLE__HITLINETEST.propNumber;
short LINESTYLE__LINEFILLSHAPE = EscherPropertyTypes.LINESTYLE__LINEFILLSHAPE.propNumber;
short LINESTYLE__NOLINEDRAWDASH = EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH.propNumber;
short LINESTYLE__NOLINEDRAWDASH_LEFT = EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH_LEFT.propNumber;
short LINESTYLE__NOLINEDRAWDASH_TOP = EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH_TOP.propNumber;
short LINESTYLE__NOLINEDRAWDASH_BOTTOM = EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH_BOTTOM.propNumber;
short LINESTYLE__NOLINEDRAWDASH_RIGHT = EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH_RIGHT.propNumber;
short SHADOWSTYLE__TYPE = EscherPropertyTypes.SHADOWSTYLE__TYPE.propNumber;
short SHADOWSTYLE__COLOR = EscherPropertyTypes.SHADOWSTYLE__COLOR.propNumber;
short SHADOWSTYLE__HIGHLIGHT = EscherPropertyTypes.SHADOWSTYLE__HIGHLIGHT.propNumber;
short SHADOWSTYLE__CRMOD = EscherPropertyTypes.SHADOWSTYLE__CRMOD.propNumber;
short SHADOWSTYLE__OPACITY = EscherPropertyTypes.SHADOWSTYLE__OPACITY.propNumber;
short SHADOWSTYLE__OFFSETX = EscherPropertyTypes.SHADOWSTYLE__OFFSETX.propNumber;
short SHADOWSTYLE__OFFSETY = EscherPropertyTypes.SHADOWSTYLE__OFFSETY.propNumber;
short SHADOWSTYLE__SECONDOFFSETX = EscherPropertyTypes.SHADOWSTYLE__SECONDOFFSETX.propNumber;
short SHADOWSTYLE__SECONDOFFSETY = EscherPropertyTypes.SHADOWSTYLE__SECONDOFFSETY.propNumber;
short SHADOWSTYLE__SCALEXTOX = EscherPropertyTypes.SHADOWSTYLE__SCALEXTOX.propNumber;
short SHADOWSTYLE__SCALEYTOX = EscherPropertyTypes.SHADOWSTYLE__SCALEYTOX.propNumber;
short SHADOWSTYLE__SCALEXTOY = EscherPropertyTypes.SHADOWSTYLE__SCALEXTOY.propNumber;
short SHADOWSTYLE__SCALEYTOY = EscherPropertyTypes.SHADOWSTYLE__SCALEYTOY.propNumber;
short SHADOWSTYLE__PERSPECTIVEX = EscherPropertyTypes.SHADOWSTYLE__PERSPECTIVEX.propNumber;
short SHADOWSTYLE__PERSPECTIVEY = EscherPropertyTypes.SHADOWSTYLE__PERSPECTIVEY.propNumber;
short SHADOWSTYLE__WEIGHT = EscherPropertyTypes.SHADOWSTYLE__WEIGHT.propNumber;
short SHADOWSTYLE__ORIGINX = EscherPropertyTypes.SHADOWSTYLE__ORIGINX.propNumber;
short SHADOWSTYLE__ORIGINY = EscherPropertyTypes.SHADOWSTYLE__ORIGINY.propNumber;
short SHADOWSTYLE__SHADOW = EscherPropertyTypes.SHADOWSTYLE__SHADOW.propNumber;
short SHADOWSTYLE__SHADOWOBSURED = EscherPropertyTypes.SHADOWSTYLE__SHADOWOBSURED.propNumber;
short PERSPECTIVE__TYPE = EscherPropertyTypes.PERSPECTIVE__TYPE.propNumber;
short PERSPECTIVE__OFFSETX = EscherPropertyTypes.PERSPECTIVE__OFFSETX.propNumber;
short PERSPECTIVE__OFFSETY = EscherPropertyTypes.PERSPECTIVE__OFFSETY.propNumber;
short PERSPECTIVE__SCALEXTOX = EscherPropertyTypes.PERSPECTIVE__SCALEXTOX.propNumber;
short PERSPECTIVE__SCALEYTOX = EscherPropertyTypes.PERSPECTIVE__SCALEYTOX.propNumber;
short PERSPECTIVE__SCALEXTOY = EscherPropertyTypes.PERSPECTIVE__SCALEXTOY.propNumber;
short PERSPECTIVE__SCALEYTOY = EscherPropertyTypes.PERSPECTIVE__SCALEYTOY.propNumber;
short PERSPECTIVE__PERSPECTIVEX = EscherPropertyTypes.PERSPECTIVE__PERSPECTIVEX.propNumber;
short PERSPECTIVE__PERSPECTIVEY = EscherPropertyTypes.PERSPECTIVE__PERSPECTIVEY.propNumber;
short PERSPECTIVE__WEIGHT = EscherPropertyTypes.PERSPECTIVE__WEIGHT.propNumber;
short PERSPECTIVE__ORIGINX = EscherPropertyTypes.PERSPECTIVE__ORIGINX.propNumber;
short PERSPECTIVE__ORIGINY = EscherPropertyTypes.PERSPECTIVE__ORIGINY.propNumber;
short PERSPECTIVE__PERSPECTIVEON = EscherPropertyTypes.PERSPECTIVE__PERSPECTIVEON.propNumber;
short THREED__SPECULARAMOUNT = EscherPropertyTypes.THREED__SPECULARAMOUNT.propNumber;
short THREED__DIFFUSEAMOUNT = EscherPropertyTypes.THREED__DIFFUSEAMOUNT.propNumber;
short THREED__SHININESS = EscherPropertyTypes.THREED__SHININESS.propNumber;
short THREED__EDGETHICKNESS = EscherPropertyTypes.THREED__EDGETHICKNESS.propNumber;
short THREED__EXTRUDEFORWARD = EscherPropertyTypes.THREED__EXTRUDEFORWARD.propNumber;
short THREED__EXTRUDEBACKWARD = EscherPropertyTypes.THREED__EXTRUDEBACKWARD.propNumber;
short THREED__EXTRUDEPLANE = EscherPropertyTypes.THREED__EXTRUDEPLANE.propNumber;
short THREED__EXTRUSIONCOLOR = EscherPropertyTypes.THREED__EXTRUSIONCOLOR.propNumber;
short THREED__CRMOD = EscherPropertyTypes.THREED__CRMOD.propNumber;
short THREED__3DEFFECT = EscherPropertyTypes.THREED__3DEFFECT.propNumber;
short THREED__METALLIC = EscherPropertyTypes.THREED__METALLIC.propNumber;
short THREED__USEEXTRUSIONCOLOR = EscherPropertyTypes.THREED__USEEXTRUSIONCOLOR.propNumber;
short THREED__LIGHTFACE = EscherPropertyTypes.THREED__LIGHTFACE.propNumber;
short THREEDSTYLE__YROTATIONANGLE = EscherPropertyTypes.THREEDSTYLE__YROTATIONANGLE.propNumber;
short THREEDSTYLE__XROTATIONANGLE = EscherPropertyTypes.THREEDSTYLE__XROTATIONANGLE.propNumber;
short THREEDSTYLE__ROTATIONAXISX = EscherPropertyTypes.THREEDSTYLE__ROTATIONAXISX.propNumber;
short THREEDSTYLE__ROTATIONAXISY = EscherPropertyTypes.THREEDSTYLE__ROTATIONAXISY.propNumber;
short THREEDSTYLE__ROTATIONAXISZ = EscherPropertyTypes.THREEDSTYLE__ROTATIONAXISZ.propNumber;
short THREEDSTYLE__ROTATIONANGLE = EscherPropertyTypes.THREEDSTYLE__ROTATIONANGLE.propNumber;
short THREEDSTYLE__ROTATIONCENTERX = EscherPropertyTypes.THREEDSTYLE__ROTATIONCENTERX.propNumber;
short THREEDSTYLE__ROTATIONCENTERY = EscherPropertyTypes.THREEDSTYLE__ROTATIONCENTERY.propNumber;
short THREEDSTYLE__ROTATIONCENTERZ = EscherPropertyTypes.THREEDSTYLE__ROTATIONCENTERZ.propNumber;
short THREEDSTYLE__RENDERMODE = EscherPropertyTypes.THREEDSTYLE__RENDERMODE.propNumber;
short THREEDSTYLE__TOLERANCE = EscherPropertyTypes.THREEDSTYLE__TOLERANCE.propNumber;
short THREEDSTYLE__XVIEWPOINT = EscherPropertyTypes.THREEDSTYLE__XVIEWPOINT.propNumber;
short THREEDSTYLE__YVIEWPOINT = EscherPropertyTypes.THREEDSTYLE__YVIEWPOINT.propNumber;
short THREEDSTYLE__ZVIEWPOINT = EscherPropertyTypes.THREEDSTYLE__ZVIEWPOINT.propNumber;
short THREEDSTYLE__ORIGINX = EscherPropertyTypes.THREEDSTYLE__ORIGINX.propNumber;
short THREEDSTYLE__ORIGINY = EscherPropertyTypes.THREEDSTYLE__ORIGINY.propNumber;
short THREEDSTYLE__SKEWANGLE = EscherPropertyTypes.THREEDSTYLE__SKEWANGLE.propNumber;
short THREEDSTYLE__SKEWAMOUNT = EscherPropertyTypes.THREEDSTYLE__SKEWAMOUNT.propNumber;
short THREEDSTYLE__AMBIENTINTENSITY = EscherPropertyTypes.THREEDSTYLE__AMBIENTINTENSITY.propNumber;
short THREEDSTYLE__KEYX = EscherPropertyTypes.THREEDSTYLE__KEYX.propNumber;
short THREEDSTYLE__KEYY = EscherPropertyTypes.THREEDSTYLE__KEYY.propNumber;
short THREEDSTYLE__KEYZ = EscherPropertyTypes.THREEDSTYLE__KEYZ.propNumber;
short THREEDSTYLE__KEYINTENSITY = EscherPropertyTypes.THREEDSTYLE__KEYINTENSITY.propNumber;
short THREEDSTYLE__FILLX = EscherPropertyTypes.THREEDSTYLE__FILLX.propNumber;
short THREEDSTYLE__FILLY = EscherPropertyTypes.THREEDSTYLE__FILLY.propNumber;
short THREEDSTYLE__FILLZ = EscherPropertyTypes.THREEDSTYLE__FILLZ.propNumber;
short THREEDSTYLE__FILLINTENSITY = EscherPropertyTypes.THREEDSTYLE__FILLINTENSITY.propNumber;
short THREEDSTYLE__CONSTRAINROTATION = EscherPropertyTypes.THREEDSTYLE__CONSTRAINROTATION.propNumber;
short THREEDSTYLE__ROTATIONCENTERAUTO = EscherPropertyTypes.THREEDSTYLE__ROTATIONCENTERAUTO.propNumber;
short THREEDSTYLE__PARALLEL = EscherPropertyTypes.THREEDSTYLE__PARALLEL.propNumber;
short THREEDSTYLE__KEYHARSH = EscherPropertyTypes.THREEDSTYLE__KEYHARSH.propNumber;
short THREEDSTYLE__FILLHARSH = EscherPropertyTypes.THREEDSTYLE__FILLHARSH.propNumber;
short SHAPE__MASTER = EscherPropertyTypes.SHAPE__MASTER.propNumber;
short SHAPE__CONNECTORSTYLE = EscherPropertyTypes.SHAPE__CONNECTORSTYLE.propNumber;
short SHAPE__BLACKANDWHITESETTINGS = EscherPropertyTypes.SHAPE__BLACKANDWHITESETTINGS.propNumber;
short SHAPE__WMODEPUREBW = EscherPropertyTypes.SHAPE__WMODEPUREBW.propNumber;
short SHAPE__WMODEBW = EscherPropertyTypes.SHAPE__WMODEBW.propNumber;
short SHAPE__OLEICON = EscherPropertyTypes.SHAPE__OLEICON.propNumber;
short SHAPE__PREFERRELATIVERESIZE = EscherPropertyTypes.SHAPE__PREFERRELATIVERESIZE.propNumber;
short SHAPE__LOCKSHAPETYPE = EscherPropertyTypes.SHAPE__LOCKSHAPETYPE.propNumber;
short SHAPE__DELETEATTACHEDOBJECT = EscherPropertyTypes.SHAPE__DELETEATTACHEDOBJECT.propNumber;
short SHAPE__BACKGROUNDSHAPE = EscherPropertyTypes.SHAPE__BACKGROUNDSHAPE.propNumber;
short CALLOUT__CALLOUTTYPE = EscherPropertyTypes.CALLOUT__CALLOUTTYPE.propNumber;
short CALLOUT__XYCALLOUTGAP = EscherPropertyTypes.CALLOUT__XYCALLOUTGAP.propNumber;
short CALLOUT__CALLOUTANGLE = EscherPropertyTypes.CALLOUT__CALLOUTANGLE.propNumber;
short CALLOUT__CALLOUTDROPTYPE = EscherPropertyTypes.CALLOUT__CALLOUTDROPTYPE.propNumber;
short CALLOUT__CALLOUTDROPSPECIFIED = EscherPropertyTypes.CALLOUT__CALLOUTDROPSPECIFIED.propNumber;
short CALLOUT__CALLOUTLENGTHSPECIFIED = EscherPropertyTypes.CALLOUT__CALLOUTLENGTHSPECIFIED.propNumber;
short CALLOUT__ISCALLOUT = EscherPropertyTypes.CALLOUT__ISCALLOUT.propNumber;
short CALLOUT__CALLOUTACCENTBAR = EscherPropertyTypes.CALLOUT__CALLOUTACCENTBAR.propNumber;
short CALLOUT__CALLOUTTEXTBORDER = EscherPropertyTypes.CALLOUT__CALLOUTTEXTBORDER.propNumber;
short CALLOUT__CALLOUTMINUSX = EscherPropertyTypes.CALLOUT__CALLOUTMINUSX.propNumber;
short CALLOUT__CALLOUTMINUSY = EscherPropertyTypes.CALLOUT__CALLOUTMINUSY.propNumber;
short CALLOUT__DROPAUTO = EscherPropertyTypes.CALLOUT__DROPAUTO.propNumber;
short CALLOUT__LENGTHSPECIFIED = EscherPropertyTypes.CALLOUT__LENGTHSPECIFIED.propNumber;
short GROUPSHAPE__SHAPENAME = EscherPropertyTypes.GROUPSHAPE__SHAPENAME.propNumber;
short GROUPSHAPE__DESCRIPTION = EscherPropertyTypes.GROUPSHAPE__DESCRIPTION.propNumber;
short GROUPSHAPE__HYPERLINK = EscherPropertyTypes.GROUPSHAPE__HYPERLINK.propNumber;
short GROUPSHAPE__WRAPPOLYGONVERTICES = EscherPropertyTypes.GROUPSHAPE__WRAPPOLYGONVERTICES.propNumber;
short GROUPSHAPE__WRAPDISTLEFT = EscherPropertyTypes.GROUPSHAPE__WRAPDISTLEFT.propNumber;
short GROUPSHAPE__WRAPDISTTOP = EscherPropertyTypes.GROUPSHAPE__WRAPDISTTOP.propNumber;
short GROUPSHAPE__WRAPDISTRIGHT = EscherPropertyTypes.GROUPSHAPE__WRAPDISTRIGHT.propNumber;
short GROUPSHAPE__WRAPDISTBOTTOM = EscherPropertyTypes.GROUPSHAPE__WRAPDISTBOTTOM.propNumber;
short GROUPSHAPE__REGROUPID = EscherPropertyTypes.GROUPSHAPE__REGROUPID.propNumber;
short GROUPSHAPE__UNUSED906 = EscherPropertyTypes.GROUPSHAPE__UNUSED906.propNumber;
short GROUPSHAPE__TOOLTIP = EscherPropertyTypes.GROUPSHAPE__TOOLTIP.propNumber;
short GROUPSHAPE__SCRIPT = EscherPropertyTypes.GROUPSHAPE__SCRIPT.propNumber;
short GROUPSHAPE__POSH = EscherPropertyTypes.GROUPSHAPE__POSH.propNumber;
short GROUPSHAPE__POSRELH = EscherPropertyTypes.GROUPSHAPE__POSRELH.propNumber;
short GROUPSHAPE__POSV = EscherPropertyTypes.GROUPSHAPE__POSV.propNumber;
short GROUPSHAPE__POSRELV = EscherPropertyTypes.GROUPSHAPE__POSRELV.propNumber;
short GROUPSHAPE__HR_PCT = EscherPropertyTypes.GROUPSHAPE__HR_PCT.propNumber;
short GROUPSHAPE__HR_ALIGN = EscherPropertyTypes.GROUPSHAPE__HR_ALIGN.propNumber;
short GROUPSHAPE__HR_HEIGHT = EscherPropertyTypes.GROUPSHAPE__HR_HEIGHT.propNumber;
short GROUPSHAPE__HR_WIDTH = EscherPropertyTypes.GROUPSHAPE__HR_WIDTH.propNumber;
short GROUPSHAPE__SCRIPTEXT = EscherPropertyTypes.GROUPSHAPE__SCRIPTEXT.propNumber;
short GROUPSHAPE__SCRIPTLANG = EscherPropertyTypes.GROUPSHAPE__SCRIPTLANG.propNumber;
short GROUPSHAPE__BORDERTOPCOLOR = EscherPropertyTypes.GROUPSHAPE__BORDERTOPCOLOR.propNumber;
short GROUPSHAPE__BORDERLEFTCOLOR = EscherPropertyTypes.GROUPSHAPE__BORDERLEFTCOLOR.propNumber;
short GROUPSHAPE__BORDERBOTTOMCOLOR = EscherPropertyTypes.GROUPSHAPE__BORDERBOTTOMCOLOR.propNumber;
short GROUPSHAPE__BORDERRIGHTCOLOR = EscherPropertyTypes.GROUPSHAPE__BORDERRIGHTCOLOR.propNumber;
short GROUPSHAPE__TABLEPROPERTIES = EscherPropertyTypes.GROUPSHAPE__TABLEPROPERTIES.propNumber;
short GROUPSHAPE__TABLEROWPROPERTIES = EscherPropertyTypes.GROUPSHAPE__TABLEROWPROPERTIES.propNumber;
short GROUPSHAPE__WEBBOT = EscherPropertyTypes.GROUPSHAPE__WEBBOT.propNumber;
short GROUPSHAPE__METROBLOB = EscherPropertyTypes.GROUPSHAPE__METROBLOB.propNumber;
short GROUPSHAPE__ZORDER = EscherPropertyTypes.GROUPSHAPE__ZORDER.propNumber;
short GROUPSHAPE__EDITEDWRAP = EscherPropertyTypes.GROUPSHAPE__EDITEDWRAP.propNumber;
short GROUPSHAPE__BEHINDDOCUMENT = EscherPropertyTypes.GROUPSHAPE__BEHINDDOCUMENT.propNumber;
short GROUPSHAPE__ONDBLCLICKNOTIFY = EscherPropertyTypes.GROUPSHAPE__ONDBLCLICKNOTIFY.propNumber;
short GROUPSHAPE__ISBUTTON = EscherPropertyTypes.GROUPSHAPE__ISBUTTON.propNumber;
short GROUPSHAPE__1DADJUSTMENT = EscherPropertyTypes.GROUPSHAPE__1DADJUSTMENT.propNumber;
short GROUPSHAPE__HIDDEN = EscherPropertyTypes.GROUPSHAPE__HIDDEN.propNumber;
short GROUPSHAPE__FLAGS = EscherPropertyTypes.GROUPSHAPE__FLAGS.propNumber;
short GROUPSHAPE__PRINT = EscherPropertyTypes.GROUPSHAPE__FLAGS.propNumber;
// Property constants
public static final short TRANSFORM__ROTATION = 4;
public static final short PROTECTION__LOCKROTATION = 119;
public static final short PROTECTION__LOCKASPECTRATIO = 120;
public static final short PROTECTION__LOCKPOSITION = 121;
public static final short PROTECTION__LOCKAGAINSTSELECT = 122;
public static final short PROTECTION__LOCKCROPPING = 123;
public static final short PROTECTION__LOCKVERTICES = 124;
public static final short PROTECTION__LOCKTEXT = 125;
public static final short PROTECTION__LOCKADJUSTHANDLES = 126;
public static final short PROTECTION__LOCKAGAINSTGROUPING = 127;
public static final short TEXT__TEXTID = 128;
public static final short TEXT__TEXTLEFT = 129;
public static final short TEXT__TEXTTOP = 130;
public static final short TEXT__TEXTRIGHT = 131;
public static final short TEXT__TEXTBOTTOM = 132;
public static final short TEXT__WRAPTEXT = 133;
public static final short TEXT__SCALETEXT = 134;
public static final short TEXT__ANCHORTEXT = 135;
public static final short TEXT__TEXTFLOW = 136;
public static final short TEXT__FONTROTATION = 137;
public static final short TEXT__IDOFNEXTSHAPE = 138;
public static final short TEXT__BIDIR = 139;
public static final short TEXT__SINGLECLICKSELECTS = 187;
public static final short TEXT__USEHOSTMARGINS = 188;
public static final short TEXT__ROTATETEXTWITHSHAPE = 189;
public static final short TEXT__SIZESHAPETOFITTEXT = 190;
public static final short TEXT__SIZE_TEXT_TO_FIT_SHAPE = 191;
public static final short GEOTEXT__UNICODE = 192;
public static final short GEOTEXT__RTFTEXT = 193;
public static final short GEOTEXT__ALIGNMENTONCURVE = 194;
public static final short GEOTEXT__DEFAULTPOINTSIZE = 195;
public static final short GEOTEXT__TEXTSPACING = 196;
public static final short GEOTEXT__FONTFAMILYNAME = 197;
public static final short GEOTEXT__REVERSEROWORDER = 240;
public static final short GEOTEXT__HASTEXTEFFECT = 241;
public static final short GEOTEXT__ROTATECHARACTERS = 242;
public static final short GEOTEXT__KERNCHARACTERS = 243;
public static final short GEOTEXT__TIGHTORTRACK = 244;
public static final short GEOTEXT__STRETCHTOFITSHAPE = 245;
public static final short GEOTEXT__CHARBOUNDINGBOX = 246;
public static final short GEOTEXT__SCALETEXTONPATH = 247;
public static final short GEOTEXT__STRETCHCHARHEIGHT = 248;
public static final short GEOTEXT__NOMEASUREALONGPATH = 249;
public static final short GEOTEXT__BOLDFONT = 250;
public static final short GEOTEXT__ITALICFONT = 251;
public static final short GEOTEXT__UNDERLINEFONT = 252;
public static final short GEOTEXT__SHADOWFONT = 253;
public static final short GEOTEXT__SMALLCAPSFONT = 254;
public static final short GEOTEXT__STRIKETHROUGHFONT = 255;
public static final short BLIP__CROPFROMTOP = 256;
public static final short BLIP__CROPFROMBOTTOM = 257;
public static final short BLIP__CROPFROMLEFT = 258;
public static final short BLIP__CROPFROMRIGHT = 259;
public static final short BLIP__BLIPTODISPLAY = 260;
public static final short BLIP__BLIPFILENAME = 261;
public static final short BLIP__BLIPFLAGS = 262;
public static final short BLIP__TRANSPARENTCOLOR = 263;
public static final short BLIP__CONTRASTSETTING = 264;
public static final short BLIP__BRIGHTNESSSETTING = 265;
public static final short BLIP__GAMMA = 266;
public static final short BLIP__PICTUREID = 267;
public static final short BLIP__DOUBLEMOD = 268;
public static final short BLIP__PICTUREFILLMOD = 269;
public static final short BLIP__PICTURELINE = 270;
public static final short BLIP__PRINTBLIP = 271;
public static final short BLIP__PRINTBLIPFILENAME = 272;
public static final short BLIP__PRINTFLAGS = 273;
public static final short BLIP__NOHITTESTPICTURE = 316;
public static final short BLIP__PICTUREGRAY = 317;
public static final short BLIP__PICTUREBILEVEL = 318;
public static final short BLIP__PICTUREACTIVE = 319;
public static final short GEOMETRY__LEFT = 320;
public static final short GEOMETRY__TOP = 321;
public static final short GEOMETRY__RIGHT = 322;
public static final short GEOMETRY__BOTTOM = 323;
public static final short GEOMETRY__SHAPEPATH = 324;
public static final short GEOMETRY__VERTICES = 325;
public static final short GEOMETRY__SEGMENTINFO = 326;
public static final short GEOMETRY__ADJUSTVALUE = 327;
public static final short GEOMETRY__ADJUST2VALUE = 328;
public static final short GEOMETRY__ADJUST3VALUE = 329;
public static final short GEOMETRY__ADJUST4VALUE = 330;
public static final short GEOMETRY__ADJUST5VALUE = 331;
public static final short GEOMETRY__ADJUST6VALUE = 332;
public static final short GEOMETRY__ADJUST7VALUE = 333;
public static final short GEOMETRY__ADJUST8VALUE = 334;
public static final short GEOMETRY__ADJUST9VALUE = 335;
public static final short GEOMETRY__ADJUST10VALUE = 336;
public static final short GEOMETRY__PCONNECTIONSITES = 337;
public static final short GEOMETRY__PCONNECTIONSITESDIR = 338;
public static final short GEOMETRY__XLIMO = 339;
public static final short GEOMETRY__YLIMO = 340;
public static final short GEOMETRY__PADJUSTHANDLES = 341;
public static final short GEOMETRY__PGUIDES = 342;
public static final short GEOMETRY__PINSCRIBE = 343;
public static final short GEOMETRY__CXK = 344;
public static final short GEOMETRY__PFRAGMENTS = 345;
public static final short GEOMETRY__SHADOWok = 378;
public static final short GEOMETRY__3DOK = 379;
public static final short GEOMETRY__LINEOK = 380;
public static final short GEOMETRY__GEOTEXTOK = 381;
public static final short GEOMETRY__FILLSHADESHAPEOK = 382;
public static final short GEOMETRY__FILLOK = 383;
public static final short FILL__FILLTYPE = 384;
public static final short FILL__FILLCOLOR = 385;
public static final short FILL__FILLOPACITY = 386;
public static final short FILL__FILLBACKCOLOR = 387;
public static final short FILL__BACKOPACITY = 388;
public static final short FILL__CRMOD = 389;
public static final short FILL__PATTERNTEXTURE = 390;
public static final short FILL__BLIPFILENAME = 391;
public static final short FILL__BLIPFLAGS = 392;
public static final short FILL__WIDTH = 393;
public static final short FILL__HEIGHT = 394;
public static final short FILL__ANGLE = 395;
public static final short FILL__FOCUS = 396;
public static final short FILL__TOLEFT = 397;
public static final short FILL__TOTOP = 398;
public static final short FILL__TORIGHT = 399;
public static final short FILL__TOBOTTOM = 400;
public static final short FILL__RECTLEFT = 401;
public static final short FILL__RECTTOP = 402;
public static final short FILL__RECTRIGHT = 403;
public static final short FILL__RECTBOTTOM = 404;
public static final short FILL__DZTYPE = 405;
public static final short FILL__SHADEPRESET = 406;
public static final short FILL__SHADECOLORS = 407;
public static final short FILL__ORIGINX = 408;
public static final short FILL__ORIGINY = 409;
public static final short FILL__SHAPEORIGINX = 410;
public static final short FILL__SHAPEORIGINY = 411;
public static final short FILL__SHADETYPE = 412;
public static final short FILL__FILLED = 443;
public static final short FILL__HITTESTFILL = 444;
public static final short FILL__SHAPE = 445;
public static final short FILL__USERECT = 446;
public static final short FILL__NOFILLHITTEST = 447;
public static final short LINESTYLE__COLOR = 448;
public static final short LINESTYLE__OPACITY = 449;
public static final short LINESTYLE__BACKCOLOR = 450;
public static final short LINESTYLE__CRMOD = 451;
public static final short LINESTYLE__LINETYPE = 452;
public static final short LINESTYLE__FILLBLIP = 453;
public static final short LINESTYLE__FILLBLIPNAME = 454;
public static final short LINESTYLE__FILLBLIPFLAGS = 455;
public static final short LINESTYLE__FILLWIDTH = 456;
public static final short LINESTYLE__FILLHEIGHT = 457;
public static final short LINESTYLE__FILLDZTYPE = 458;
public static final short LINESTYLE__LINEWIDTH = 459;
public static final short LINESTYLE__LINEMITERLIMIT = 460;
public static final short LINESTYLE__LINESTYLE = 461;
public static final short LINESTYLE__LINEDASHING = 462;
public static final short LINESTYLE__LINEDASHSTYLE = 463;
public static final short LINESTYLE__LINESTARTARROWHEAD = 464;
public static final short LINESTYLE__LINEENDARROWHEAD = 465;
public static final short LINESTYLE__LINESTARTARROWWIDTH = 466;
public static final short LINESTYLE__LINESTARTARROWLENGTH = 467;
public static final short LINESTYLE__LINEENDARROWWIDTH = 468;
public static final short LINESTYLE__LINEENDARROWLENGTH = 469;
public static final short LINESTYLE__LINEJOINSTYLE = 470;
public static final short LINESTYLE__LINEENDCAPSTYLE = 471;
public static final short LINESTYLE__ARROWHEADSOK = 507;
public static final short LINESTYLE__ANYLINE = 508;
public static final short LINESTYLE__HITLINETEST = 509;
public static final short LINESTYLE__LINEFILLSHAPE = 510;
public static final short LINESTYLE__NOLINEDRAWDASH = 511;
public static final short LINESTYLE__NOLINEDRAWDASH_LEFT = 0x057F;
public static final short LINESTYLE__NOLINEDRAWDASH_TOP = 0x05BF;
public static final short LINESTYLE__NOLINEDRAWDASH_BOTTOM = 0x063F;
public static final short LINESTYLE__NOLINEDRAWDASH_RIGHT = 0x05FF;
public static final short SHADOWSTYLE__TYPE = 512;
public static final short SHADOWSTYLE__COLOR = 513;
public static final short SHADOWSTYLE__HIGHLIGHT = 514;
public static final short SHADOWSTYLE__CRMOD = 515;
public static final short SHADOWSTYLE__OPACITY = 516;
public static final short SHADOWSTYLE__OFFSETX = 517;
public static final short SHADOWSTYLE__OFFSETY = 518;
public static final short SHADOWSTYLE__SECONDOFFSETX = 519;
public static final short SHADOWSTYLE__SECONDOFFSETY = 520;
public static final short SHADOWSTYLE__SCALEXTOX = 521;
public static final short SHADOWSTYLE__SCALEYTOX = 522;
public static final short SHADOWSTYLE__SCALEXTOY = 523;
public static final short SHADOWSTYLE__SCALEYTOY = 524;
public static final short SHADOWSTYLE__PERSPECTIVEX = 525;
public static final short SHADOWSTYLE__PERSPECTIVEY = 526;
public static final short SHADOWSTYLE__WEIGHT = 527;
public static final short SHADOWSTYLE__ORIGINX = 528;
public static final short SHADOWSTYLE__ORIGINY = 529;
public static final short SHADOWSTYLE__SHADOW = 574;
public static final short SHADOWSTYLE__SHADOWOBSURED = 575;
public static final short PERSPECTIVE__TYPE = 576;
public static final short PERSPECTIVE__OFFSETX = 577;
public static final short PERSPECTIVE__OFFSETY = 578;
public static final short PERSPECTIVE__SCALEXTOX = 579;
public static final short PERSPECTIVE__SCALEYTOX = 580;
public static final short PERSPECTIVE__SCALEXTOY = 581;
public static final short PERSPECTIVE__SCALEYTOY = 582;
public static final short PERSPECTIVE__PERSPECTIVEX = 583;
public static final short PERSPECTIVE__PERSPECTIVEY = 584;
public static final short PERSPECTIVE__WEIGHT = 585;
public static final short PERSPECTIVE__ORIGINX = 586;
public static final short PERSPECTIVE__ORIGINY = 587;
public static final short PERSPECTIVE__PERSPECTIVEON = 639;
public static final short THREED__SPECULARAMOUNT = 640;
public static final short THREED__DIFFUSEAMOUNT = 661;
public static final short THREED__SHININESS = 662;
public static final short THREED__EDGETHICKNESS = 663;
public static final short THREED__EXTRUDEFORWARD = 664;
public static final short THREED__EXTRUDEBACKWARD = 665;
public static final short THREED__EXTRUDEPLANE = 666;
public static final short THREED__EXTRUSIONCOLOR = 667;
public static final short THREED__CRMOD = 648;
public static final short THREED__3DEFFECT = 700;
public static final short THREED__METALLIC = 701;
public static final short THREED__USEEXTRUSIONCOLOR = 702;
public static final short THREED__LIGHTFACE = 703;
public static final short THREEDSTYLE__YROTATIONANGLE = 704;
public static final short THREEDSTYLE__XROTATIONANGLE = 705;
public static final short THREEDSTYLE__ROTATIONAXISX = 706;
public static final short THREEDSTYLE__ROTATIONAXISY = 707;
public static final short THREEDSTYLE__ROTATIONAXISZ = 708;
public static final short THREEDSTYLE__ROTATIONANGLE = 709;
public static final short THREEDSTYLE__ROTATIONCENTERX = 710;
public static final short THREEDSTYLE__ROTATIONCENTERY = 711;
public static final short THREEDSTYLE__ROTATIONCENTERZ = 712;
public static final short THREEDSTYLE__RENDERMODE = 713;
public static final short THREEDSTYLE__TOLERANCE = 714;
public static final short THREEDSTYLE__XVIEWPOINT = 715;
public static final short THREEDSTYLE__YVIEWPOINT = 716;
public static final short THREEDSTYLE__ZVIEWPOINT = 717;
public static final short THREEDSTYLE__ORIGINX = 718;
public static final short THREEDSTYLE__ORIGINY = 719;
public static final short THREEDSTYLE__SKEWANGLE = 720;
public static final short THREEDSTYLE__SKEWAMOUNT = 721;
public static final short THREEDSTYLE__AMBIENTINTENSITY = 722;
public static final short THREEDSTYLE__KEYX = 723;
public static final short THREEDSTYLE__KEYY = 724;
public static final short THREEDSTYLE__KEYZ = 725;
public static final short THREEDSTYLE__KEYINTENSITY = 726;
public static final short THREEDSTYLE__FILLX = 727;
public static final short THREEDSTYLE__FILLY = 728;
public static final short THREEDSTYLE__FILLZ = 729;
public static final short THREEDSTYLE__FILLINTENSITY = 730;
public static final short THREEDSTYLE__CONSTRAINROTATION = 763;
public static final short THREEDSTYLE__ROTATIONCENTERAUTO = 764;
public static final short THREEDSTYLE__PARALLEL = 765;
public static final short THREEDSTYLE__KEYHARSH = 766;
public static final short THREEDSTYLE__FILLHARSH = 767;
public static final short SHAPE__MASTER = 769;
public static final short SHAPE__CONNECTORSTYLE = 771;
public static final short SHAPE__BLACKANDWHITESETTINGS = 772;
public static final short SHAPE__WMODEPUREBW = 773;
public static final short SHAPE__WMODEBW = 774;
public static final short SHAPE__OLEICON = 826;
public static final short SHAPE__PREFERRELATIVERESIZE = 827;
public static final short SHAPE__LOCKSHAPETYPE = 828;
public static final short SHAPE__DELETEATTACHEDOBJECT = 830;
public static final short SHAPE__BACKGROUNDSHAPE = 831;
public static final short CALLOUT__CALLOUTTYPE = 832;
public static final short CALLOUT__XYCALLOUTGAP = 833;
public static final short CALLOUT__CALLOUTANGLE = 834;
public static final short CALLOUT__CALLOUTDROPTYPE = 835;
public static final short CALLOUT__CALLOUTDROPSPECIFIED = 836;
public static final short CALLOUT__CALLOUTLENGTHSPECIFIED = 837;
public static final short CALLOUT__ISCALLOUT = 889;
public static final short CALLOUT__CALLOUTACCENTBAR = 890;
public static final short CALLOUT__CALLOUTTEXTBORDER = 891;
public static final short CALLOUT__CALLOUTMINUSX = 892;
public static final short CALLOUT__CALLOUTMINUSY = 893;
public static final short CALLOUT__DROPAUTO = 894;
public static final short CALLOUT__LENGTHSPECIFIED = 895;
public static final short GROUPSHAPE__SHAPENAME = 0x0380;
public static final short GROUPSHAPE__DESCRIPTION = 0x0381;
public static final short GROUPSHAPE__HYPERLINK = 0x0382;
public static final short GROUPSHAPE__WRAPPOLYGONVERTICES = 0x0383;
public static final short GROUPSHAPE__WRAPDISTLEFT = 0x0384;
public static final short GROUPSHAPE__WRAPDISTTOP = 0x0385;
public static final short GROUPSHAPE__WRAPDISTRIGHT = 0x0386;
public static final short GROUPSHAPE__WRAPDISTBOTTOM = 0x0387;
public static final short GROUPSHAPE__REGROUPID = 0x0388;
public static final short GROUPSHAPE__UNUSED906 = 0x038A;
public static final short GROUPSHAPE__TOOLTIP = 0x038D;
public static final short GROUPSHAPE__SCRIPT = 0x038E;
public static final short GROUPSHAPE__POSH = 0x038F;
public static final short GROUPSHAPE__POSRELH = 0x0390;
public static final short GROUPSHAPE__POSV = 0x0391;
public static final short GROUPSHAPE__POSRELV = 0x0392;
public static final short GROUPSHAPE__HR_PCT = 0x0393;
public static final short GROUPSHAPE__HR_ALIGN = 0x0394;
public static final short GROUPSHAPE__HR_HEIGHT = 0x0395;
public static final short GROUPSHAPE__HR_WIDTH = 0x0396;
public static final short GROUPSHAPE__SCRIPTEXT = 0x0397;
public static final short GROUPSHAPE__SCRIPTLANG = 0x0398;
public static final short GROUPSHAPE__BORDERTOPCOLOR = 0x039B;
public static final short GROUPSHAPE__BORDERLEFTCOLOR = 0x039C;
public static final short GROUPSHAPE__BORDERBOTTOMCOLOR = 0x039D;
public static final short GROUPSHAPE__BORDERRIGHTCOLOR = 0x039E;
public static final short GROUPSHAPE__TABLEPROPERTIES = 0x039F;
public static final short GROUPSHAPE__TABLEROWPROPERTIES = 0x03A0;
public static final short GROUPSHAPE__WEBBOT = 0x03A5;
public static final short GROUPSHAPE__METROBLOB = 0x03A9;
public static final short GROUPSHAPE__ZORDER = 0x03AA;
public static final short GROUPSHAPE__FLAGS = 0x03BF;
public static final short GROUPSHAPE__EDITEDWRAP = 953;
public static final short GROUPSHAPE__BEHINDDOCUMENT = 954;
public static final short GROUPSHAPE__ONDBLCLICKNOTIFY = 955;
public static final short GROUPSHAPE__ISBUTTON = 956;
public static final short GROUPSHAPE__1DADJUSTMENT = 957;
public static final short GROUPSHAPE__HIDDEN = 958;
public static final short GROUPSHAPE__PRINT = 959;
private static final Map<Short, EscherPropertyMetaData> properties = initProps();
private EscherProperties() {
static String getPropertyName(short propertyId) {
return EscherPropertyTypes.forPropertyID(propertyId).propName;
}
private static Map<Short, EscherPropertyMetaData> initProps() {
Map<Short, EscherPropertyMetaData> m = new HashMap<>();
addProp(m, TRANSFORM__ROTATION, "transform.rotation");
addProp(m, PROTECTION__LOCKROTATION, "protection.lockrotation");
addProp(m, PROTECTION__LOCKASPECTRATIO, "protection.lockaspectratio");
addProp(m, PROTECTION__LOCKPOSITION, "protection.lockposition");
addProp(m, PROTECTION__LOCKAGAINSTSELECT, "protection.lockagainstselect");
addProp(m, PROTECTION__LOCKCROPPING, "protection.lockcropping");
addProp(m, PROTECTION__LOCKVERTICES, "protection.lockvertices");
addProp(m, PROTECTION__LOCKTEXT, "protection.locktext");
addProp(m, PROTECTION__LOCKADJUSTHANDLES, "protection.lockadjusthandles");
addProp(m, PROTECTION__LOCKAGAINSTGROUPING, "protection.lockagainstgrouping", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, TEXT__TEXTID, "text.textid");
addProp(m, TEXT__TEXTLEFT, "text.textleft");
addProp(m, TEXT__TEXTTOP, "text.texttop");
addProp(m, TEXT__TEXTRIGHT, "text.textright");
addProp(m, TEXT__TEXTBOTTOM, "text.textbottom");
addProp(m, TEXT__WRAPTEXT, "text.wraptext");
addProp(m, TEXT__SCALETEXT, "text.scaletext");
addProp(m, TEXT__ANCHORTEXT, "text.anchortext");
addProp(m, TEXT__TEXTFLOW, "text.textflow");
addProp(m, TEXT__FONTROTATION, "text.fontrotation");
addProp(m, TEXT__IDOFNEXTSHAPE, "text.idofnextshape");
addProp(m, TEXT__BIDIR, "text.bidir");
addProp(m, TEXT__SINGLECLICKSELECTS, "text.singleclickselects");
addProp(m, TEXT__USEHOSTMARGINS, "text.usehostmargins");
addProp(m, TEXT__ROTATETEXTWITHSHAPE, "text.rotatetextwithshape");
addProp(m, TEXT__SIZESHAPETOFITTEXT, "text.sizeshapetofittext");
addProp(m, TEXT__SIZE_TEXT_TO_FIT_SHAPE, "text.sizetexttofitshape", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, GEOTEXT__UNICODE, "geotext.unicode");
addProp(m, GEOTEXT__RTFTEXT, "geotext.rtftext");
addProp(m, GEOTEXT__ALIGNMENTONCURVE, "geotext.alignmentoncurve");
addProp(m, GEOTEXT__DEFAULTPOINTSIZE, "geotext.defaultpointsize");
addProp(m, GEOTEXT__TEXTSPACING, "geotext.textspacing");
addProp(m, GEOTEXT__FONTFAMILYNAME, "geotext.fontfamilyname");
addProp(m, GEOTEXT__REVERSEROWORDER, "geotext.reverseroworder");
addProp(m, GEOTEXT__HASTEXTEFFECT, "geotext.hastexteffect");
addProp(m, GEOTEXT__ROTATECHARACTERS, "geotext.rotatecharacters");
addProp(m, GEOTEXT__KERNCHARACTERS, "geotext.kerncharacters");
addProp(m, GEOTEXT__TIGHTORTRACK, "geotext.tightortrack");
addProp(m, GEOTEXT__STRETCHTOFITSHAPE, "geotext.stretchtofitshape");
addProp(m, GEOTEXT__CHARBOUNDINGBOX, "geotext.charboundingbox");
addProp(m, GEOTEXT__SCALETEXTONPATH, "geotext.scaletextonpath");
addProp(m, GEOTEXT__STRETCHCHARHEIGHT, "geotext.stretchcharheight");
addProp(m, GEOTEXT__NOMEASUREALONGPATH, "geotext.nomeasurealongpath");
addProp(m, GEOTEXT__BOLDFONT, "geotext.boldfont");
addProp(m, GEOTEXT__ITALICFONT, "geotext.italicfont");
addProp(m, GEOTEXT__UNDERLINEFONT, "geotext.underlinefont");
addProp(m, GEOTEXT__SHADOWFONT, "geotext.shadowfont");
addProp(m, GEOTEXT__SMALLCAPSFONT, "geotext.smallcapsfont");
addProp(m, GEOTEXT__STRIKETHROUGHFONT, "geotext.strikethroughfont");
addProp(m, BLIP__CROPFROMTOP, "blip.cropfromtop");
addProp(m, BLIP__CROPFROMBOTTOM, "blip.cropfrombottom");
addProp(m, BLIP__CROPFROMLEFT, "blip.cropfromleft");
addProp(m, BLIP__CROPFROMRIGHT, "blip.cropfromright");
addProp(m, BLIP__BLIPTODISPLAY, "blip.bliptodisplay");
addProp(m, BLIP__BLIPFILENAME, "blip.blipfilename");
addProp(m, BLIP__BLIPFLAGS, "blip.blipflags");
addProp(m, BLIP__TRANSPARENTCOLOR, "blip.transparentcolor");
addProp(m, BLIP__CONTRASTSETTING, "blip.contrastsetting");
addProp(m, BLIP__BRIGHTNESSSETTING, "blip.brightnesssetting");
addProp(m, BLIP__GAMMA, "blip.gamma");
addProp(m, BLIP__PICTUREID, "blip.pictureid");
addProp(m, BLIP__DOUBLEMOD, "blip.doublemod");
addProp(m, BLIP__PICTUREFILLMOD, "blip.picturefillmod");
addProp(m, BLIP__PICTURELINE, "blip.pictureline");
addProp(m, BLIP__PRINTBLIP, "blip.printblip");
addProp(m, BLIP__PRINTBLIPFILENAME, "blip.printblipfilename");
addProp(m, BLIP__PRINTFLAGS, "blip.printflags");
addProp(m, BLIP__NOHITTESTPICTURE, "blip.nohittestpicture");
addProp(m, BLIP__PICTUREGRAY, "blip.picturegray");
addProp(m, BLIP__PICTUREBILEVEL, "blip.picturebilevel");
addProp(m, BLIP__PICTUREACTIVE, "blip.pictureactive");
addProp(m, GEOMETRY__LEFT, "geometry.left");
addProp(m, GEOMETRY__TOP, "geometry.top");
addProp(m, GEOMETRY__RIGHT, "geometry.right");
addProp(m, GEOMETRY__BOTTOM, "geometry.bottom");
addProp(m, GEOMETRY__SHAPEPATH, "geometry.shapepath", EscherPropertyMetaData.TYPE_SHAPEPATH);
addProp(m, GEOMETRY__VERTICES, "geometry.vertices", EscherPropertyMetaData.TYPE_ARRAY);
addProp(m, GEOMETRY__SEGMENTINFO, "geometry.segmentinfo", EscherPropertyMetaData.TYPE_ARRAY);
addProp(m, GEOMETRY__ADJUSTVALUE, "geometry.adjustvalue");
addProp(m, GEOMETRY__ADJUST2VALUE, "geometry.adjust2value");
addProp(m, GEOMETRY__ADJUST3VALUE, "geometry.adjust3value");
addProp(m, GEOMETRY__ADJUST4VALUE, "geometry.adjust4value");
addProp(m, GEOMETRY__ADJUST5VALUE, "geometry.adjust5value");
addProp(m, GEOMETRY__ADJUST6VALUE, "geometry.adjust6value");
addProp(m, GEOMETRY__ADJUST7VALUE, "geometry.adjust7value");
addProp(m, GEOMETRY__ADJUST8VALUE, "geometry.adjust8value");
addProp(m, GEOMETRY__ADJUST9VALUE, "geometry.adjust9value");
addProp(m, GEOMETRY__ADJUST10VALUE, "geometry.adjust10value");
addProp(m, GEOMETRY__PCONNECTIONSITES, "geometry.pConnectionSites");
addProp(m, GEOMETRY__PCONNECTIONSITESDIR, "geometry.pConnectionSitesDir");
addProp(m, GEOMETRY__XLIMO, "geometry.xLimo");
addProp(m, GEOMETRY__YLIMO, "geometry.yLimo");
addProp(m, GEOMETRY__PADJUSTHANDLES, "geometry.pAdjustHandles");
addProp(m, GEOMETRY__PGUIDES, "geometry.pGuides");
addProp(m, GEOMETRY__PINSCRIBE, "geometry.pInscribe");
addProp(m, GEOMETRY__CXK, "geometry.cxk");
addProp(m, GEOMETRY__PFRAGMENTS, "geometry.pFragments");
addProp(m, GEOMETRY__SHADOWok, "geometry.shadowOK");
addProp(m, GEOMETRY__3DOK, "geometry.3dok");
addProp(m, GEOMETRY__LINEOK, "geometry.lineok");
addProp(m, GEOMETRY__GEOTEXTOK, "geometry.geotextok");
addProp(m, GEOMETRY__FILLSHADESHAPEOK, "geometry.fillshadeshapeok");
addProp(m, GEOMETRY__FILLOK, "geometry.fillok", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, FILL__FILLTYPE, "fill.filltype");
addProp(m, FILL__FILLCOLOR, "fill.fillcolor", EscherPropertyMetaData.TYPE_RGB);
addProp(m, FILL__FILLOPACITY, "fill.fillopacity");
addProp(m, FILL__FILLBACKCOLOR, "fill.fillbackcolor", EscherPropertyMetaData.TYPE_RGB);
addProp(m, FILL__BACKOPACITY, "fill.backopacity");
addProp(m, FILL__CRMOD, "fill.crmod");
addProp(m, FILL__PATTERNTEXTURE, "fill.patterntexture");
addProp(m, FILL__BLIPFILENAME, "fill.blipfilename");
addProp(m, FILL__BLIPFLAGS, "fill.blipflags");
addProp(m, FILL__WIDTH, "fill.width");
addProp(m, FILL__HEIGHT, "fill.height");
addProp(m, FILL__ANGLE, "fill.angle");
addProp(m, FILL__FOCUS, "fill.focus");
addProp(m, FILL__TOLEFT, "fill.toleft");
addProp(m, FILL__TOTOP, "fill.totop");
addProp(m, FILL__TORIGHT, "fill.toright");
addProp(m, FILL__TOBOTTOM, "fill.tobottom");
addProp(m, FILL__RECTLEFT, "fill.rectleft");
addProp(m, FILL__RECTTOP, "fill.recttop");
addProp(m, FILL__RECTRIGHT, "fill.rectright");
addProp(m, FILL__RECTBOTTOM, "fill.rectbottom");
addProp(m, FILL__DZTYPE, "fill.dztype");
addProp(m, FILL__SHADEPRESET, "fill.shadepreset");
addProp(m, FILL__SHADECOLORS, "fill.shadecolors", EscherPropertyMetaData.TYPE_ARRAY);
addProp(m, FILL__ORIGINX, "fill.originx");
addProp(m, FILL__ORIGINY, "fill.originy");
addProp(m, FILL__SHAPEORIGINX, "fill.shapeoriginx");
addProp(m, FILL__SHAPEORIGINY, "fill.shapeoriginy");
addProp(m, FILL__SHADETYPE, "fill.shadetype");
addProp(m, FILL__FILLED, "fill.filled");
addProp(m, FILL__HITTESTFILL, "fill.hittestfill");
addProp(m, FILL__SHAPE, "fill.shape");
addProp(m, FILL__USERECT, "fill.userect");
addProp(m, FILL__NOFILLHITTEST, "fill.nofillhittest", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, LINESTYLE__COLOR, "linestyle.color", EscherPropertyMetaData.TYPE_RGB);
addProp(m, LINESTYLE__OPACITY, "linestyle.opacity");
addProp(m, LINESTYLE__BACKCOLOR, "linestyle.backcolor", EscherPropertyMetaData.TYPE_RGB);
addProp(m, LINESTYLE__CRMOD, "linestyle.crmod");
addProp(m, LINESTYLE__LINETYPE, "linestyle.linetype");
addProp(m, LINESTYLE__FILLBLIP, "linestyle.fillblip");
addProp(m, LINESTYLE__FILLBLIPNAME, "linestyle.fillblipname");
addProp(m, LINESTYLE__FILLBLIPFLAGS, "linestyle.fillblipflags");
addProp(m, LINESTYLE__FILLWIDTH, "linestyle.fillwidth");
addProp(m, LINESTYLE__FILLHEIGHT, "linestyle.fillheight");
addProp(m, LINESTYLE__FILLDZTYPE, "linestyle.filldztype");
addProp(m, LINESTYLE__LINEWIDTH, "linestyle.linewidth");
addProp(m, LINESTYLE__LINEMITERLIMIT, "linestyle.linemiterlimit");
addProp(m, LINESTYLE__LINESTYLE, "linestyle.linestyle");
addProp(m, LINESTYLE__LINEDASHING, "linestyle.linedashing");
addProp(m, LINESTYLE__LINEDASHSTYLE, "linestyle.linedashstyle", EscherPropertyMetaData.TYPE_ARRAY);
addProp(m, LINESTYLE__LINESTARTARROWHEAD, "linestyle.linestartarrowhead");
addProp(m, LINESTYLE__LINEENDARROWHEAD, "linestyle.lineendarrowhead");
addProp(m, LINESTYLE__LINESTARTARROWWIDTH, "linestyle.linestartarrowwidth");
addProp(m, LINESTYLE__LINESTARTARROWLENGTH, "linestyle.linestartarrowlength");
addProp(m, LINESTYLE__LINEENDARROWWIDTH, "linestyle.lineendarrowwidth");
addProp(m, LINESTYLE__LINEENDARROWLENGTH, "linestyle.lineendarrowlength");
addProp(m, LINESTYLE__LINEJOINSTYLE, "linestyle.linejoinstyle");
addProp(m, LINESTYLE__LINEENDCAPSTYLE, "linestyle.lineendcapstyle");
addProp(m, LINESTYLE__ARROWHEADSOK, "linestyle.arrowheadsok");
addProp(m, LINESTYLE__ANYLINE, "linestyle.anyline");
addProp(m, LINESTYLE__HITLINETEST, "linestyle.hitlinetest");
addProp(m, LINESTYLE__LINEFILLSHAPE, "linestyle.linefillshape");
addProp(m, LINESTYLE__NOLINEDRAWDASH, "linestyle.nolinedrawdash", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, LINESTYLE__NOLINEDRAWDASH_LEFT, "linestyle.nolinedrawdash.left", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, LINESTYLE__NOLINEDRAWDASH_TOP, "linestyle.nolinedrawdash.top", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, LINESTYLE__NOLINEDRAWDASH_BOTTOM, "linestyle.nolinedrawdash.bottom", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, LINESTYLE__NOLINEDRAWDASH_RIGHT, "linestyle.nolinedrawdash.right", EscherPropertyMetaData.TYPE_BOOLEAN);
addProp(m, SHADOWSTYLE__TYPE, "shadowstyle.type");
addProp(m, SHADOWSTYLE__COLOR, "shadowstyle.color", EscherPropertyMetaData.TYPE_RGB);
addProp(m, SHADOWSTYLE__HIGHLIGHT, "shadowstyle.highlight");
addProp(m, SHADOWSTYLE__CRMOD, "shadowstyle.crmod");
addProp(m, SHADOWSTYLE__OPACITY, "shadowstyle.opacity");
addProp(m, SHADOWSTYLE__OFFSETX, "shadowstyle.offsetx");
addProp(m, SHADOWSTYLE__OFFSETY, "shadowstyle.offsety");
addProp(m, SHADOWSTYLE__SECONDOFFSETX, "shadowstyle.secondoffsetx");
addProp(m, SHADOWSTYLE__SECONDOFFSETY, "shadowstyle.secondoffsety");
addProp(m, SHADOWSTYLE__SCALEXTOX, "shadowstyle.scalextox");
addProp(m, SHADOWSTYLE__SCALEYTOX, "shadowstyle.scaleytox");
addProp(m, SHADOWSTYLE__SCALEXTOY, "shadowstyle.scalextoy");
addProp(m, SHADOWSTYLE__SCALEYTOY, "shadowstyle.scaleytoy");
addProp(m, SHADOWSTYLE__PERSPECTIVEX, "shadowstyle.perspectivex");
addProp(m, SHADOWSTYLE__PERSPECTIVEY, "shadowstyle.perspectivey");
addProp(m, SHADOWSTYLE__WEIGHT, "shadowstyle.weight");
addProp(m, SHADOWSTYLE__ORIGINX, "shadowstyle.originx");
addProp(m, SHADOWSTYLE__ORIGINY, "shadowstyle.originy");
addProp(m, SHADOWSTYLE__SHADOW, "shadowstyle.shadow");
addProp(m, SHADOWSTYLE__SHADOWOBSURED, "shadowstyle.shadowobscured");
addProp(m, PERSPECTIVE__TYPE, "perspective.type");
addProp(m, PERSPECTIVE__OFFSETX, "perspective.offsetx");
addProp(m, PERSPECTIVE__OFFSETY, "perspective.offsety");
addProp(m, PERSPECTIVE__SCALEXTOX, "perspective.scalextox");
addProp(m, PERSPECTIVE__SCALEYTOX, "perspective.scaleytox");
addProp(m, PERSPECTIVE__SCALEXTOY, "perspective.scalextoy");
addProp(m, PERSPECTIVE__SCALEYTOY, "perspective.scaleytoy");
addProp(m, PERSPECTIVE__PERSPECTIVEX, "perspective.perspectivex");
addProp(m, PERSPECTIVE__PERSPECTIVEY, "perspective.perspectivey");
addProp(m, PERSPECTIVE__WEIGHT, "perspective.weight");
addProp(m, PERSPECTIVE__ORIGINX, "perspective.originx");
addProp(m, PERSPECTIVE__ORIGINY, "perspective.originy");
addProp(m, PERSPECTIVE__PERSPECTIVEON, "perspective.perspectiveon");
addProp(m, THREED__SPECULARAMOUNT, "3d.specularamount");
addProp(m, THREED__DIFFUSEAMOUNT, "3d.diffuseamount");
addProp(m, THREED__SHININESS, "3d.shininess");
addProp(m, THREED__EDGETHICKNESS, "3d.edgethickness");
addProp(m, THREED__EXTRUDEFORWARD, "3d.extrudeforward");
addProp(m, THREED__EXTRUDEBACKWARD, "3d.extrudebackward");
addProp(m, THREED__EXTRUDEPLANE, "3d.extrudeplane");
addProp(m, THREED__EXTRUSIONCOLOR, "3d.extrusioncolor", EscherPropertyMetaData.TYPE_RGB);
addProp(m, THREED__CRMOD, "3d.crmod");
addProp(m, THREED__3DEFFECT, "3d.3deffect");
addProp(m, THREED__METALLIC, "3d.metallic");
addProp(m, THREED__USEEXTRUSIONCOLOR, "3d.useextrusioncolor", EscherPropertyMetaData.TYPE_RGB);
addProp(m, THREED__LIGHTFACE, "3d.lightface");
addProp(m, THREEDSTYLE__YROTATIONANGLE, "3dstyle.yrotationangle");
addProp(m, THREEDSTYLE__XROTATIONANGLE, "3dstyle.xrotationangle");
addProp(m, THREEDSTYLE__ROTATIONAXISX, "3dstyle.rotationaxisx");
addProp(m, THREEDSTYLE__ROTATIONAXISY, "3dstyle.rotationaxisy");
addProp(m, THREEDSTYLE__ROTATIONAXISZ, "3dstyle.rotationaxisz");
addProp(m, THREEDSTYLE__ROTATIONANGLE, "3dstyle.rotationangle");
addProp(m, THREEDSTYLE__ROTATIONCENTERX, "3dstyle.rotationcenterx");
addProp(m, THREEDSTYLE__ROTATIONCENTERY, "3dstyle.rotationcentery");
addProp(m, THREEDSTYLE__ROTATIONCENTERZ, "3dstyle.rotationcenterz");
addProp(m, THREEDSTYLE__RENDERMODE, "3dstyle.rendermode");
addProp(m, THREEDSTYLE__TOLERANCE, "3dstyle.tolerance");
addProp(m, THREEDSTYLE__XVIEWPOINT, "3dstyle.xviewpoint");
addProp(m, THREEDSTYLE__YVIEWPOINT, "3dstyle.yviewpoint");
addProp(m, THREEDSTYLE__ZVIEWPOINT, "3dstyle.zviewpoint");
addProp(m, THREEDSTYLE__ORIGINX, "3dstyle.originx");
addProp(m, THREEDSTYLE__ORIGINY, "3dstyle.originy");
addProp(m, THREEDSTYLE__SKEWANGLE, "3dstyle.skewangle");
addProp(m, THREEDSTYLE__SKEWAMOUNT, "3dstyle.skewamount");
addProp(m, THREEDSTYLE__AMBIENTINTENSITY, "3dstyle.ambientintensity");
addProp(m, THREEDSTYLE__KEYX, "3dstyle.keyx");
addProp(m, THREEDSTYLE__KEYY, "3dstyle.keyy");
addProp(m, THREEDSTYLE__KEYZ, "3dstyle.keyz");
addProp(m, THREEDSTYLE__KEYINTENSITY, "3dstyle.keyintensity");
addProp(m, THREEDSTYLE__FILLX, "3dstyle.fillx");
addProp(m, THREEDSTYLE__FILLY, "3dstyle.filly");
addProp(m, THREEDSTYLE__FILLZ, "3dstyle.fillz");
addProp(m, THREEDSTYLE__FILLINTENSITY, "3dstyle.fillintensity");
addProp(m, THREEDSTYLE__CONSTRAINROTATION, "3dstyle.constrainrotation");
addProp(m, THREEDSTYLE__ROTATIONCENTERAUTO, "3dstyle.rotationcenterauto");
addProp(m, THREEDSTYLE__PARALLEL, "3dstyle.parallel");
addProp(m, THREEDSTYLE__KEYHARSH, "3dstyle.keyharsh");
addProp(m, THREEDSTYLE__FILLHARSH, "3dstyle.fillharsh");
addProp(m, SHAPE__MASTER, "shape.master");
addProp(m, SHAPE__CONNECTORSTYLE, "shape.connectorstyle");
addProp(m, SHAPE__BLACKANDWHITESETTINGS, "shape.blackandwhitesettings");
addProp(m, SHAPE__WMODEPUREBW, "shape.wmodepurebw");
addProp(m, SHAPE__WMODEBW, "shape.wmodebw");
addProp(m, SHAPE__OLEICON, "shape.oleicon");
addProp(m, SHAPE__PREFERRELATIVERESIZE, "shape.preferrelativeresize");
addProp(m, SHAPE__LOCKSHAPETYPE, "shape.lockshapetype");
addProp(m, SHAPE__DELETEATTACHEDOBJECT, "shape.deleteattachedobject");
addProp(m, SHAPE__BACKGROUNDSHAPE, "shape.backgroundshape");
addProp(m, CALLOUT__CALLOUTTYPE, "callout.callouttype");
addProp(m, CALLOUT__XYCALLOUTGAP, "callout.xycalloutgap");
addProp(m, CALLOUT__CALLOUTANGLE, "callout.calloutangle");
addProp(m, CALLOUT__CALLOUTDROPTYPE, "callout.calloutdroptype");
addProp(m, CALLOUT__CALLOUTDROPSPECIFIED, "callout.calloutdropspecified");
addProp(m, CALLOUT__CALLOUTLENGTHSPECIFIED, "callout.calloutlengthspecified");
addProp(m, CALLOUT__ISCALLOUT, "callout.iscallout");
addProp(m, CALLOUT__CALLOUTACCENTBAR, "callout.calloutaccentbar");
addProp(m, CALLOUT__CALLOUTTEXTBORDER, "callout.callouttextborder");
addProp(m, CALLOUT__CALLOUTMINUSX, "callout.calloutminusx");
addProp(m, CALLOUT__CALLOUTMINUSY, "callout.calloutminusy");
addProp(m, CALLOUT__DROPAUTO, "callout.dropauto");
addProp(m, CALLOUT__LENGTHSPECIFIED, "callout.lengthspecified");
addProp(m, GROUPSHAPE__SHAPENAME, "groupshape.shapename");
addProp(m, GROUPSHAPE__DESCRIPTION, "groupshape.description");
addProp(m, GROUPSHAPE__HYPERLINK, "groupshape.hyperlink");
addProp(m, GROUPSHAPE__WRAPPOLYGONVERTICES, "groupshape.wrappolygonvertices", EscherPropertyMetaData.TYPE_ARRAY);
addProp(m, GROUPSHAPE__WRAPDISTLEFT, "groupshape.wrapdistleft");
addProp(m, GROUPSHAPE__WRAPDISTTOP, "groupshape.wrapdisttop");
addProp(m, GROUPSHAPE__WRAPDISTRIGHT, "groupshape.wrapdistright");
addProp(m, GROUPSHAPE__WRAPDISTBOTTOM, "groupshape.wrapdistbottom");
addProp(m, GROUPSHAPE__REGROUPID, "groupshape.regroupid");
addProp( m, GROUPSHAPE__UNUSED906, "unused906" ); // 0x038A;
addProp( m, GROUPSHAPE__TOOLTIP, "groupshape.wzTooltip" ); // 0x038D;
addProp( m, GROUPSHAPE__SCRIPT, "groupshape.wzScript" ); // 0x038E;
addProp( m, GROUPSHAPE__POSH, "groupshape.posh" ); // 0x038F;
addProp( m, GROUPSHAPE__POSRELH, "groupshape.posrelh" ); // 0x0390;
addProp( m, GROUPSHAPE__POSV, "groupshape.posv" ); // 0x0391;
addProp( m, GROUPSHAPE__POSRELV, "groupshape.posrelv" ); // 0x0392;
addProp( m, GROUPSHAPE__HR_PCT, "groupshape.pctHR" ); // 0x0393;
addProp( m, GROUPSHAPE__HR_ALIGN, "groupshape.alignHR" ); // 0x0394;
addProp( m, GROUPSHAPE__HR_HEIGHT, "groupshape.dxHeightHR" ); // 0x0395;
addProp( m, GROUPSHAPE__HR_WIDTH, "groupshape.dxWidthHR" ); // 0x0396;
addProp( m, GROUPSHAPE__SCRIPTEXT, "groupshape.wzScriptExtAttr" ); // 0x0397;
addProp( m, GROUPSHAPE__SCRIPTLANG, "groupshape.scriptLang" ); // 0x0398;
addProp( m, GROUPSHAPE__BORDERTOPCOLOR, "groupshape.borderTopColor" ); // 0x039B;
addProp( m, GROUPSHAPE__BORDERLEFTCOLOR, "groupshape.borderLeftColor" ); // 0x039C;
addProp( m, GROUPSHAPE__BORDERBOTTOMCOLOR, "groupshape.borderBottomColor" ); // 0x039D;
addProp( m, GROUPSHAPE__BORDERRIGHTCOLOR, "groupshape.borderRightColor" ); // 0x039E;
addProp( m, GROUPSHAPE__TABLEPROPERTIES, "groupshape.tableProperties" ); // 0x039F;
addProp( m, GROUPSHAPE__TABLEROWPROPERTIES, "groupshape.tableRowProperties", EscherPropertyMetaData.TYPE_ARRAY ); // 0x03A0;
addProp( m, GROUPSHAPE__WEBBOT, "groupshape.wzWebBot" ); // 0x03A5;
addProp( m, GROUPSHAPE__METROBLOB, "groupshape.metroBlob" ); // 0x03A9;
addProp( m, GROUPSHAPE__ZORDER, "groupshape.dhgt" ); // 0x03AA;
addProp( m, GROUPSHAPE__FLAGS, "groupshape.GroupShapeBooleanProperties" ); // 0x03BF;
addProp(m, GROUPSHAPE__EDITEDWRAP, "groupshape.editedwrap");
addProp(m, GROUPSHAPE__BEHINDDOCUMENT, "groupshape.behinddocument");
addProp(m, GROUPSHAPE__ONDBLCLICKNOTIFY, "groupshape.ondblclicknotify");
addProp(m, GROUPSHAPE__ISBUTTON, "groupshape.isbutton");
addProp(m, GROUPSHAPE__1DADJUSTMENT, "groupshape.1dadjustment");
addProp(m, GROUPSHAPE__HIDDEN, "groupshape.hidden");
addProp(m, GROUPSHAPE__PRINT, "groupshape.print", EscherPropertyMetaData.TYPE_BOOLEAN);
return m;
}
private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName) {
m.put((short) s, new EscherPropertyMetaData(propName));
}
private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName, byte type) {
m.put((short) s, new EscherPropertyMetaData(propName, type));
}
public static String getPropertyName(short propertyId) {
EscherPropertyMetaData o = properties.get(propertyId);
return o == null ? "unknown" : o.getDescription();
}
public static byte getPropertyType(short propertyId) {
EscherPropertyMetaData escherPropertyMetaData = properties.get(propertyId);
return escherPropertyMetaData == null ? 0 : escherPropertyMetaData.getType();
static byte getPropertyType(short propertyId) {
return (byte)EscherPropertyTypes.forPropertyID(propertyId).holder.ordinal();
}
}

View File

@ -17,13 +17,28 @@
package org.apache.poi.ddf;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.common.usermodel.GenericRecord;
import org.apache.poi.util.GenericRecordJsonWriter;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.GenericRecordXmlWriter;
/**
* This is the abstract base class for all escher properties.
*
* @see EscherOptRecord
*/
public abstract class EscherProperty {
private short _id;
public abstract class EscherProperty implements GenericRecord {
private final short id;
static final int IS_BLIP = 0x4000;
static final int IS_COMPLEX = 0x8000;
private static final int[] FLAG_MASK = { IS_BLIP, IS_COMPLEX };
private static final String[] FLAG_NAMES = { "IS_BLIP", "IS_COMPLEX" };
/**
* The id is distinct from the actual property number. The id includes the property number the blip id
@ -31,8 +46,8 @@ public abstract class EscherProperty {
*
* @param id the combined id
*/
public EscherProperty(short id) {
_id = id;
protected EscherProperty(short id) {
this.id = id;
}
/**
@ -43,30 +58,44 @@ public abstract class EscherProperty {
* @param isComplex true, if this is a complex property
* @param isBlipId true, if this property is a blip id
*/
public EscherProperty(short propertyNumber, boolean isComplex, boolean isBlipId) {
_id = (short)(propertyNumber +
(isComplex ? 0x8000 : 0x0) +
(isBlipId ? 0x4000 : 0x0));
protected EscherProperty(short propertyNumber, boolean isComplex, boolean isBlipId) {
this((short)(propertyNumber |
(isComplex ? IS_COMPLEX : 0x0) |
(isBlipId ? IS_BLIP : 0x0)));
}
/**
* Constructs a new escher property. The three parameters are combined to form a property
* id.
*
* @param propertyNumber the property number
* @param isComplex true, if this is a complex property
* @param isBlipId true, if this property is a blip id
*/
protected EscherProperty(EscherPropertyTypes type, boolean isComplex, boolean isBlipId) {
this((short)(type.propNumber |
(isComplex ? IS_COMPLEX : 0) |
(isBlipId ? IS_BLIP : 0)));
}
public short getId() {
return _id;
return id;
}
public short getPropertyNumber() {
return (short) (_id & (short) 0x3FFF);
return (short) (id & 0x3FFF);
}
public boolean isComplex() {
return (_id & (short) 0x8000) != 0;
return (id & IS_COMPLEX) != 0;
}
public boolean isBlipId() {
return (_id & (short) 0x4000) != 0;
return (id & IS_BLIP) != 0;
}
public String getName() {
return EscherProperties.getPropertyName(getPropertyNumber());
return EscherPropertyTypes.forPropertyID(getPropertyNumber()).propName;
}
/**
@ -79,13 +108,6 @@ public abstract class EscherProperty {
return 6;
}
public String toXml(String tab){
StringBuilder builder = new StringBuilder();
builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"").append(getId()).append("\" name=\"").append(getName()).append("\" blipId=\"")
.append(isBlipId()).append("\"/>\n");
return builder.toString();
}
/**
* Escher properties consist of a simple fixed length part and a complex variable length part.
* The fixed length part is serialized first.
@ -110,5 +132,32 @@ public abstract class EscherProperty {
@Override
abstract public String toString();
public final String toString() {
return GenericRecordJsonWriter.marshal(this);
}
public final String toXml(String tab){
return GenericRecordXmlWriter.marshal(this);
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"id", this::getId,
"name", this::getName,
"propertyNumber", this::getPropertyNumber,
"propertySize", this::getPropertySize,
"flags", GenericRecordUtil.getBitsAsString(this::getId, FLAG_MASK, FLAG_NAMES)
);
}
@Override
public List<? extends GenericRecord> getGenericChildren() {
return null;
}
@Override
public EscherPropertyTypes getGenericRecordType() {
return EscherPropertyTypes.forPropertyID(id);
}
}

View File

@ -19,8 +19,8 @@ package org.apache.poi.ddf;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndian;
/**
@ -28,9 +28,6 @@ import org.apache.poi.util.LittleEndian;
*/
public final class EscherPropertyFactory {
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000_000;
/**
* Create new properties from a byte array.
*
@ -45,57 +42,52 @@ public final class EscherPropertyFactory {
int pos = offset;
for (int i = 0; i < numProperties; i++) {
short propId;
int propData;
propId = LittleEndian.getShort( data, pos );
propData = LittleEndian.getInt( data, pos + 2 );
short propNumber = (short) ( propId & (short) 0x3FFF );
boolean isComplex = ( propId & (short) 0x8000 ) != 0;
// boolean isBlipId = ( propId & (short) 0x4000 ) != 0;
final short propId = LittleEndian.getShort( data, pos );
final int propData = LittleEndian.getInt( data, pos + 2 );
final boolean isComplex = ( propId & EscherProperty.IS_COMPLEX ) != 0;
byte propertyType = EscherProperties.getPropertyType(propNumber);
EscherProperty ep;
switch (propertyType) {
case EscherPropertyMetaData.TYPE_BOOLEAN:
ep = new EscherBoolProperty( propId, propData );
EscherPropertyTypes propertyType = EscherPropertyTypes.forPropertyID(propId);
final BiFunction<Short,Integer,EscherProperty> con;
switch (propertyType.holder) {
case BOOLEAN:
con = EscherBoolProperty::new;
break;
case EscherPropertyMetaData.TYPE_RGB:
ep = new EscherRGBProperty( propId, propData );
case RGB:
con = EscherRGBProperty::new;
break;
case EscherPropertyMetaData.TYPE_SHAPEPATH:
ep = new EscherShapePathProperty( propId, propData );
case SHAPE_PATH:
con = EscherShapePathProperty::new;
break;
default:
if ( !isComplex ) {
ep = new EscherSimpleProperty( propId, propData );
} else if ( propertyType == EscherPropertyMetaData.TYPE_ARRAY) {
ep = new EscherArrayProperty( propId, IOUtils.safelyAllocate(propData, MAX_RECORD_LENGTH));
if ( isComplex ) {
con = (propertyType.holder == EscherPropertyTypesHolder.ARRAY)
? EscherArrayProperty::new
: EscherComplexProperty::new;
} else {
ep = new EscherComplexProperty( propId, IOUtils.safelyAllocate(propData, MAX_RECORD_LENGTH));
con = EscherSimpleProperty::new;
}
break;
}
results.add( ep );
results.add( con.apply(propId,propData) );
pos += 6;
}
// Get complex data
for (EscherProperty p : results) {
if (p instanceof EscherComplexProperty) {
if (p instanceof EscherArrayProperty) {
pos += ((EscherArrayProperty)p).setArrayData(data, pos);
} else {
byte[] complexData = ((EscherComplexProperty)p).getComplexData();
int leftover = data.length - pos;
if (leftover < complexData.length) {
throw new IllegalStateException("Could not read complex escher property, length was " + complexData.length + ", but had only " +
leftover + " bytes left");
}
System.arraycopy(data, pos, complexData, 0, complexData.length);
pos += complexData.length;
if (p instanceof EscherArrayProperty) {
EscherArrayProperty eap = (EscherArrayProperty)p;
pos += eap.setArrayData(data, pos);
} else if (p instanceof EscherComplexProperty) {
EscherComplexProperty ecp = (EscherComplexProperty)p;
int cdLen = ecp.getComplexData().length;
int leftover = data.length - pos;
if (leftover < cdLen) {
throw new IllegalStateException("Could not read complex escher property, length was " +
cdLen + ", but had only " + leftover + " bytes left");
}
pos += ecp.setComplexData(data, pos);
}
}
return results;

View File

@ -0,0 +1,376 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License")), you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ddf;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Provides a list of all known escher properties including the description and type.
*/
public enum EscherPropertyTypes {
TRANSFORM__ROTATION(0x0004, "transform.rotation"),
PROTECTION__LOCKROTATION(0x0077, "protection.lockrotation"),
PROTECTION__LOCKASPECTRATIO(0x0078, "protection.lockaspectratio"),
PROTECTION__LOCKPOSITION(0x0079, "protection.lockposition"),
PROTECTION__LOCKAGAINSTSELECT(0x007a, "protection.lockagainstselect"),
PROTECTION__LOCKCROPPING(0x007b, "protection.lockcropping"),
PROTECTION__LOCKVERTICES(0x007c, "protection.lockvertices"),
PROTECTION__LOCKTEXT(0x007d, "protection.locktext"),
PROTECTION__LOCKADJUSTHANDLES(0x007e, "protection.lockadjusthandles"),
PROTECTION__LOCKAGAINSTGROUPING(0x007f, "protection.lockagainstgrouping", EscherPropertyTypesHolder.BOOLEAN),
TEXT__TEXTID(0x0080, "text.textid"),
TEXT__TEXTLEFT(0x0081, "text.textleft"),
TEXT__TEXTTOP(0x0082, "text.texttop"),
TEXT__TEXTRIGHT(0x0083, "text.textright"),
TEXT__TEXTBOTTOM(0x0084, "text.textbottom"),
TEXT__WRAPTEXT(0x0085, "text.wraptext"),
TEXT__SCALETEXT(0x0086, "text.scaletext"),
TEXT__ANCHORTEXT(0x0087, "text.anchortext"),
TEXT__TEXTFLOW(0x0088, "text.textflow"),
TEXT__FONTROTATION(0x0089, "text.fontrotation"),
TEXT__IDOFNEXTSHAPE(0x008a, "text.idofnextshape"),
TEXT__BIDIR(0x008b, "text.bidir"),
TEXT__SINGLECLICKSELECTS(0x00bb, "text.singleclickselects"),
TEXT__USEHOSTMARGINS(0x00bc, "text.usehostmargins"),
TEXT__ROTATETEXTWITHSHAPE(0x00bd, "text.rotatetextwithshape"),
TEXT__SIZESHAPETOFITTEXT(0x00be, "text.sizeshapetofittext"),
TEXT__SIZE_TEXT_TO_FIT_SHAPE(0x00bf, "text.sizetexttofitshape", EscherPropertyTypesHolder.BOOLEAN),
GEOTEXT__UNICODE(0x00c0, "geotext.unicode"),
GEOTEXT__RTFTEXT(0x00c1, "geotext.rtftext"),
GEOTEXT__ALIGNMENTONCURVE(0x00c2, "geotext.alignmentoncurve"),
GEOTEXT__DEFAULTPOINTSIZE(0x00c3, "geotext.defaultpointsize"),
GEOTEXT__TEXTSPACING(0x00c4, "geotext.textspacing"),
GEOTEXT__FONTFAMILYNAME(0x00c5, "geotext.fontfamilyname"),
GEOTEXT__REVERSEROWORDER(0x00f0, "geotext.reverseroworder"),
GEOTEXT__HASTEXTEFFECT(0x00f1, "geotext.hastexteffect"),
GEOTEXT__ROTATECHARACTERS(0x00f2, "geotext.rotatecharacters"),
GEOTEXT__KERNCHARACTERS(0x00f3, "geotext.kerncharacters"),
GEOTEXT__TIGHTORTRACK(0x00f4, "geotext.tightortrack"),
GEOTEXT__STRETCHTOFITSHAPE(0x00f5, "geotext.stretchtofitshape"),
GEOTEXT__CHARBOUNDINGBOX(0x00f6, "geotext.charboundingbox"),
GEOTEXT__SCALETEXTONPATH(0x00f7, "geotext.scaletextonpath"),
GEOTEXT__STRETCHCHARHEIGHT(0x00f8, "geotext.stretchcharheight"),
GEOTEXT__NOMEASUREALONGPATH(0x00f9, "geotext.nomeasurealongpath"),
GEOTEXT__BOLDFONT(0x00fa, "geotext.boldfont"),
GEOTEXT__ITALICFONT(0x00fb, "geotext.italicfont"),
GEOTEXT__UNDERLINEFONT(0x00fc, "geotext.underlinefont"),
GEOTEXT__SHADOWFONT(0x00fd, "geotext.shadowfont"),
GEOTEXT__SMALLCAPSFONT(0x00fe, "geotext.smallcapsfont"),
GEOTEXT__STRIKETHROUGHFONT(0x00ff, "geotext.strikethroughfont"),
BLIP__CROPFROMTOP(0x0100, "blip.cropfromtop"),
BLIP__CROPFROMBOTTOM(0x0101, "blip.cropfrombottom"),
BLIP__CROPFROMLEFT(0x0102, "blip.cropfromleft"),
BLIP__CROPFROMRIGHT(0x0103, "blip.cropfromright"),
BLIP__BLIPTODISPLAY(0x0104, "blip.bliptodisplay"),
BLIP__BLIPFILENAME(0x0105, "blip.blipfilename"),
BLIP__BLIPFLAGS(0x0106, "blip.blipflags"),
BLIP__TRANSPARENTCOLOR(0x0107, "blip.transparentcolor"),
BLIP__CONTRASTSETTING(0x0108, "blip.contrastsetting"),
BLIP__BRIGHTNESSSETTING(0x0109, "blip.brightnesssetting"),
BLIP__GAMMA(0x010a, "blip.gamma"),
BLIP__PICTUREID(0x010b, "blip.pictureid"),
BLIP__DOUBLEMOD(0x010c, "blip.doublemod"),
BLIP__PICTUREFILLMOD(0x010d, "blip.picturefillmod"),
BLIP__PICTURELINE(0x010e, "blip.pictureline"),
BLIP__PRINTBLIP(0x010f, "blip.printblip"),
BLIP__PRINTBLIPFILENAME(0x0110, "blip.printblipfilename"),
BLIP__PRINTFLAGS(0x0111, "blip.printflags"),
BLIP__NOHITTESTPICTURE(0x013c, "blip.nohittestpicture"),
BLIP__PICTUREGRAY(0x013d, "blip.picturegray"),
BLIP__PICTUREBILEVEL(0x013e, "blip.picturebilevel"),
BLIP__PICTUREACTIVE(0x013f, "blip.pictureactive"),
GEOMETRY__LEFT(0x0140, "geometry.left"),
GEOMETRY__TOP(0x0141, "geometry.top"),
GEOMETRY__RIGHT(0x0142, "geometry.right"),
GEOMETRY__BOTTOM(0x0143, "geometry.bottom"),
GEOMETRY__SHAPEPATH(0x0144, "geometry.shapepath", EscherPropertyTypesHolder.SHAPE_PATH),
GEOMETRY__VERTICES(0x0145, "geometry.vertices", EscherPropertyTypesHolder.ARRAY),
GEOMETRY__SEGMENTINFO(0x0146, "geometry.segmentinfo", EscherPropertyTypesHolder.ARRAY),
GEOMETRY__ADJUSTVALUE(0x0147, "geometry.adjustvalue"),
GEOMETRY__ADJUST2VALUE(0x0148, "geometry.adjust2value"),
GEOMETRY__ADJUST3VALUE(0x0149, "geometry.adjust3value"),
GEOMETRY__ADJUST4VALUE(0x014a, "geometry.adjust4value"),
GEOMETRY__ADJUST5VALUE(0x014b, "geometry.adjust5value"),
GEOMETRY__ADJUST6VALUE(0x014c, "geometry.adjust6value"),
GEOMETRY__ADJUST7VALUE(0x014d, "geometry.adjust7value"),
GEOMETRY__ADJUST8VALUE(0x014e, "geometry.adjust8value"),
GEOMETRY__ADJUST9VALUE(0x014f, "geometry.adjust9value"),
GEOMETRY__ADJUST10VALUE(0x0150, "geometry.adjust10value"),
GEOMETRY__PCONNECTIONSITES(0x0151, "geometry.pConnectionSites"),
GEOMETRY__PCONNECTIONSITESDIR(0x0152, "geometry.pConnectionSitesDir"),
GEOMETRY__XLIMO(0x0153, "geometry.xLimo"),
GEOMETRY__YLIMO(0x0154, "geometry.yLimo"),
GEOMETRY__PADJUSTHANDLES(0x0155, "geometry.pAdjustHandles"),
GEOMETRY__PGUIDES(0x0156, "geometry.pGuides"),
GEOMETRY__PINSCRIBE(0x0157, "geometry.pInscribe"),
GEOMETRY__CXK(0x0158, "geometry.cxk"),
GEOMETRY__PFRAGMENTS(0x0159, "geometry.pFragments"),
GEOMETRY__SHADOWOK(0x017a, "geometry.shadowOK"),
GEOMETRY__3DOK(0x017b, "geometry.3dok"),
GEOMETRY__LINEOK(0x017c, "geometry.lineok"),
GEOMETRY__GEOTEXTOK(0x017d, "geometry.geotextok"),
GEOMETRY__FILLSHADESHAPEOK(0x017e, "geometry.fillshadeshapeok"),
GEOMETRY__FILLOK(0x017f, "geometry.fillok", EscherPropertyTypesHolder.BOOLEAN),
FILL__FILLTYPE(0x0180, "fill.filltype"),
FILL__FILLCOLOR(0x0181, "fill.fillcolor", EscherPropertyTypesHolder.RGB),
FILL__FILLOPACITY(0x0182, "fill.fillopacity"),
FILL__FILLBACKCOLOR(0x0183, "fill.fillbackcolor", EscherPropertyTypesHolder.RGB),
FILL__BACKOPACITY(0x0184, "fill.backopacity"),
FILL__CRMOD(0x0185, "fill.crmod"),
FILL__PATTERNTEXTURE(0x0186, "fill.patterntexture"),
FILL__BLIPFILENAME(0x0187, "fill.blipfilename"),
FILL__BLIPFLAGS(0x0188, "fill.blipflags"),
FILL__WIDTH(0x0189, "fill.width"),
FILL__HEIGHT(0x018a, "fill.height"),
FILL__ANGLE(0x018b, "fill.angle"),
FILL__FOCUS(0x018c, "fill.focus"),
FILL__TOLEFT(0x018d, "fill.toleft"),
FILL__TOTOP(0x018e, "fill.totop"),
FILL__TORIGHT(0x018f, "fill.toright"),
FILL__TOBOTTOM(0x0190, "fill.tobottom"),
FILL__RECTLEFT(0x0191, "fill.rectleft"),
FILL__RECTTOP(0x0192, "fill.recttop"),
FILL__RECTRIGHT(0x0193, "fill.rectright"),
FILL__RECTBOTTOM(0x0194, "fill.rectbottom"),
FILL__DZTYPE(0x0195, "fill.dztype"),
FILL__SHADEPRESET(0x0196, "fill.shadepreset"),
FILL__SHADECOLORS(0x0197, "fill.shadecolors", EscherPropertyTypesHolder.ARRAY),
FILL__ORIGINX(0x0198, "fill.originx"),
FILL__ORIGINY(0x0199, "fill.originy"),
FILL__SHAPEORIGINX(0x019a, "fill.shapeoriginx"),
FILL__SHAPEORIGINY(0x019b, "fill.shapeoriginy"),
FILL__SHADETYPE(0x019c, "fill.shadetype"),
FILL__FILLED(0x01bb, "fill.filled"),
FILL__HITTESTFILL(0x01bc, "fill.hittestfill"),
FILL__SHAPE(0x01bd, "fill.shape"),
FILL__USERECT(0x01be, "fill.userect"),
FILL__NOFILLHITTEST(0x01bf, "fill.nofillhittest", EscherPropertyTypesHolder.BOOLEAN),
LINESTYLE__COLOR(0x01c0, "linestyle.color", EscherPropertyTypesHolder.RGB),
LINESTYLE__OPACITY(0x01c1, "linestyle.opacity"),
LINESTYLE__BACKCOLOR(0x01c2, "linestyle.backcolor", EscherPropertyTypesHolder.RGB),
LINESTYLE__CRMOD(0x01c3, "linestyle.crmod"),
LINESTYLE__LINETYPE(0x01c4, "linestyle.linetype"),
LINESTYLE__FILLBLIP(0x01c5, "linestyle.fillblip"),
LINESTYLE__FILLBLIPNAME(0x01c6, "linestyle.fillblipname"),
LINESTYLE__FILLBLIPFLAGS(0x01c7, "linestyle.fillblipflags"),
LINESTYLE__FILLWIDTH(0x01c8, "linestyle.fillwidth"),
LINESTYLE__FILLHEIGHT(0x01c9, "linestyle.fillheight"),
LINESTYLE__FILLDZTYPE(0x01ca, "linestyle.filldztype"),
LINESTYLE__LINEWIDTH(0x01cb, "linestyle.linewidth"),
LINESTYLE__LINEMITERLIMIT(0x01cc, "linestyle.linemiterlimit"),
LINESTYLE__LINESTYLE(0x01cd, "linestyle.linestyle"),
LINESTYLE__LINEDASHING(0x01ce, "linestyle.linedashing"),
LINESTYLE__LINEDASHSTYLE(0x01cf, "linestyle.linedashstyle", EscherPropertyTypesHolder.ARRAY),
LINESTYLE__LINESTARTARROWHEAD(0x01d0, "linestyle.linestartarrowhead"),
LINESTYLE__LINEENDARROWHEAD(0x01d1, "linestyle.lineendarrowhead"),
LINESTYLE__LINESTARTARROWWIDTH(0x01d2, "linestyle.linestartarrowwidth"),
LINESTYLE__LINESTARTARROWLENGTH(0x01d3, "linestyle.linestartarrowlength"),
LINESTYLE__LINEENDARROWWIDTH(0x01d4, "linestyle.lineendarrowwidth"),
LINESTYLE__LINEENDARROWLENGTH(0x01d5, "linestyle.lineendarrowlength"),
LINESTYLE__LINEJOINSTYLE(0x01d6, "linestyle.linejoinstyle"),
LINESTYLE__LINEENDCAPSTYLE(0x01d7, "linestyle.lineendcapstyle"),
LINESTYLE__ARROWHEADSOK(0x01fb, "linestyle.arrowheadsok"),
LINESTYLE__ANYLINE(0x01fc, "linestyle.anyline"),
LINESTYLE__HITLINETEST(0x01fd, "linestyle.hitlinetest"),
LINESTYLE__LINEFILLSHAPE(0x01fe, "linestyle.linefillshape"),
LINESTYLE__NOLINEDRAWDASH(0x01ff, "linestyle.nolinedrawdash", EscherPropertyTypesHolder.BOOLEAN),
LINESTYLE__NOLINEDRAWDASH_LEFT(0x057F, "linestyle.nolinedrawdash.left", EscherPropertyTypesHolder.BOOLEAN),
LINESTYLE__NOLINEDRAWDASH_TOP(0x05BF, "linestyle.nolinedrawdash.top", EscherPropertyTypesHolder.BOOLEAN),
LINESTYLE__NOLINEDRAWDASH_BOTTOM(0x063F, "linestyle.nolinedrawdash.bottom", EscherPropertyTypesHolder.BOOLEAN),
LINESTYLE__NOLINEDRAWDASH_RIGHT(0x05FF, "linestyle.nolinedrawdash.right", EscherPropertyTypesHolder.BOOLEAN),
SHADOWSTYLE__TYPE(0x0200, "shadowstyle.type"),
SHADOWSTYLE__COLOR(0x0201, "shadowstyle.color", EscherPropertyTypesHolder.RGB),
SHADOWSTYLE__HIGHLIGHT(0x0202, "shadowstyle.highlight"),
SHADOWSTYLE__CRMOD(0x0203, "shadowstyle.crmod"),
SHADOWSTYLE__OPACITY(0x0204, "shadowstyle.opacity"),
SHADOWSTYLE__OFFSETX(0x0205, "shadowstyle.offsetx"),
SHADOWSTYLE__OFFSETY(0x0206, "shadowstyle.offsety"),
SHADOWSTYLE__SECONDOFFSETX(0x0207, "shadowstyle.secondoffsetx"),
SHADOWSTYLE__SECONDOFFSETY(0x0208, "shadowstyle.secondoffsety"),
SHADOWSTYLE__SCALEXTOX(0x0209, "shadowstyle.scalextox"),
SHADOWSTYLE__SCALEYTOX(0x020a, "shadowstyle.scaleytox"),
SHADOWSTYLE__SCALEXTOY(0x020b, "shadowstyle.scalextoy"),
SHADOWSTYLE__SCALEYTOY(0x020c, "shadowstyle.scaleytoy"),
SHADOWSTYLE__PERSPECTIVEX(0x020d, "shadowstyle.perspectivex"),
SHADOWSTYLE__PERSPECTIVEY(0x020e, "shadowstyle.perspectivey"),
SHADOWSTYLE__WEIGHT(0x020f, "shadowstyle.weight"),
SHADOWSTYLE__ORIGINX(0x0210, "shadowstyle.originx"),
SHADOWSTYLE__ORIGINY(0x0211, "shadowstyle.originy"),
SHADOWSTYLE__SHADOW(0x023e, "shadowstyle.shadow"),
SHADOWSTYLE__SHADOWOBSURED(0x023f, "shadowstyle.shadowobscured"),
PERSPECTIVE__TYPE(0x0240, "perspective.type"),
PERSPECTIVE__OFFSETX(0x0241, "perspective.offsetx"),
PERSPECTIVE__OFFSETY(0x0242, "perspective.offsety"),
PERSPECTIVE__SCALEXTOX(0x0243, "perspective.scalextox"),
PERSPECTIVE__SCALEYTOX(0x0244, "perspective.scaleytox"),
PERSPECTIVE__SCALEXTOY(0x0245, "perspective.scalextoy"),
PERSPECTIVE__SCALEYTOY(0x0246, "perspective.scaleytoy"),
PERSPECTIVE__PERSPECTIVEX(0x0247, "perspective.perspectivex"),
PERSPECTIVE__PERSPECTIVEY(0x0248, "perspective.perspectivey"),
PERSPECTIVE__WEIGHT(0x0249, "perspective.weight"),
PERSPECTIVE__ORIGINX(0x024a, "perspective.originx"),
PERSPECTIVE__ORIGINY(0x024b, "perspective.originy"),
PERSPECTIVE__PERSPECTIVEON(0x027f, "perspective.perspectiveon"),
THREED__SPECULARAMOUNT(0x0280, "3d.specularamount"),
THREED__DIFFUSEAMOUNT(0x0281, "3d.diffuseamount"),
THREED__SHININESS(0x0282, "3d.shininess"),
THREED__EDGETHICKNESS(0x0283, "3d.edgethickness"),
THREED__EXTRUDEFORWARD(0x0284, "3d.extrudeforward"),
THREED__EXTRUDEBACKWARD(0x0285, "3d.extrudebackward"),
RESERVED646(0x0286, "reserved646"),
THREED__EXTRUSIONCOLOR(0x0287, "3d.extrusioncolor", EscherPropertyTypesHolder.RGB),
THREED__CRMOD(0x0288, "3d.crmod"),
THREED__EXTRUSIONCOLOREXT(0x0289, "3d.extrusioncolorext"),
RESERVED650(0x028A, "reserved650"),
THREED__EXTRUSIONCOLOREXTMOD(0x028B, "3d.extrusioncolorextmod"),
RESERVED652(0x028c, "reserved652"),
RESERVED653(0x028d, "reserved653"),
THREED__BOOLEAN_PROPERTIES(0x028f, "3d.booleanproperties"),
THREED__EXTRUDEPLANE(0x029a, "3d.extrudeplane"),
THREED__3DEFFECT(0x02bc, "3d.3deffect"),
THREED__METALLIC(0x02bd, "3d.metallic"),
THREED__USEEXTRUSIONCOLOR(0x02be, "3d.useextrusioncolor", EscherPropertyTypesHolder.RGB),
THREED__LIGHTFACE(0x02bf, "3d.lightface"),
THREEDSTYLE__YROTATIONANGLE(0x02c0, "3dstyle.yrotationangle"),
THREEDSTYLE__XROTATIONANGLE(0x02c1, "3dstyle.xrotationangle"),
THREEDSTYLE__ROTATIONAXISX(0x02c2, "3dstyle.rotationaxisx"),
THREEDSTYLE__ROTATIONAXISY(0x02c3, "3dstyle.rotationaxisy"),
THREEDSTYLE__ROTATIONAXISZ(0x02c4, "3dstyle.rotationaxisz"),
THREEDSTYLE__ROTATIONANGLE(0x02c5, "3dstyle.rotationangle"),
THREEDSTYLE__ROTATIONCENTERX(0x02c6, "3dstyle.rotationcenterx"),
THREEDSTYLE__ROTATIONCENTERY(0x02c7, "3dstyle.rotationcentery"),
THREEDSTYLE__ROTATIONCENTERZ(0x02c8, "3dstyle.rotationcenterz"),
THREEDSTYLE__RENDERMODE(0x02c9, "3dstyle.rendermode"),
THREEDSTYLE__TOLERANCE(0x02ca, "3dstyle.tolerance"),
THREEDSTYLE__XVIEWPOINT(0x02cb, "3dstyle.xviewpoint"),
THREEDSTYLE__YVIEWPOINT(0x02cc, "3dstyle.yviewpoint"),
THREEDSTYLE__ZVIEWPOINT(0x02cd, "3dstyle.zviewpoint"),
THREEDSTYLE__ORIGINX(0x02ce, "3dstyle.originx"),
THREEDSTYLE__ORIGINY(0x02cf, "3dstyle.originy"),
THREEDSTYLE__SKEWANGLE(0x02d0, "3dstyle.skewangle"),
THREEDSTYLE__SKEWAMOUNT(0x02d1, "3dstyle.skewamount"),
THREEDSTYLE__AMBIENTINTENSITY(0x02d2, "3dstyle.ambientintensity"),
THREEDSTYLE__KEYX(0x02d3, "3dstyle.keyx"),
THREEDSTYLE__KEYY(0x02d4, "3dstyle.keyy"),
THREEDSTYLE__KEYZ(0x02d5, "3dstyle.keyz"),
THREEDSTYLE__KEYINTENSITY(0x02d6, "3dstyle.keyintensity"),
THREEDSTYLE__FILLX(0x02d7, "3dstyle.fillx"),
THREEDSTYLE__FILLY(0x02d8, "3dstyle.filly"),
THREEDSTYLE__FILLZ(0x02d9, "3dstyle.fillz"),
THREEDSTYLE__FILLINTENSITY(0x02da, "3dstyle.fillintensity"),
THREEDSTYLE__CONSTRAINROTATION(0x02fb, "3dstyle.constrainrotation"),
THREEDSTYLE__ROTATIONCENTERAUTO(0x02fc, "3dstyle.rotationcenterauto"),
THREEDSTYLE__PARALLEL(0x02fd, "3dstyle.parallel"),
THREEDSTYLE__KEYHARSH(0x02fe, "3dstyle.keyharsh"),
THREEDSTYLE__FILLHARSH(0x02ff, "3dstyle.fillharsh"),
SHAPE__MASTER(0x0301, "shape.master"),
SHAPE__CONNECTORSTYLE(0x0303, "shape.connectorstyle"),
SHAPE__BLACKANDWHITESETTINGS(0x0304, "shape.blackandwhitesettings"),
SHAPE__WMODEPUREBW(0x0305, "shape.wmodepurebw"),
SHAPE__WMODEBW(0x0306, "shape.wmodebw"),
SHAPE__OLEICON(0x033a, "shape.oleicon"),
SHAPE__PREFERRELATIVERESIZE(0x033b, "shape.preferrelativeresize"),
SHAPE__LOCKSHAPETYPE(0x033c, "shape.lockshapetype"),
SHAPE__DELETEATTACHEDOBJECT(0x033e, "shape.deleteattachedobject"),
SHAPE__BACKGROUNDSHAPE(0x033f, "shape.backgroundshape"),
CALLOUT__CALLOUTTYPE(0x0340, "callout.callouttype"),
CALLOUT__XYCALLOUTGAP(0x0341, "callout.xycalloutgap"),
CALLOUT__CALLOUTANGLE(0x0342, "callout.calloutangle"),
CALLOUT__CALLOUTDROPTYPE(0x0343, "callout.calloutdroptype"),
CALLOUT__CALLOUTDROPSPECIFIED(0x0344, "callout.calloutdropspecified"),
CALLOUT__CALLOUTLENGTHSPECIFIED(0x0345, "callout.calloutlengthspecified"),
CALLOUT__ISCALLOUT(0x0379, "callout.iscallout"),
CALLOUT__CALLOUTACCENTBAR(0x037a, "callout.calloutaccentbar"),
CALLOUT__CALLOUTTEXTBORDER(0x037b, "callout.callouttextborder"),
CALLOUT__CALLOUTMINUSX(0x037c, "callout.calloutminusx"),
CALLOUT__CALLOUTMINUSY(0x037d, "callout.calloutminusy"),
CALLOUT__DROPAUTO(0x037e, "callout.dropauto"),
CALLOUT__LENGTHSPECIFIED(0x037f, "callout.lengthspecified"),
GROUPSHAPE__SHAPENAME(0x0380, "groupshape.shapename"),
GROUPSHAPE__DESCRIPTION(0x0381, "groupshape.description"),
GROUPSHAPE__HYPERLINK(0x0382, "groupshape.hyperlink"),
GROUPSHAPE__WRAPPOLYGONVERTICES(0x0383, "groupshape.wrappolygonvertices", EscherPropertyTypesHolder.ARRAY),
GROUPSHAPE__WRAPDISTLEFT(0x0384, "groupshape.wrapdistleft"),
GROUPSHAPE__WRAPDISTTOP(0x0385, "groupshape.wrapdisttop"),
GROUPSHAPE__WRAPDISTRIGHT(0x0386, "groupshape.wrapdistright"),
GROUPSHAPE__WRAPDISTBOTTOM(0x0387, "groupshape.wrapdistbottom"),
GROUPSHAPE__REGROUPID(0x0388, "groupshape.regroupid"),
GROUPSHAPE__UNUSED906(0x038A, "unused906"),
GROUPSHAPE__TOOLTIP(0x038D, "groupshape.wzTooltip"),
GROUPSHAPE__SCRIPT(0x038E, "groupshape.wzScript"),
GROUPSHAPE__POSH(0x038F, "groupshape.posh"),
GROUPSHAPE__POSRELH(0x0390, "groupshape.posrelh"),
GROUPSHAPE__POSV(0x0391, "groupshape.posv"),
GROUPSHAPE__POSRELV(0x0392, "groupshape.posrelv"),
GROUPSHAPE__HR_PCT(0x0393, "groupshape.pctHR"),
GROUPSHAPE__HR_ALIGN(0x0394, "groupshape.alignHR"),
GROUPSHAPE__HR_HEIGHT(0x0395, "groupshape.dxHeightHR"),
GROUPSHAPE__HR_WIDTH(0x0396, "groupshape.dxWidthHR"),
GROUPSHAPE__SCRIPTEXT(0x0397, "groupshape.wzScriptExtAttr"),
GROUPSHAPE__SCRIPTLANG(0x0398, "groupshape.scriptLang"),
GROUPSHAPE__BORDERTOPCOLOR(0x039B, "groupshape.borderTopColor"),
GROUPSHAPE__BORDERLEFTCOLOR(0x039C, "groupshape.borderLeftColor"),
GROUPSHAPE__BORDERBOTTOMCOLOR(0x039D, "groupshape.borderBottomColor"),
GROUPSHAPE__BORDERRIGHTCOLOR(0x039E, "groupshape.borderRightColor"),
GROUPSHAPE__TABLEPROPERTIES(0x039F, "groupshape.tableProperties"),
GROUPSHAPE__TABLEROWPROPERTIES(0x03A0, "groupshape.tableRowProperties", EscherPropertyTypesHolder.ARRAY),
GROUPSHAPE__WEBBOT(0x03A5, "groupshape.wzWebBot"),
GROUPSHAPE__METROBLOB(0x03A9, "groupshape.metroBlob"),
GROUPSHAPE__ZORDER(0x03AA, "groupshape.dhgt"),
GROUPSHAPE__EDITEDWRAP(0x03b9, "groupshape.editedwrap"),
GROUPSHAPE__BEHINDDOCUMENT(0x03ba, "groupshape.behinddocument"),
GROUPSHAPE__ONDBLCLICKNOTIFY(0x03bb, "groupshape.ondblclicknotify"),
GROUPSHAPE__ISBUTTON(0x03bc, "groupshape.isbutton"),
GROUPSHAPE__1DADJUSTMENT(0x03bd, "groupshape.1dadjustment"),
GROUPSHAPE__HIDDEN(0x03be, "groupshape.hidden"),
GROUPSHAPE__FLAGS(0x03bf, "groupshape.groupShapeBooleanProperties"),
UNKNOWN(0xffff, "unknown")
;
/** the property number part of the property id, i.e. the id without is_blip/is_complex flag */
public final short propNumber;
public final String propName;
public final EscherPropertyTypesHolder holder;
EscherPropertyTypes(int propNumber, String name) {
this(propNumber, name, EscherPropertyTypesHolder.UNKNOWN);
}
EscherPropertyTypes(int propNumber, String propName, EscherPropertyTypesHolder holder) {
this.propNumber = (short) propNumber;
this.propName = propName;
this.holder = holder;
}
public short getPropertyId() {
return propNumber;
}
private static final Map<Short, EscherPropertyTypes> LOOKUP =
Stream.of(values()).collect(Collectors.toMap(EscherPropertyTypes::getPropertyId, Function.identity()));
public static EscherPropertyTypes forPropertyID(int propertyId) {
EscherPropertyTypes rt = LOOKUP.get((short)(propertyId & 0x3FFF));
return (rt != null) ? rt : EscherPropertyTypes.UNKNOWN;
}
}

View File

@ -0,0 +1,30 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ddf;
import org.apache.poi.util.Internal;
@Internal
public enum EscherPropertyTypesHolder {
UNKNOWN,
BOOLEAN,
RGB,
SHAPE_PATH,
SIMPLE,
ARRAY
}

View File

@ -17,8 +17,6 @@
package org.apache.poi.ddf;
import org.apache.poi.util.HexDump;
/**
* A color property.
*/
@ -26,11 +24,27 @@ public class EscherRGBProperty
extends EscherSimpleProperty
{
public EscherRGBProperty( short propertyNumber, int rgbColor )
{
/**
* Create an instance of an escher boolean property.
*
* @param propertyNumber The property number (or id)
* @param rgbColor The 24 bit value of this rgb property
*/
public EscherRGBProperty( short propertyNumber, int rgbColor ) {
super( propertyNumber, rgbColor );
}
/**
* Create an instance of an escher boolean property.
*
* @param propertyNumber The property type
* @param rgbColor The 24 bit value of this rgb property
*/
public EscherRGBProperty( EscherPropertyTypes propertyType, int rgbColor ) {
super(propertyType.propNumber, rgbColor );
}
/**
* @return the rgb color as int value
*/
@ -62,13 +76,4 @@ public class EscherRGBProperty
{
return (byte) ( (getRgbColor() >> 16) & 0xFF );
}
@Override
public String toXml(String tab){
StringBuilder builder = new StringBuilder();
builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"0x").append(HexDump.toHex(getId()))
.append("\" name=\"").append(getName()).append("\" blipId=\"")
.append(isBlipId()).append("\" value=\"0x").append(HexDump.toHex(getRgbColor())).append("\"/>");
return builder.toString();
}
}

View File

@ -27,8 +27,9 @@ import java.util.function.Supplier;
import org.apache.poi.common.usermodel.GenericRecord;
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.GenericRecordJsonWriter;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.GenericRecordXmlWriter;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
@ -321,188 +322,12 @@ public abstract class EscherRecord implements Cloneable, GenericRecord {
* @return xml representation of this record
*/
public final String toXml(String tab){
final String nl = System.getProperty( "line.separator" );
String clsNm = getClass().getSimpleName();
StringBuilder sb = new StringBuilder(1000);
sb.append(tab).append("<").append(clsNm)
.append(" recordId=\"0x").append(HexDump.toHex(getRecordId()))
.append("\" version=\"0x").append(HexDump.toHex(getVersion()))
.append("\" instance=\"0x").append(HexDump.toHex(getInstance()))
.append("\" options=\"0x").append(HexDump.toHex(getOptions()))
.append("\" recordSize=\"").append(getRecordSize());
Object[][] attrList = getAttributeMap();
if (attrList == null || attrList.length == 0) {
sb.append("\" />").append(nl);
} else {
sb.append("\">").append(nl);
String childTab = tab+" ";
for (Object[] attrs : attrList) {
String tagName = capitalizeAndTrim((String)attrs[0]);
boolean hasValue = false;
boolean lastChildComplex = false;
for (int i=0; i<attrs.length-1; i+=2) {
Object value = attrs[i+1];
if (value == null) {
// ignore null values
continue;
}
if (!hasValue) {
// only add tagname, when there was a value
sb.append(childTab).append("<").append(tagName).append(">");
}
// add names for optional attributes
String optName = capitalizeAndTrim((String)attrs[i+0]);
if (i>0) {
sb.append(nl).append(childTab).append(" <").append(optName).append(">");
}
lastChildComplex = appendValue(sb, value, true, childTab);
if (i>0) {
sb.append(nl).append(childTab).append(" </").append(optName).append(">");
}
hasValue = true;
}
if (hasValue) {
if (lastChildComplex) {
sb.append(nl).append(childTab);
}
sb.append("</").append(tagName).append(">").append(nl);
}
}
sb.append(tab).append("</").append(clsNm).append(">");
}
return sb.toString();
return GenericRecordXmlWriter.marshal(this);
}
@Override
public final String toString() {
final String nl = System.getProperty( "line.separator" );
StringBuilder sb = new StringBuilder(1000);
sb.append(getClass().getName()).append(" (").append(getRecordName()).append("):").append(nl)
.append(" RecordId: 0x").append(HexDump.toHex( getRecordId() )).append(nl)
.append(" Version: 0x").append(HexDump.toHex( getVersion() )).append(nl)
.append(" Instance: 0x").append(HexDump.toHex( getInstance() )).append(nl)
.append(" Options: 0x").append(HexDump.toHex( getOptions() )).append(nl)
.append(" Record Size: ").append( getRecordSize() );
Object[][] attrList = getAttributeMap();
if (attrList != null && attrList.length > 0) {
String childTab = " ";
for (Object[] attrs : attrList) {
for (int i=0; i<attrs.length-1; i+=2) {
Object value = attrs[i+1];
if (value == null) {
// ignore null values
continue;
}
String name = (String)attrs[i+0];
sb.append(nl).append(childTab).append(name).append(": ");
appendValue(sb, value, false, childTab);
}
}
}
return sb.toString();
}
/**
* @return true, if value was a complex record, false otherwise
*/
private static boolean appendValue(StringBuilder sb, Object value, boolean toXML, String childTab) {
final String nl = System.getProperty( "line.separator" );
boolean isComplex = false;
if (value instanceof String) {
if (toXML) {
escapeXML((String)value, sb);
} else {
sb.append((String)value);
}
} else if (value instanceof Byte) {
sb.append("0x").append(HexDump.toHex((Byte)value));
} else if (value instanceof Short) {
sb.append("0x").append(HexDump.toHex((Short)value));
} else if (value instanceof Integer) {
sb.append("0x").append(HexDump.toHex((Integer)value));
} else if (value instanceof byte[]) {
sb.append(nl).append(HexDump.toHex((byte[])value, 32).replaceAll("(?m)^",childTab+" "));
} else if (value instanceof Boolean) {
sb.append(((Boolean)value).booleanValue());
} else if (value instanceof EscherRecord) {
EscherRecord er = (EscherRecord)value;
if (toXML) {
sb.append(nl).append(er.toXml(childTab+" "));
} else {
sb.append(er.toString().replaceAll("(?m)^",childTab));
}
isComplex = true;
} else if (value instanceof EscherProperty) {
EscherProperty ep = (EscherProperty)value;
if (toXML) {
sb.append(nl).append(ep.toXml(childTab+" "));
} else {
sb.append(ep.toString().replaceAll("(?m)^",childTab));
}
isComplex = true;
} else {
throw new IllegalArgumentException("unknown attribute type "+value.getClass().getSimpleName());
}
return isComplex;
}
/**
* For the purpose of providing toString() and toXml() a subclass can either override those methods
* or provide a Object[][] array in the form {@code { { "Attribute Name (Header)", value, "optional attribute", value }, ... } }.<p>
*
* Null values won't be printed.<p>
*
* The attributes record, version, instance, options must not be returned.
*
* @return the attribute map
*
* @since POI 3.17-beta2
*/
@Internal
protected abstract Object[][] getAttributeMap();
private static String capitalizeAndTrim(final String str) {
if (str == null || str.length() == 0) {
return str;
}
StringBuilder sb = new StringBuilder(str.length());
boolean capitalizeNext = true;
for (char ch : str.toCharArray()) {
if (!Character.isLetterOrDigit(ch)) {
capitalizeNext = true;
continue;
}
if (capitalizeNext) {
if (!Character.isLetter(ch)) {
sb.append('_');
} else {
ch = Character.toTitleCase(ch);
}
capitalizeNext = false;
}
sb.append(ch);
}
return sb.toString();
}
private static void escapeXML(String s, StringBuilder out) {
if (s == null || s.isEmpty()) {
return;
}
for (char c : s.toCharArray()) {
if (c > 127 || c == '"' || c == '<' || c == '>' || c == '&') {
out.append("&#");
out.append((int) c);
out.append(';');
} else {
out.append(c);
}
}
return GenericRecordJsonWriter.marshal(this);
}
@Override

View File

@ -19,8 +19,6 @@ package org.apache.poi.ddf;
/**
* Defines the constants for the various possible shape paths.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class EscherShapePathProperty extends EscherSimpleProperty {
@ -30,8 +28,17 @@ public class EscherShapePathProperty extends EscherSimpleProperty {
public static final int CLOSED_CURVES = 3;
public static final int COMPLEX = 4;
public EscherShapePathProperty( short propertyNumber, int shapePath )
{
/**
* Create an instance of an escher shape path property.
*
* @param propertyNumber
* @param shapePath
*/
public EscherShapePathProperty( short propertyNumber, int shapePath ) {
super( propertyNumber, false, false, shapePath );
}
public EscherShapePathProperty( EscherPropertyTypes type, int shapePath ) {
super( type, false, false, shapePath );
}
}

View File

@ -17,7 +17,10 @@
package org.apache.poi.ddf;
import org.apache.poi.util.HexDump;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndian;
/**
@ -36,12 +39,22 @@ public class EscherSimpleProperty extends EscherProperty
* @param id the property id
* @param propertyValue the property value
*/
public EscherSimpleProperty( short id, int propertyValue )
{
public EscherSimpleProperty( short id, int propertyValue ) {
super( id );
this.propertyValue = propertyValue;
}
/**
* The id is distinct from the actual property number. The id includes the property number the blip id
* flag and an indicator whether the property is complex or not.
*
* @param type the property type
* @param propertyValue the property value
*/
public EscherSimpleProperty( EscherPropertyTypes type, int propertyValue ) {
this(type, false, false, propertyValue);
}
/**
* Constructs a new escher property. The three parameters are combined to form a property id.
*
@ -50,12 +63,24 @@ public class EscherSimpleProperty extends EscherProperty
* @param isBlipId true, if its a blip
* @param propertyValue the property value
*/
public EscherSimpleProperty( short propertyNumber, boolean isComplex, boolean isBlipId, int propertyValue )
{
public EscherSimpleProperty( short propertyNumber, boolean isComplex, boolean isBlipId, int propertyValue ) {
super( propertyNumber, isComplex, isBlipId );
this.propertyValue = propertyValue;
}
/**
* Constructs a new escher property. The three parameters are combined to form a property id.
*
* @param propertyNumber the property number
* @param isComplex true, if its a complex property
* @param isBlipId true, if its a blip
* @param propertyValue the property value
*/
public EscherSimpleProperty( EscherPropertyTypes type, boolean isComplex, boolean isBlipId, int propertyValue ) {
super( type, isComplex, isBlipId );
this.propertyValue = propertyValue;
}
/**
* Serialize the simple part of the escher record.
*
@ -122,27 +147,11 @@ public class EscherSimpleProperty extends EscherProperty
return propertyValue;
}
/**
* @return the string representation of this property.
*/
@Override
public String toString()
{
return "propNum: " + getPropertyNumber()
+ ", RAW: 0x" + HexDump.toHex( getId() )
+ ", propName: " + EscherProperties.getPropertyName( getPropertyNumber() )
+ ", complex: " + isComplex()
+ ", blipId: " + isBlipId()
+ ", value: " + propertyValue + " (0x" + HexDump.toHex(propertyValue) + ")";
}
@Override
public String toXml(String tab){
StringBuilder builder = new StringBuilder();
builder.append(tab).append("<").append(getClass().getSimpleName()).append(" id=\"0x").append(HexDump.toHex(getId()))
.append("\" name=\"").append(getName()).append("\" blipId=\"")
.append(isBlipId()).append("\" complex=\"").append(isComplex()).append("\" value=\"").append("0x")
.append(HexDump.toHex(propertyValue)).append("\"/>");
return builder.toString();
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"value", this::getPropertyValue
);
}
}

View File

@ -23,7 +23,6 @@ import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndian;
/**
@ -247,15 +246,6 @@ public class EscherSpRecord extends EscherRecord {
setInstance( value );
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "ShapeType", getShapeType() },
{ "ShapeId", field_1_shapeId },
{ "Flags", decodeFlags(field_2_flags)+" (0x"+HexDump.toHex(field_2_flags)+")" }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -167,16 +167,6 @@ public class EscherSpgrRecord extends EscherRecord {
this.field_4_rectY2 = rectY2;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "RectX", field_1_rectX1 },
{ "RectY", field_2_rectY1 },
{ "RectWidth", field_3_rectX2 },
{ "RectHeight", field_4_rectY2 }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -158,16 +158,6 @@ public class EscherSplitMenuColorsRecord extends EscherRecord {
this.field_4_color4 = field_4_color4;
}
@Override
protected Object[][] getAttributeMap() {
return new Object[][] {
{ "Color1", field_1_color1 },
{ "Color2", field_2_color2 },
{ "Color3", field_3_color3 },
{ "Color4", field_4_color4 }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -17,8 +17,6 @@
package org.apache.poi.ddf;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
@ -139,24 +137,6 @@ public final class EscherTextboxRecord extends EscherRecord implements Cloneable
return EscherRecordTypes.CLIENT_TEXTBOX.recordName;
}
@Override
protected Object[][] getAttributeMap() {
int numCh = getChildRecords().size();
List<Object> chLst = new ArrayList<>(numCh * 2 + 2);
chLst.add("children");
chLst.add(numCh);
for (EscherRecord er : getChildRecords()) {
chLst.add(er.getRecordName());
chLst.add(er);
}
return new Object[][] {
{ "isContainer", isContainerRecord() },
chLst.toArray(),
{ "Extra Data", thedata }
};
}
@Override
public Enum getGenericRecordType() {
return EscherRecordTypes.CLIENT_TEXTBOX;

View File

@ -144,24 +144,6 @@ public final class UnknownEscherRecord extends EscherRecord implements Cloneable
getChildRecords().add( childRecord );
}
@Override
protected Object[][] getAttributeMap() {
int numCh = getChildRecords().size();
List<Object> chLst = new ArrayList<>(numCh * 2 + 2);
chLst.add("children");
chLst.add(numCh);
for (EscherRecord er : _childRecords) {
chLst.add(er.getRecordName());
chLst.add(er);
}
return new Object[][] {
{ "isContainer", isContainerRecord() },
chLst.toArray(),
{ "Extra Data", thedata }
};
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(

View File

@ -32,56 +32,14 @@ import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherDgRecord;
import org.apache.poi.ddf.EscherDggRecord;
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.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.ddf.EscherSplitMenuColorsRecord;
import org.apache.poi.hssf.extractor.OldExcelExtractor;
import org.apache.poi.hssf.record.BOFRecord;
import org.apache.poi.hssf.record.BackupRecord;
import org.apache.poi.hssf.record.BookBoolRecord;
import org.apache.poi.hssf.record.BoundSheetRecord;
import org.apache.poi.hssf.record.CodepageRecord;
import org.apache.poi.hssf.record.CountryRecord;
import org.apache.poi.hssf.record.DSFRecord;
import org.apache.poi.hssf.record.DateWindow1904Record;
import org.apache.poi.hssf.record.DrawingGroupRecord;
import org.apache.poi.hssf.record.EOFRecord;
import org.apache.poi.hssf.record.EscherAggregate;
import org.apache.poi.hssf.record.ExtSSTRecord;
import org.apache.poi.hssf.record.ExtendedFormatRecord;
import org.apache.poi.hssf.record.ExternSheetRecord;
import org.apache.poi.hssf.record.FileSharingRecord;
import org.apache.poi.hssf.record.FnGroupCountRecord;
import org.apache.poi.hssf.record.FontRecord;
import org.apache.poi.hssf.record.FormatRecord;
import org.apache.poi.hssf.record.HideObjRecord;
import org.apache.poi.hssf.record.HyperlinkRecord;
import org.apache.poi.hssf.record.InterfaceEndRecord;
import org.apache.poi.hssf.record.InterfaceHdrRecord;
import org.apache.poi.hssf.record.MMSRecord;
import org.apache.poi.hssf.record.NameCommentRecord;
import org.apache.poi.hssf.record.NameRecord;
import org.apache.poi.hssf.record.PaletteRecord;
import org.apache.poi.hssf.record.PasswordRecord;
import org.apache.poi.hssf.record.PasswordRev4Record;
import org.apache.poi.hssf.record.PrecisionRecord;
import org.apache.poi.hssf.record.ProtectRecord;
import org.apache.poi.hssf.record.ProtectionRev4Record;
import org.apache.poi.hssf.record.RecalcIdRecord;
import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.RefreshAllRecord;
import org.apache.poi.hssf.record.SSTRecord;
import org.apache.poi.hssf.record.StyleRecord;
import org.apache.poi.hssf.record.SupBookRecord;
import org.apache.poi.hssf.record.TabIdRecord;
import org.apache.poi.hssf.record.UseSelFSRecord;
import org.apache.poi.hssf.record.WindowOneRecord;
import org.apache.poi.hssf.record.WindowProtectRecord;
import org.apache.poi.hssf.record.WriteAccessRecord;
import org.apache.poi.hssf.record.WriteProtectRecord;
import org.apache.poi.hssf.record.*;
import org.apache.poi.hssf.record.common.UnicodeString;
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.poifs.crypt.CryptoFunctions;
@ -1961,9 +1919,9 @@ public final class InternalWorkbook {
}
opt.setRecordId((short) 0xF00B);
opt.setOptions((short) 0x0033);
opt.addEscherProperty( new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296) );
opt.addEscherProperty( new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, 0x08000041) );
opt.addEscherProperty( new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, 134217792) );
opt.addEscherProperty( new EscherBoolProperty(EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296) );
opt.addEscherProperty( new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, 0x08000041) );
opt.addEscherProperty( new EscherRGBProperty(EscherPropertyTypes.LINESTYLE__COLOR, 134217792) );
splitMenuColors.setRecordId((short) 0xF11E);
splitMenuColors.setOptions((short) 0x0040);
splitMenuColors.setColor1(0x0800000D);
@ -2190,7 +2148,7 @@ public final class InternalWorkbook {
} else if (recordId == EscherOptRecord.RECORD_ID){
EscherOptRecord opt = (EscherOptRecord)shapeChildRecord;
EscherSimpleProperty prop = opt.lookup(
EscherProperties.BLIP__BLIPTODISPLAY );
EscherPropertyTypes.BLIP__BLIPTODISPLAY );
if (prop != null){
int pictureIndex = prop.getPropertyValue();
// increment reference count for pictures

View File

@ -17,8 +17,21 @@
package org.apache.poi.hssf.usermodel;
import org.apache.poi.ddf.*;
import org.apache.poi.hssf.record.*;
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.EscherRecord;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
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.FtCblsSubRecord;
import org.apache.poi.hssf.record.LbsDataSubRecord;
import org.apache.poi.hssf.record.ObjRecord;
import org.apache.poi.hssf.record.TextObjectRecord;
import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType;
/**
@ -56,10 +69,10 @@ public class HSSFCombobox extends HSSFSimpleShape {
sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE);
opt.setRecordId(EscherOptRecord.RECORD_ID);
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 17039620));
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008));
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00020000));
opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 17039620));
opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x00080008));
opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
opt.addEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x00020000));
HSSFClientAnchor userAnchor = (HSSFClientAnchor) getAnchor();
userAnchor.setAnchorType(AnchorType.DONT_MOVE_DO_RESIZE);

View File

@ -20,7 +20,7 @@ import org.apache.poi.ddf.DefaultEscherRecordFactory;
import org.apache.poi.ddf.EscherBSERecord;
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.EscherSimpleProperty;
import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
import org.apache.poi.hssf.record.EndSubRecord;
@ -98,11 +98,11 @@ public class HSSFComment extends HSSFTextbox implements Comment {
protected EscherContainerRecord createSpContainer() {
EscherContainerRecord spContainer = super.createSpContainer();
EscherOptRecord opt = spContainer.getChildById(EscherOptRecord.RECORD_ID);
opt.removeEscherProperty(EscherProperties.TEXT__TEXTLEFT);
opt.removeEscherProperty(EscherProperties.TEXT__TEXTRIGHT);
opt.removeEscherProperty(EscherProperties.TEXT__TEXTTOP);
opt.removeEscherProperty(EscherProperties.TEXT__TEXTBOTTOM);
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, false, false, GROUP_SHAPE_PROPERTY_DEFAULT_VALUE));
opt.removeEscherProperty(EscherPropertyTypes.TEXT__TEXTLEFT);
opt.removeEscherProperty(EscherPropertyTypes.TEXT__TEXTRIGHT);
opt.removeEscherProperty(EscherPropertyTypes.TEXT__TEXTTOP);
opt.removeEscherProperty(EscherPropertyTypes.TEXT__TEXTBOTTOM);
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, false, false, GROUP_SHAPE_PROPERTY_DEFAULT_VALUE));
return spContainer;
}
@ -290,34 +290,34 @@ public class HSSFComment extends HSSFTextbox implements Comment {
}
public void setBackgroundImage(int pictureIndex){
setPropertyValue(new EscherSimpleProperty( EscherProperties.FILL__PATTERNTEXTURE, false, true, pictureIndex));
setPropertyValue(new EscherSimpleProperty( EscherProperties.FILL__FILLTYPE, false, false, FILL_TYPE_PICTURE));
setPropertyValue(new EscherSimpleProperty( EscherPropertyTypes.FILL__PATTERNTEXTURE, false, true, pictureIndex));
setPropertyValue(new EscherSimpleProperty( EscherPropertyTypes.FILL__FILLTYPE, false, false, FILL_TYPE_PICTURE));
EscherBSERecord bse = getPatriarch().getSheet().getWorkbook().getWorkbook().getBSERecord(pictureIndex);
bse.setRef(bse.getRef() + 1);
}
public void resetBackgroundImage(){
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.FILL__PATTERNTEXTURE);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.FILL__PATTERNTEXTURE);
if (null != property){
EscherBSERecord bse = getPatriarch().getSheet().getWorkbook().getWorkbook().getBSERecord(property.getPropertyValue());
bse.setRef(bse.getRef() - 1);
getOptRecord().removeEscherProperty(EscherProperties.FILL__PATTERNTEXTURE);
getOptRecord().removeEscherProperty(EscherPropertyTypes.FILL__PATTERNTEXTURE);
}
setPropertyValue(new EscherSimpleProperty( EscherProperties.FILL__FILLTYPE, false, false, FILL_TYPE_SOLID));
setPropertyValue(new EscherSimpleProperty( EscherPropertyTypes.FILL__FILLTYPE, false, false, FILL_TYPE_SOLID));
}
public int getBackgroundImageId(){
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.FILL__PATTERNTEXTURE);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.FILL__PATTERNTEXTURE);
return property == null ? 0 : property.getPropertyValue();
}
private void setHidden(boolean value){
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.GROUPSHAPE__PRINT);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.GROUPSHAPE__FLAGS);
// see http://msdn.microsoft.com/en-us/library/dd949807(v=office.12).aspx
if (value){
setPropertyValue(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, false, false, property.getPropertyValue() | GROUP_SHAPE_HIDDEN_MASK));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, false, false, property.getPropertyValue() | GROUP_SHAPE_HIDDEN_MASK));
} else {
setPropertyValue(new EscherSimpleProperty(EscherProperties.GROUPSHAPE__PRINT, false, false, property.getPropertyValue() & GROUP_SHAPE_NOT_HIDDEN_MASK));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, false, false, property.getPropertyValue() & GROUP_SHAPE_NOT_HIDDEN_MASK));
}
}

View File

@ -27,7 +27,7 @@ import org.apache.poi.ddf.EscherClientDataRecord;
import org.apache.poi.ddf.EscherComplexProperty;
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.EscherSimpleProperty;
import org.apache.poi.ddf.EscherTextboxRecord;
import org.apache.poi.hssf.model.InternalWorkbook;
@ -72,7 +72,7 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
public int getPictureIndex()
{
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.BLIP__BLIPTODISPLAY);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.BLIP__BLIPTODISPLAY);
if (null == property){
return -1;
}
@ -81,15 +81,15 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
public void setPictureIndex( int pictureIndex )
{
setPropertyValue(new EscherSimpleProperty( EscherProperties.BLIP__BLIPTODISPLAY, false, true, pictureIndex));
setPropertyValue(new EscherSimpleProperty( EscherPropertyTypes.BLIP__BLIPTODISPLAY, false, true, pictureIndex));
}
@Override
protected EscherContainerRecord createSpContainer() {
EscherContainerRecord spContainer = super.createSpContainer();
EscherOptRecord opt = spContainer.getChildById(EscherOptRecord.RECORD_ID);
opt.removeEscherProperty(EscherProperties.LINESTYLE__LINEDASHING);
opt.removeEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH);
opt.removeEscherProperty(EscherPropertyTypes.LINESTYLE__LINEDASHING);
opt.removeEscherProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH);
spContainer.removeChildRecord(spContainer.getChildById(EscherTextboxRecord.RECORD_ID));
return spContainer;
}
@ -247,8 +247,7 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
* The filename of the embedded image
*/
public String getFileName() {
EscherComplexProperty propFile = getOptRecord().lookup(
EscherProperties.BLIP__BLIPFILENAME);
EscherComplexProperty propFile = getOptRecord().lookup(EscherPropertyTypes.BLIP__BLIPFILENAME);
return (null == propFile)
? ""
: StringUtil.getFromUnicodeLE(propFile.getComplexData()).trim();
@ -257,7 +256,8 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
public void setFileName(String data){
// TODO: add trailing \u0000?
byte[] bytes = StringUtil.getToUnicodeLE(data);
EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, true, bytes);
EscherComplexProperty prop = new EscherComplexProperty(EscherPropertyTypes.BLIP__BLIPFILENAME, true, bytes.length);
prop.setComplexData(bytes);
setPropertyValue(prop);
}

View File

@ -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.EscherArrayProperty;
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.EscherShapePathProperty;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
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;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
@ -66,24 +80,24 @@ public class HSSFPolygon extends HSSFSimpleShape {
sp.setFlags(EscherSpRecord.FLAG_CHILD | EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE);
}
opt.setRecordId(EscherOptRecord.RECORD_ID);
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.TRANSFORM__ROTATION, false, false, 0));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, false, false, 100));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, false, false, 100));
opt.setEscherProperty(new EscherShapePathProperty(EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.TRANSFORM__ROTATION, false, false, 0));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__RIGHT, false, false, 100));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__BOTTOM, false, false, 100));
opt.setEscherProperty(new EscherShapePathProperty(EscherPropertyTypes.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__FILLOK, false, false, 0x00010001));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINESTARTARROWHEAD, false, false, 0x0));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEENDARROWHEAD, false, false, 0x0));
opt.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEENDCAPSTYLE, false, false, 0x0));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__FILLOK, false, false, 0x00010001));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINESTARTARROWHEAD, false, false, 0x0));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEENDARROWHEAD, false, false, 0x0));
opt.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEENDCAPSTYLE, false, false, 0x0));
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, 1));
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, 1));
opt.setEscherProperty(new EscherBoolProperty( EscherProperties.GROUPSHAPE__PRINT, 0x080000));
opt.setEscherProperty(new EscherBoolProperty( EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x080000));
EscherRecord anchor = getAnchor().getEscherAnchor();
clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
@ -123,7 +137,7 @@ public class HSSFPolygon extends HSSFSimpleShape {
* @return array of x coordinates
*/
public int[] getXPoints() {
EscherArrayProperty verticesProp = getOptRecord().lookup(EscherProperties.GEOMETRY__VERTICES);
EscherArrayProperty verticesProp = getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__VERTICES);
if (null == verticesProp){
return new int[]{};
}
@ -140,7 +154,7 @@ public class HSSFPolygon extends HSSFSimpleShape {
* @return array of y coordinates
*/
public int[] getYPoints() {
EscherArrayProperty verticesProp = getOptRecord().lookup(EscherProperties.GEOMETRY__VERTICES);
EscherArrayProperty verticesProp = getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__VERTICES);
if (null == verticesProp){
return new int[]{};
}
@ -165,7 +179,7 @@ public class HSSFPolygon extends HSSFSimpleShape {
if (xPoints.length == 0){
logger.log( POILogger.ERROR, "HSSFPolygon must have at least one point");
}
EscherArrayProperty verticesProp = new EscherArrayProperty(EscherProperties.GEOMETRY__VERTICES, false, new byte[0] );
EscherArrayProperty verticesProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__VERTICES, false, 0);
verticesProp.setNumberOfElementsInArray(xPoints.length+1);
verticesProp.setNumberOfElementsInMemory(xPoints.length+1);
verticesProp.setSizeOfElements(0xFFF0);
@ -183,7 +197,7 @@ public class HSSFPolygon extends HSSFSimpleShape {
verticesProp.setElement(point, data);
setPropertyValue(verticesProp);
EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherProperties.GEOMETRY__SEGMENTINFO, false, null );
EscherArrayProperty segmentsProp = new EscherArrayProperty(EscherPropertyTypes.GEOMETRY__SEGMENTINFO, false, 0);
segmentsProp.setSizeOfElements(0x0002);
segmentsProp.setNumberOfElementsInArray(xPoints.length * 2 + 4);
segmentsProp.setNumberOfElementsInMemory(xPoints.length * 2 + 4);
@ -205,15 +219,15 @@ public class HSSFPolygon extends HSSFSimpleShape {
* @param height
*/
public void setPolygonDrawArea(int width, int height) {
setPropertyValue(new EscherSimpleProperty(EscherProperties.GEOMETRY__RIGHT, width));
setPropertyValue(new EscherSimpleProperty(EscherProperties.GEOMETRY__BOTTOM, height));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__RIGHT, width));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.GEOMETRY__BOTTOM, height));
}
/**
* @return shape width
*/
public int getDrawAreaWidth() {
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.GEOMETRY__RIGHT);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__RIGHT);
return property == null ? 100: property.getPropertyValue();
}
@ -221,7 +235,7 @@ public class HSSFPolygon extends HSSFSimpleShape {
* @return shape height
*/
public int getDrawAreaHeight() {
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.GEOMETRY__BOTTOM);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__BOTTOM);
return property == null ? 100: property.getPropertyValue();
}
}

View File

@ -26,8 +26,8 @@ import org.apache.poi.ddf.EscherClientAnchorRecord;
import org.apache.poi.ddf.EscherComplexProperty;
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.EscherRGBProperty;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
@ -222,7 +222,7 @@ public abstract class HSSFShape implements Shape {
* The color applied to the lines of this shape.
*/
public int getLineStyleColor() {
EscherRGBProperty rgbProperty = _optRecord.lookup(EscherProperties.LINESTYLE__COLOR);
EscherRGBProperty rgbProperty = _optRecord.lookup(EscherPropertyTypes.LINESTYLE__COLOR);
return rgbProperty == null ? LINESTYLE__COLOR_DEFAULT : rgbProperty.getRgbColor();
}
@ -230,20 +230,20 @@ public abstract class HSSFShape implements Shape {
* The color applied to the lines of this shape.
*/
public void setLineStyleColor(int lineStyleColor) {
setPropertyValue(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, lineStyleColor));
setPropertyValue(new EscherRGBProperty(EscherPropertyTypes.LINESTYLE__COLOR, lineStyleColor));
}
@Override
public void setLineStyleColor(int red, int green, int blue) {
int lineStyleColor = ((blue) << 16) | ((green) << 8) | red;
setPropertyValue(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, lineStyleColor));
setPropertyValue(new EscherRGBProperty(EscherPropertyTypes.LINESTYLE__COLOR, lineStyleColor));
}
/**
* The color used to fill this shape.
*/
public int getFillColor() {
EscherRGBProperty rgbProperty = _optRecord.lookup(EscherProperties.FILL__FILLCOLOR);
EscherRGBProperty rgbProperty = _optRecord.lookup(EscherPropertyTypes.FILL__FILLCOLOR);
return rgbProperty == null ? FILL__FILLCOLOR_DEFAULT : rgbProperty.getRgbColor();
}
@ -251,20 +251,20 @@ public abstract class HSSFShape implements Shape {
* The color used to fill this shape.
*/
public void setFillColor(int fillColor) {
setPropertyValue(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, fillColor));
setPropertyValue(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, fillColor));
}
@Override
public void setFillColor(int red, int green, int blue) {
int fillColor = ((blue) << 16) | ((green) << 8) | red;
setPropertyValue(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, fillColor));
setPropertyValue(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, fillColor));
}
/**
* @return returns with width of the line in EMUs. 12700 = 1 pt.
*/
public int getLineWidth() {
EscherSimpleProperty property = _optRecord.lookup(EscherProperties.LINESTYLE__LINEWIDTH);
EscherSimpleProperty property = _optRecord.lookup(EscherPropertyTypes.LINESTYLE__LINEWIDTH);
return property == null ? LINEWIDTH_DEFAULT: property.getPropertyValue();
}
@ -275,14 +275,14 @@ public abstract class HSSFShape implements Shape {
* @see HSSFShape#LINEWIDTH_ONE_PT
*/
public void setLineWidth(int lineWidth) {
setPropertyValue(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, lineWidth));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEWIDTH, lineWidth));
}
/**
* @return One of the constants in LINESTYLE_*
*/
public int getLineStyle() {
EscherSimpleProperty property = _optRecord.lookup(EscherProperties.LINESTYLE__LINEDASHING);
EscherSimpleProperty property = _optRecord.lookup(EscherPropertyTypes.LINESTYLE__LINEDASHING);
if (null == property){
return LINESTYLE_DEFAULT;
}
@ -295,26 +295,26 @@ public abstract class HSSFShape implements Shape {
* @param lineStyle One of the constants in LINESTYLE_*
*/
public void setLineStyle(int lineStyle) {
setPropertyValue(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, lineStyle));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEDASHING, lineStyle));
if (getLineStyle() != HSSFShape.LINESTYLE_SOLID) {
setPropertyValue(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEENDCAPSTYLE, 0));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEENDCAPSTYLE, 0));
if (getLineStyle() == HSSFShape.LINESTYLE_NONE){
setPropertyValue(new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
setPropertyValue(new EscherBoolProperty( EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080000));
} else {
setPropertyValue( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
setPropertyValue( new EscherBoolProperty( EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
}
}
}
@Override
public boolean isNoFill() {
EscherBoolProperty property = _optRecord.lookup(EscherProperties.FILL__NOFILLHITTEST);
EscherBoolProperty property = _optRecord.lookup(EscherPropertyTypes.FILL__NOFILLHITTEST);
return property == null ? NO_FILL_DEFAULT : property.getPropertyValue() == NO_FILLHITTEST_TRUE;
}
@Override
public void setNoFill(boolean noFill) {
setPropertyValue(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, noFill ? NO_FILLHITTEST_TRUE : NO_FILLHITTEST_FALSE));
setPropertyValue(new EscherBoolProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, noFill ? NO_FILLHITTEST_TRUE : NO_FILLHITTEST_FALSE));
}
protected void setPropertyValue(EscherProperty property){
@ -366,7 +366,7 @@ public abstract class HSSFShape implements Shape {
*/
public int getRotationDegree(){
ByteArrayOutputStream bos = new ByteArrayOutputStream();
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TRANSFORM__ROTATION);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TRANSFORM__ROTATION);
if (null == property){
return 0;
}
@ -388,7 +388,7 @@ public abstract class HSSFShape implements Shape {
* @param value
*/
public void setRotationDegree(short value){
setPropertyValue(new EscherSimpleProperty(EscherProperties.TRANSFORM__ROTATION , (value << 16)));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TRANSFORM__ROTATION , (value << 16)));
}
/**
@ -420,7 +420,7 @@ public abstract class HSSFShape implements Shape {
if (eor == null) {
return null;
}
EscherProperty ep = eor.lookup(EscherProperties.GROUPSHAPE__SHAPENAME);
EscherProperty ep = eor.lookup(EscherPropertyTypes.GROUPSHAPE__SHAPENAME);
if (ep instanceof EscherComplexProperty) {
return StringUtil.getFromUnicodeLE(((EscherComplexProperty)ep).getComplexData());
}

View File

@ -23,8 +23,8 @@ import java.util.Map;
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.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
@ -110,7 +110,7 @@ public class HSSFShapeFactory {
if(optRecord == null) {
shape = new HSSFSimpleShape(container, objRecord, txtRecord);
} else {
EscherProperty property = optRecord.lookup(EscherProperties.GEOMETRY__VERTICES);
EscherProperty property = optRecord.lookup(EscherPropertyTypes.GEOMETRY__VERTICES);
if (null != property) {
shape = new HSSFPolygon(container, objRecord, txtRecord);
} else {

View File

@ -29,7 +29,7 @@ import org.apache.poi.ddf.EscherClientAnchorRecord;
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.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherRecordTypes;
import org.apache.poi.ddf.EscherSpRecord;
@ -104,8 +104,8 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
}
opt.setRecordId(EscherOptRecord.RECORD_ID);
opt.setOptions((short) 0x0023);
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x00040004));
opt.addEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00080000));
opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.PROTECTION__LOCKAGAINSTGROUPING, 0x00040004));
opt.addEscherProperty(new EscherBoolProperty(EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x00080000));
anchor = getAnchor().getEscherAnchor();
clientData.setRecordId(EscherClientDataRecord.RECORD_ID);

View File

@ -17,12 +17,15 @@
package org.apache.poi.hssf.usermodel;
import static org.apache.poi.hssf.record.TextObjectRecord.HORIZONTAL_TEXT_ALIGNMENT_CENTERED;
import static org.apache.poi.hssf.record.TextObjectRecord.VERTICAL_TEXT_ALIGNMENT_CENTER;
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.EscherProperties;
import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherRGBProperty;
import org.apache.poi.ddf.EscherShapePathProperty;
import org.apache.poi.ddf.EscherSimpleProperty;
@ -36,9 +39,6 @@ import org.apache.poi.hssf.record.TextObjectRecord;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.SimpleShape;
import static org.apache.poi.hssf.record.TextObjectRecord.HORIZONTAL_TEXT_ALIGNMENT_CENTERED;
import static org.apache.poi.hssf.record.TextObjectRecord.VERTICAL_TEXT_ALIGNMENT_CENTER;
/**
* Represents a simple shape such as a line, rectangle or oval.
*/
@ -121,16 +121,16 @@ public class HSSFSimpleShape extends HSSFShape implements SimpleShape
clientData.setOptions( (short) (0x0000) );
EscherOptRecord optRecord = new EscherOptRecord();
optRecord.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEDASHING, LINESTYLE_SOLID));
optRecord.setEscherProperty( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
optRecord.setEscherProperty(new EscherSimpleProperty(EscherPropertyTypes.LINESTYLE__LINEDASHING, LINESTYLE_SOLID));
optRecord.setEscherProperty( new EscherBoolProperty( EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
// optRecord.setEscherProperty(new EscherSimpleProperty(EscherProperties.LINESTYLE__LINEWIDTH, LINEWIDTH_DEFAULT));
optRecord.setEscherProperty(new EscherRGBProperty(EscherProperties.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT));
optRecord.setEscherProperty(new EscherRGBProperty(EscherProperties.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT));
optRecord.setEscherProperty(new EscherBoolProperty(EscherProperties.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE));
optRecord.setEscherProperty( new EscherBoolProperty( EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
optRecord.setEscherProperty(new EscherRGBProperty(EscherPropertyTypes.FILL__FILLCOLOR, FILL__FILLCOLOR_DEFAULT));
optRecord.setEscherProperty(new EscherRGBProperty(EscherPropertyTypes.LINESTYLE__COLOR, LINESTYLE__COLOR_DEFAULT));
optRecord.setEscherProperty(new EscherBoolProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, NO_FILLHITTEST_FALSE));
optRecord.setEscherProperty( new EscherBoolProperty( EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x00080008));
optRecord.setEscherProperty( new EscherShapePathProperty( EscherProperties.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX ) );
optRecord.setEscherProperty(new EscherBoolProperty( EscherProperties.GROUPSHAPE__PRINT, 0x080000));
optRecord.setEscherProperty( new EscherShapePathProperty( EscherPropertyTypes.GEOMETRY__SHAPEPATH, EscherShapePathProperty.COMPLEX ) );
optRecord.setEscherProperty(new EscherBoolProperty( EscherPropertyTypes.GROUPSHAPE__FLAGS, 0x080000));
optRecord.setRecordId( EscherOptRecord.RECORD_ID );
EscherTextboxRecord escherTextbox = new EscherTextboxRecord();
@ -189,7 +189,7 @@ public class HSSFSimpleShape extends HSSFShape implements SimpleShape
TextObjectRecord txo = getOrCreateTextObjRecord();
txo.setStr(rtr);
if (string.getString() != null){
setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__TEXTID, string.getString().hashCode()));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__TEXTID, string.getString().hashCode()));
}
}
@ -233,12 +233,12 @@ public class HSSFSimpleShape extends HSSFShape implements SimpleShape
}
public int getWrapText(){
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.TEXT__WRAPTEXT);
EscherSimpleProperty property = getOptRecord().lookup(EscherPropertyTypes.TEXT__WRAPTEXT);
return null == property ? WRAP_SQUARE : property.getPropertyValue();
}
public void setWrapText(int value){
setPropertyValue(new EscherSimpleProperty(EscherProperties.TEXT__WRAPTEXT, false, false, value));
setPropertyValue(new EscherSimpleProperty(EscherPropertyTypes.TEXT__WRAPTEXT, false, false, value));
}
/**

View File

@ -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 HSSFSimpleShape {
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(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(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.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(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.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 HSSFSimpleShape {
* @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 HSSFSimpleShape {
* 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 HSSFSimpleShape {
* 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 HSSFSimpleShape {
* 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 HSSFSimpleShape {
* 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));
}
/**

View File

@ -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) {

View File

@ -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 HSLFPictureShape {
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 HSLFPictureShape {
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);
}

View File

@ -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 Shape<?,?>> {
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);
}
/**

View File

@ -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 HSLFPictureShape {
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();

View File

@ -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 HSLFAutoShape {
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 HSLFAutoShape {
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 HSLFAutoShape {
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);

View File

@ -93,16 +93,6 @@ public class EscherPlaceholder extends EscherRecord {
return size;
}
@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(

View File

@ -35,7 +35,7 @@ import org.apache.poi.ddf.EscherBoolProperty;
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 RecordAtom implements Iterable<EscherRecord
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);

View File

@ -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 HSLFTextShape implements AutoShape<HSLFShape,
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 HSLFTextShape implements AutoShape<HSLFShape,
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 HSLFTextShape implements AutoShape<HSLFShape,
*/
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 HSLFTextShape implements AutoShape<HSLFShape,
*/
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 HSLFTextShape implements AutoShape<HSLFShape,
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 HSLFTextShape implements AutoShape<HSLFShape,
}
}
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 HSLFTextShape implements AutoShape<HSLFShape,
}
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");

View File

@ -27,7 +27,7 @@ import org.apache.poi.ddf.EscherArrayProperty;
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) {

View File

@ -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 extends HSLFAutoShape implements FreeformSh
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 extends HSLFAutoShape implements FreeformSh
}
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 extends HSLFAutoShape implements FreeformSh
}
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();

View File

@ -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 HSLFTextShape implements Line<HSLFShape,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;
}

View File

@ -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 extends HSLFPictureShape implements ObjectSha
* @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 extends HSLFPictureShape implements ObjectSha
* @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);

View File

@ -25,7 +25,7 @@ import org.apache.poi.ddf.AbstractEscherOptRecord;
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 HSLFSimpleShape implements PictureShape<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 HSLFSimpleShape implements PictureShape<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 HSLFSimpleShape implements PictureShape<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 HSLFSimpleShape implements PictureShape<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 HSLFSimpleShape implements PictureShape<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 HSLFSimpleShape implements PictureShape<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);

View File

@ -32,8 +32,8 @@ import org.apache.poi.ddf.EscherColorRef.SysIndexProcedure;
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.ShapeContainer;
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 implements Shape<HSLFShape,HSLFTextParagraph> {
*/
@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 implements Shape<HSLFShape,HSLFTextParagraph> {
* 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();
@ -286,24 +304,66 @@ public abstract class HSLFShape implements Shape<HSLFShape,HSLFTextParagraph> {
}
}
/**
* 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,14 +371,40 @@ public abstract class HSLFShape implements Shape<HSLFShape,HSLFTextParagraph> {
/**
* 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.
* @param propType The type of the property. One of the constants defined in EscherOptRecord.
*/
public int getEscherProperty(short propId, int defaultValue){
AbstractEscherOptRecord opt = getEscherOptRecord();
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
*/
@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 implements Shape<HSLFShape,HSLFTextParagraph> {
_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 implements Shape<HSLFShape,HSLFTextParagraph> {
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 implements Shape<HSLFShape,HSLFTextParagraph> {
}
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() {

View File

@ -23,9 +23,9 @@ import org.apache.poi.ddf.AbstractEscherOptRecord;
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);
}

View File

@ -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 extends HSLFPlaceholderDetails {
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();

View File

@ -24,8 +24,8 @@ import org.apache.poi.ddf.EscherChildAnchorRecord;
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
*/
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 extends HSLFShape implements SimpleShape<H
public double getLineWidth() {
return HSLFSimpleShape.this.getLineWidth();
}
};
}
@ -322,22 +332,13 @@ public abstract class HSLFSimpleShape extends HSLFShape implements SimpleShape<H
}
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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
* @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 extends HSLFShape implements SimpleShape<H
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 extends HSLFShape implements SimpleShape<H
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);
}

View File

@ -30,7 +30,7 @@ import org.apache.poi.ddf.AbstractEscherOptRecord;
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, TableShape<HSLFShape,HSLFTextParagraph> {
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, TableShape<HSLFShape,HSLFTextParagraph> {
// 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, TableShape<HSLFShape,HSLFTextParagraph> {
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());

View File

@ -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 HSLFTextBox implements TableCell<HSLFSh
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 HSLFTextBox implements TableCell<HSLFSh
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);

View File

@ -18,7 +18,7 @@
package org.apache.poi.hslf.usermodel;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.sl.usermodel.ShapeContainer;
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.sl.usermodel.TextBox;
@ -76,12 +76,12 @@ public class HSLFTextBox extends HSLFTextShape implements TextBox<HSLFShape,HSLF
setShapeType(ShapeType.TEXT_BOX);
//set default properties for a TextBox
setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004);
setEscherProperty(EscherProperties.FILL__FILLBACKCOLOR, 0x8000000);
setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x100000);
setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001);
setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80000);
setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
setEscherProperty(EscherPropertyTypes.FILL__FILLCOLOR, 0x8000004);
setEscherProperty(EscherPropertyTypes.FILL__FILLBACKCOLOR, 0x8000000);
setEscherProperty(EscherPropertyTypes.FILL__NOFILLHITTEST, 0x100000);
setEscherProperty(EscherPropertyTypes.LINESTYLE__COLOR, 0x8000001);
setEscherProperty(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH, 0x80000);
setEscherProperty(EscherPropertyTypes.SHADOWSTYLE__COLOR, 0x8000002);
// init paragraphs
getTextParagraphs();
@ -92,6 +92,6 @@ public class HSLFTextBox extends HSLFTextShape implements TextBox<HSLFShape,HSLF
@Override
protected void setDefaultTextProperties(HSLFTextParagraph _txtrun){
setVerticalAlignment(VerticalAlignment.TOP);
setEscherProperty(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20002);
setEscherProperty(EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 0x20002);
}
}

View File

@ -31,7 +31,7 @@ import java.util.List;
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.EscherSimpleProperty;
import org.apache.poi.ddf.EscherTextboxRecord;
import org.apache.poi.hslf.exceptions.HSLFException;
@ -377,7 +377,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
*/
/* package */ HSLFTextAnchor getAlignment(){
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__ANCHORTEXT);
EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.TEXT__ANCHORTEXT);
final HSLFTextAnchor align;
if (prop == null){
/**
@ -416,7 +416,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
(hta.vAlign == vAlign) &&
(hta.baseline == null || hta.baseline == baseline)
) {
setEscherProperty(EscherProperties.TEXT__ANCHORTEXT, hta.nativeId);
setEscherProperty(EscherPropertyTypes.TEXT__ANCHORTEXT, hta.nativeId);
break;
}
}
@ -467,7 +467,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @return the botom margin
*/
public double getBottomInset(){
return getInset(EscherProperties.TEXT__TEXTBOTTOM, .05);
return getInset(EscherPropertyTypes.TEXT__TEXTBOTTOM, .05);
}
/**
@ -477,7 +477,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @param margin the bottom margin
*/
public void setBottomInset(double margin){
setInset(EscherProperties.TEXT__TEXTBOTTOM, margin);
setInset(EscherPropertyTypes.TEXT__TEXTBOTTOM, margin);
}
/**
@ -489,7 +489,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @return the left margin
*/
public double getLeftInset(){
return getInset(EscherProperties.TEXT__TEXTLEFT, .1);
return getInset(EscherPropertyTypes.TEXT__TEXTLEFT, .1);
}
/**
@ -499,7 +499,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @param margin the left margin
*/
public void setLeftInset(double margin){
setInset(EscherProperties.TEXT__TEXTLEFT, margin);
setInset(EscherPropertyTypes.TEXT__TEXTLEFT, margin);
}
/**
@ -511,7 +511,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @return the right margin
*/
public double getRightInset(){
return getInset(EscherProperties.TEXT__TEXTRIGHT, .1);
return getInset(EscherPropertyTypes.TEXT__TEXTRIGHT, .1);
}
/**
@ -521,7 +521,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @param margin the right margin
*/
public void setRightInset(double margin){
setInset(EscherProperties.TEXT__TEXTRIGHT, margin);
setInset(EscherPropertyTypes.TEXT__TEXTRIGHT, margin);
}
/**
@ -532,7 +532,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @return the top margin
*/
public double getTopInset(){
return getInset(EscherProperties.TEXT__TEXTTOP, .05);
return getInset(EscherPropertyTypes.TEXT__TEXTTOP, .05);
}
/**
@ -542,7 +542,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @param margin the top margin
*/
public void setTopInset(double margin){
setInset(EscherProperties.TEXT__TEXTTOP, margin);
setInset(EscherPropertyTypes.TEXT__TEXTTOP, margin);
}
/**
@ -550,22 +550,22 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* and the edge of the inscribed rectangle of the shape that contains the text.
* Default value is 1/20 inch.
*
* @param propId the id of the inset edge
* @param type the type of the inset edge
* @return the inset in points
*/
private double getInset(short propId, double defaultInch) {
private double getInset(EscherPropertyTypes type, double defaultInch) {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, propId);
EscherSimpleProperty prop = getEscherProperty(opt, type);
int val = prop == null ? (int)(Units.toEMU(Units.POINT_DPI)*defaultInch) : prop.getPropertyValue();
return Units.toPoints(val);
}
/**
* @param propId the id of the inset edge
* @param type the type of the inset edge
* @param margin the inset in points
*/
private void setInset(short propId, double margin){
setEscherProperty(propId, Units.toEMU(margin));
private void setInset(EscherPropertyTypes type, double margin){
setEscherProperty(type, Units.toEMU(margin));
}
/**
@ -578,7 +578,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
*/
public int getWordWrapEx() {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__WRAPTEXT);
EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.TEXT__WRAPTEXT);
return prop == null ? WrapSquare : prop.getPropertyValue();
}
@ -589,7 +589,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* Must be one of the <code>Wrap*</code> constants defined in this class.
*/
public void setWordWrapEx(int wrap){
setEscherProperty(EscherProperties.TEXT__WRAPTEXT, wrap);
setEscherProperty(EscherPropertyTypes.TEXT__WRAPTEXT, wrap);
}
@Override
@ -608,7 +608,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
*/
public int getTextId(){
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__TEXTID);
EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.TEXT__TEXTID);
return prop == null ? 0 : prop.getPropertyValue();
}
@ -618,7 +618,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
* @param id of the text
*/
public void setTextId(int id){
setEscherProperty(EscherProperties.TEXT__TEXTID, id);
setEscherProperty(EscherPropertyTypes.TEXT__TEXTID, id);
}
@Override
@ -732,7 +732,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
public TextDirection getTextDirection() {
// see 2.4.5 MSOTXFL
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__TEXTFLOW);
EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.TEXT__TEXTFLOW);
int msotxfl = (prop == null) ? 0 : prop.getPropertyValue();
switch (msotxfl) {
default:
@ -774,14 +774,14 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
break;
}
}
setEscherProperty(opt, EscherProperties.TEXT__TEXTFLOW, msotxfl);
setEscherProperty(opt, EscherPropertyTypes.TEXT__TEXTFLOW, msotxfl);
}
@Override
public Double getTextRotation() {
// see 2.4.6 MSOCDIR
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__FONTROTATION);
EscherSimpleProperty prop = getEscherProperty(opt, EscherPropertyTypes.TEXT__FONTROTATION);
return (prop == null) ? null : (90. * prop.getPropertyValue());
}
@ -789,10 +789,10 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
public void setTextRotation(Double rotation) {
AbstractEscherOptRecord opt = getEscherOptRecord();
if (rotation == null) {
opt.removeEscherProperty(EscherProperties.TEXT__FONTROTATION);
opt.removeEscherProperty(EscherPropertyTypes.TEXT__FONTROTATION);
} else {
int rot = (int)(Math.round(rotation / 90.) % 4L);
setEscherProperty(EscherProperties.TEXT__FONTROTATION, rot);
setEscherProperty(EscherPropertyTypes.TEXT__FONTROTATION, rot);
}
}

View File

@ -86,6 +86,6 @@ public class HwmfColorRef implements Cloneable, GenericRecord {
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties("color", colorRef::getRGB);
return GenericRecordUtil.getGenericProperties("color", this::getColor);
}
}

View File

@ -21,18 +21,17 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.poi.ddf.EscherTertiaryOptRecord;
import org.apache.poi.ddf.DefaultEscherRecordFactory;
import org.apache.poi.ddf.EscherBSERecord;
import org.apache.poi.ddf.EscherBlipRecord;
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.EscherRecord;
import org.apache.poi.ddf.EscherRecordFactory;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.ddf.EscherTertiaryOptRecord;
import org.apache.poi.hwpf.model.EscherRecordHolder;
import org.apache.poi.hwpf.model.FSPA;
import org.apache.poi.hwpf.model.FSPATable;
@ -125,8 +124,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings
{
public HorizontalPositioning getHorizontalPositioning()
{
int value = getTertiaryPropertyValue(
EscherProperties.GROUPSHAPE__POSH, -1 );
int value = getTertiaryPropertyValue(EscherPropertyTypes.GROUPSHAPE__POSH );
switch ( value )
{
@ -149,8 +147,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings
public HorizontalRelativeElement getHorizontalRelative()
{
int value = getTertiaryPropertyValue(
EscherProperties.GROUPSHAPE__POSRELH, -1 );
int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSRELH );
switch ( value )
{
@ -184,7 +181,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings
return null;
EscherSimpleProperty escherProperty = escherOptRecord
.lookup( EscherProperties.BLIP__BLIPTODISPLAY );
.lookup( EscherPropertyTypes.BLIP__BLIPTODISPLAY );
if ( escherProperty == null )
return null;
@ -221,30 +218,25 @@ public class OfficeDrawingsImpl implements OfficeDrawings
return fspa.getSpid();
}
private int getTertiaryPropertyValue( int propertyId,
int defaultValue )
{
private int getTertiaryPropertyValue( EscherPropertyTypes type ) {
EscherContainerRecord shapeDescription = getEscherShapeRecordContainer( getShapeId() );
if ( shapeDescription == null )
return defaultValue;
if ( shapeDescription == null ) {
return -1;
}
EscherTertiaryOptRecord escherTertiaryOptRecord = shapeDescription
.getChildById( EscherTertiaryOptRecord.RECORD_ID );
if ( escherTertiaryOptRecord == null )
return defaultValue;
if ( escherTertiaryOptRecord == null ) {
return -1;
}
EscherSimpleProperty escherProperty = escherTertiaryOptRecord
.lookup( propertyId );
if ( escherProperty == null )
return defaultValue;
return escherProperty.getPropertyValue();
EscherSimpleProperty escherProperty = escherTertiaryOptRecord.lookup( type );
return ( escherProperty == null ) ? -1 : escherProperty.getPropertyValue();
}
public VerticalPositioning getVerticalPositioning()
{
int value = getTertiaryPropertyValue(
EscherProperties.GROUPSHAPE__POSV, -1 );
int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSV );
switch ( value )
{
@ -267,8 +259,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings
public VerticalRelativeElement getVerticalRelativeElement()
{
int value = getTertiaryPropertyValue(
EscherProperties.GROUPSHAPE__POSV, -1 );
int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSV );
switch ( value )
{

View File

@ -29,8 +29,8 @@ import org.apache.poi.ddf.EscherBSERecord;
import org.apache.poi.ddf.EscherBlipRecord;
import org.apache.poi.ddf.EscherComplexProperty;
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.hwpf.model.PICF;
import org.apache.poi.hwpf.model.PICFAndOfficeArtData;
@ -468,11 +468,11 @@ public final class Picture {
*/
public String getDescription()
{
for(EscherRecord escherRecord : _picfAndOfficeArtData.getShape().getChildRecords()){
for(EscherRecord escherRecord : _picfAndOfficeArtData.getShape()){
if(escherRecord instanceof EscherOptRecord){
EscherOptRecord escherOptRecord = (EscherOptRecord) escherRecord;
for(EscherProperty property : escherOptRecord.getEscherProperties()){
if(EscherProperties.GROUPSHAPE__DESCRIPTION == property.getPropertyNumber()){
if (EscherPropertyTypes.GROUPSHAPE__DESCRIPTION.propNumber == property.getPropertyNumber()){
byte[] complexData = ((EscherComplexProperty)property).getComplexData();
return StringUtil.getFromUnicodeLE(complexData,0,complexData.length/2-1);
}

View File

@ -38,7 +38,7 @@ import org.apache.poi.POIDataSamples;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherDgRecord;
import org.apache.poi.ddf.EscherDggRecord;
import org.apache.poi.ddf.EscherProperties;
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;
@ -407,12 +407,12 @@ public final class TestShapes {
HSLFSimpleShape sh = new HSLFAutoShape(ShapeType.RT_TRIANGLE);
AbstractEscherOptRecord opt = sh.getEscherOptRecord();
EscherSimpleProperty prop = HSLFSimpleShape.getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH);
EscherSimpleProperty prop = HSLFSimpleShape.getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEWIDTH);
assertNull(prop);
assertEquals(HSLFSimpleShape.DEFAULT_LINE_WIDTH, sh.getLineWidth(), 0);
sh.setLineWidth(1.0);
prop = HSLFSimpleShape.getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH);
prop = HSLFSimpleShape.getEscherProperty(opt, EscherPropertyTypes.LINESTYLE__LINEWIDTH);
assertNotNull(prop);
assertEquals(1.0, sh.getLineWidth(), 0);
}

View File

@ -28,18 +28,11 @@ import org.apache.poi.POIDataSamples;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherBSERecord;
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.hslf.HSLFTestDataSamples;
import org.apache.poi.hslf.record.Document;
import org.apache.poi.hslf.usermodel.HSLFAutoShape;
import org.apache.poi.hslf.usermodel.HSLFFill;
import org.apache.poi.hslf.usermodel.HSLFPictureData;
import org.apache.poi.hslf.usermodel.HSLFShape;
import org.apache.poi.hslf.usermodel.HSLFSheet;
import org.apache.poi.hslf.usermodel.HSLFSlide;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.sl.usermodel.ShapeType;
import org.junit.Test;
@ -209,7 +202,7 @@ public final class TestBackground {
private int getFillPictureRefCount(HSLFShape shape, HSLFFill fill) {
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();

View File

@ -53,7 +53,7 @@ import org.apache.poi.common.usermodel.fonts.FontGroup;
import org.apache.poi.ddf.AbstractEscherOptRecord;
import org.apache.poi.ddf.EscherArrayProperty;
import org.apache.poi.ddf.EscherColorRef;
import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.hslf.HSLFTestDataSamples;
import org.apache.poi.hslf.exceptions.OldPowerPointFormatException;
import org.apache.poi.hslf.model.HeadersFooters;
@ -600,7 +600,7 @@ public final class TestBugs {
HSLFSlideShow ppt = open("bug46441.ppt");
HSLFAutoShape as = (HSLFAutoShape)ppt.getSlides().get(0).getShapes().get(0);
AbstractEscherOptRecord opt = as.getEscherOptRecord();
EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherPropertyTypes.FILL__SHADECOLORS);
double[][] exp = {
// r, g, b, position
{94, 158, 255, 0},

View File

@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.apache.poi.poifs.storage.RawDataUtil;
import org.apache.poi.sl.usermodel.PictureData;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.HexRead;
import org.junit.Test;
@ -37,8 +38,8 @@ public final class TestEscherBSERecord {
int bytesWritten = r.fillFields( HexRead.readFromString( data ), 0, new DefaultEscherRecordFactory() );
assertEquals( 44, bytesWritten );
assertEquals( (short) 0x0001, r.getOptions() );
assertEquals( EscherBSERecord.BT_JPEG, r.getBlipTypeWin32() );
assertEquals( EscherBSERecord.BT_JPEG, r.getBlipTypeMacOS() );
assertEquals( PictureData.PictureType.JPEG.nativeId, r.getBlipTypeWin32() );
assertEquals( PictureData.PictureType.JPEG.nativeId, r.getBlipTypeMacOS() );
assertEquals( "[01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 00]", HexDump.toHex( r.getUid() ) );
assertEquals( (short) 1, r.getTag() );
assertEquals( 2, r.getRef() );
@ -65,8 +66,8 @@ public final class TestEscherBSERecord {
private EscherBSERecord createRecord() {
EscherBSERecord r = new EscherBSERecord();
r.setOptions( (short) 0x0001 );
r.setBlipTypeWin32( EscherBSERecord.BT_JPEG );
r.setBlipTypeMacOS( EscherBSERecord.BT_JPEG );
r.setBlipTypeWin32( (byte)PictureData.PictureType.JPEG.nativeId );
r.setBlipTypeMacOS( (byte)PictureData.PictureType.JPEG.nativeId );
r.setUid( HexRead.readFromString( "01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00" ) );
r.setTag( (short) 1 );
r.setRef( 2 );
@ -82,29 +83,31 @@ public final class TestEscherBSERecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
EscherBSERecord record = createRecord();
String expected =
"org.apache.poi.ddf.EscherBSERecord (BSE):" + nl +
" RecordId: 0xF007" + nl +
" Version: 0x0001" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0001" + nl +
" Record Size: 44" + nl +
" BlipTypeWin32: 0x05" + nl +
" BlipTypeMacOS: 0x05" + nl +
" SUID: " + nl +
" 00: 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 00" + nl +
" Tag: 0x0001" + nl +
" Size: 0x00000000" + nl +
" Ref: 0x00000002" + nl +
" Offset: 0x00000003" + nl +
" Usage: 0x04" + nl +
" Name: 0x05" + nl +
" Unused2: 0x06" + nl +
" Unused3: 0x07" + nl +
" Extra Data: " + nl +
" : 0";
"{ /* BSE */\n" +
"\t recordId: -4089 /* 0xf007 */\n" +
"\t, version: 1\n" +
"\t, instance: 0\n" +
"\t, options: 1\n" +
"\t, recordSize: 44 /* 0x0000002c */\n" +
"\t, blipTypeWin32: 5\n" +
"\t, pictureTypeWin32: \"JPEG\"\n" +
"\t, blipTypeMacOS: 5\n" +
"\t, pictureTypeMacOS: \"JPEG\"\n" +
"\t, suid: \"AQIDBAUGBwgJCgsMDQ4PAA==\"\n" +
"\t, tag: 1\n" +
"\t, size: 0\n" +
"\t, ref: 2\n" +
"\t, offset: 3\n" +
"\t, usage: 4\n" +
"\t, name: 5\n" +
"\t, unused2: 6\n" +
"\t, unused3: 7\n" +
"\t, blipRecord: null\n" +
"\t, remainingData: \"\"\n" +
"}";
String actual = record.toString();
assertEquals( expected, actual );
}

View File

@ -23,6 +23,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.apache.poi.POIDataSamples;
import org.apache.poi.sl.usermodel.PictureData;
import org.junit.Test;
/**
@ -41,8 +42,8 @@ public final class TestEscherBlipRecord {
record.fillFields(data, 0, new DefaultEscherRecordFactory());
EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(0);
assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeWin32());
assertEquals(EscherBSERecord.BT_PNG, bse1.getBlipTypeMacOS());
assertEquals(PictureData.PictureType.PNG.nativeId, bse1.getBlipTypeWin32());
assertEquals(PictureData.PictureType.PNG.nativeId, bse1.getBlipTypeMacOS());
assertArrayEquals(new byte[]{
0x65, 0x07, 0x4A, (byte)0x8D, 0x3E, 0x42, (byte)0x8B, (byte)0xAC,
0x1D, (byte)0x89, 0x35, 0x4F, 0x48, (byte)0xFA, 0x37, (byte)0xC2
@ -88,8 +89,8 @@ public final class TestEscherBlipRecord {
EscherContainerRecord bstore = (EscherContainerRecord)record.getChild(1);
EscherBSERecord bse1 = (EscherBSERecord)bstore.getChild(1);
//System.out.println(bse1);
assertEquals(EscherBSERecord.BT_WMF, bse1.getBlipTypeWin32());
assertEquals(EscherBSERecord.BT_PICT, bse1.getBlipTypeMacOS());
assertEquals(PictureData.PictureType.WMF.nativeId, bse1.getBlipTypeWin32());
assertEquals(PictureData.PictureType.PICT.nativeId, bse1.getBlipTypeMacOS());
assertArrayEquals(new byte[]{
(byte)0xC7, 0x15, 0x69, 0x2D, (byte)0xE5, (byte)0x89, (byte)0xA3, 0x6F,
0x66, 0x03, (byte)0xD6, 0x24, (byte)0xF7, (byte)0xDB, 0x1D, 0x13

View File

@ -24,7 +24,16 @@ import org.junit.Test;
public final class TestEscherBoolProperty {
@Test
public void testToString() {
EscherBoolProperty p = new EscherBoolProperty((short)1, 1);
assertEquals("propNum: 1, RAW: 0x0001, propName: unknown, complex: false, blipId: false, value: 1 (0x00000001)", p.toString());
EscherBoolProperty p = new EscherBoolProperty(EscherPropertyTypes.GEOMETRY__FILLOK, 1);
String expected =
"{ /* GEOMETRY__FILLOK */\n" +
"\t id: 383 /* 0x017f */\n" +
"\t, name: \"geometry.fillok\"\n" +
"\t, propertyNumber: 383 /* 0x017f */\n" +
"\t, propertySize: 6\n" +
"\t, flags: 0x17f /* */ \n" +
"\t, value: 1\n" +
"}";
assertEquals(expected, p.toString());
}
}

View File

@ -64,19 +64,18 @@ public final class TestEscherChildAnchorRecord {
@Test
public void testToString(){
String nl = System.getProperty( "line.separator" );
String expected =
"org.apache.poi.ddf.EscherChildAnchorRecord (ChildAnchor):" + nl +
" RecordId: 0xF00F" + nl +
" Version: 0x0001" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0001" + nl +
" Record Size: 24" + nl +
" X1: 0x00000001" + nl +
" Y1: 0x00000002" + nl +
" X2: 0x00000003" + nl +
" Y2: 0x00000004";
"{ /* CHILD_ANCHOR */\n" +
"\t recordId: -4081 /* 0xf00f */\n" +
"\t, version: 1\n" +
"\t, instance: 0\n" +
"\t, options: 1\n" +
"\t, recordSize: 24 /* 0x00000018 */\n" +
"\t, x1: 1\n" +
"\t, y1: 2\n" +
"\t, x2: 3\n" +
"\t, y2: 4\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -70,25 +70,24 @@ public class TestEscherClientAnchorRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherClientAnchorRecord (ClientAnchor):" + nl +
" RecordId: 0xF010" + nl +
" Version: 0x0001" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0001" + nl +
" Record Size: 28" + nl +
" Flag: 0x004D" + nl +
" Col1: 0x0037" + nl +
" DX1: 0x0021" + nl +
" Row1: 0x0058" + nl +
" DY1: 0x000B" + nl +
" Col2: 0x002C" + nl +
" DX2: 0x0016" + nl +
" Row2: 0x0063" + nl +
" DY2: 0x0042" + nl +
" Extra Data: " + nl +
" 0: FF, DD";
"{ /* CLIENT_ANCHOR */\n" +
"\t recordId: -4080 /* 0xf010 */\n" +
"\t, version: 1\n" +
"\t, instance: 0\n" +
"\t, options: 1\n" +
"\t, recordSize: 28 /* 0x0000001c */\n" +
"\t, flag: 77 /* 0x004d */\n" +
"\t, col1: 55 /* 0x0037 */\n" +
"\t, dx1: 33 /* 0x0021 */\n" +
"\t, row1: 88 /* 0x0058 */\n" +
"\t, dy1: 11 /* 0x000b */\n" +
"\t, col2: 44 /* 0x002c */\n" +
"\t, dx2: 22 /* 0x0016 */\n" +
"\t, row2: 99 /* 0x0063 */\n" +
"\t, dy2: 66 /* 0x0042 */\n" +
"\t, remainingData: \"/90=\"\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -53,17 +53,15 @@ public class TestEscherClientDataRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherClientDataRecord (ClientData):" + nl +
" RecordId: 0xF011" + nl +
" Version: 0x0002" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0002" + nl +
" Record Size: 8" + nl +
" Extra Data: " + nl +
" : 0";
"{ /* CLIENT_DATA */\n" +
"\t recordId: -4079 /* 0xf011 */\n" +
"\t, version: 2\n" +
"\t, instance: 0\n" +
"\t, options: 2\n" +
"\t, recordSize: 8\n" +
"\t, remainingData: \"\"\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -19,6 +19,7 @@ package org.apache.poi.ddf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import java.util.List;
@ -80,16 +81,15 @@ public final class TestEscherContainerRecord {
EscherContainerRecord r = new EscherContainerRecord();
r.setRecordId(EscherContainerRecord.SP_CONTAINER);
r.setOptions((short) 0x000F);
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" RecordId: 0xF004" + nl +
" Version: 0x000F" + nl +
" Instance: 0x0000" + nl +
" Options: 0x000F" + nl +
" Record Size: 8" + nl +
" isContainer: true" + nl +
" children: 0x00000000";
"{ /* SP_CONTAINER */\n" +
"\t recordId: -4092 /* 0xf004 */\n" +
"\t, version: 15 /* 0x000f */\n" +
"\t, instance: 0\n" +
"\t, options: 15 /* 0x000f */\n" +
"\t, recordSize: 8\n" +
"\t, isContainer: true\n" +
"}";
assertEquals(expected, r.toString());
EscherOptRecord r2 = new EscherOptRecord();
@ -98,54 +98,62 @@ public final class TestEscherContainerRecord {
r2.setRecordId(EscherOptRecord.RECORD_ID);
r.addChildRecord(r2);
expected =
"org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" RecordId: 0xF004" + nl +
" Version: 0x000F" + nl +
" Instance: 0x0000" + nl +
" Options: 0x000F" + nl +
" Record Size: 16" + nl +
" isContainer: true" + nl +
" children: 0x00000001" + nl +
" Child 0: org.apache.poi.ddf.EscherOptRecord (Opt):" + nl +
" RecordId: 0xF00B" + nl +
" Version: 0x0003" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0003" + nl +
" Record Size: 8" + nl +
" isContainer: false" + nl +
" numchildren: 0x00000000" + nl +
" properties: 0x00000000";
expected =
"{ /* SP_CONTAINER */\n" +
"\t recordId: -4092 /* 0xf004 */\n" +
"\t, version: 15 /* 0x000f */\n" +
"\t, instance: 0\n" +
"\t, options: 15 /* 0x000f */\n" +
"\t, recordSize: 16 /* 0x00000010 */\n" +
"\t, isContainer: true\n" +
"\t, children: [\n" +
"\t\t{ /* OPT */\n" +
"\t\t\t recordId: -4085 /* 0xf00b */\n" +
"\t\t\t, version: 3\n" +
"\t\t\t, instance: 0\n" +
"\t\t\t, options: 3\n" +
"\t\t\t, recordSize: 8\n" +
"\t\t\t, isContainer: false\n" +
"\t\t\t, properties: [\n" +
"]\n" +
"\t\t}\n" +
"\t]\n" +
"}";
assertEquals(expected, r.toString());
r.addChildRecord(r2);
expected =
"org.apache.poi.ddf.EscherContainerRecord (SpContainer):" + nl +
" RecordId: 0xF004" + nl +
" Version: 0x000F" + nl +
" Instance: 0x0000" + nl +
" Options: 0x000F" + nl +
" Record Size: 24" + nl +
" isContainer: true" + nl +
" children: 0x00000002" + nl +
" Child 0: org.apache.poi.ddf.EscherOptRecord (Opt):" + nl +
" RecordId: 0xF00B" + nl +
" Version: 0x0003" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0003" + nl +
" Record Size: 8" + nl +
" isContainer: false" + nl +
" numchildren: 0x00000000" + nl +
" properties: 0x00000000" + nl +
" Child 1: org.apache.poi.ddf.EscherOptRecord (Opt):" + nl +
" RecordId: 0xF00B" + nl +
" Version: 0x0003" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0003" + nl +
" Record Size: 8" + nl +
" isContainer: false" + nl +
" numchildren: 0x00000000" + nl +
" properties: 0x00000000";
"{ /* SP_CONTAINER */\n" +
"\t recordId: -4092 /* 0xf004 */\n" +
"\t, version: 15 /* 0x000f */\n" +
"\t, instance: 0\n" +
"\t, options: 15 /* 0x000f */\n" +
"\t, recordSize: 24 /* 0x00000018 */\n" +
"\t, isContainer: true\n" +
"\t, children: [\n" +
"\t\t{ /* OPT */\n" +
"\t\t\t recordId: -4085 /* 0xf00b */\n" +
"\t\t\t, version: 3\n" +
"\t\t\t, instance: 0\n" +
"\t\t\t, options: 3\n" +
"\t\t\t, recordSize: 8\n" +
"\t\t\t, isContainer: false\n" +
"\t\t\t, properties: [\n" +
"]\n" +
"\t\t},\n" +
"\n" +
"\t\t{ /* OPT - index: 1 */\n" +
"\t\t\t recordId: -4085 /* 0xf00b */\n" +
"\t\t\t, version: 3\n" +
"\t\t\t, instance: 0\n" +
"\t\t\t, options: 3\n" +
"\t\t\t, recordSize: 8\n" +
"\t\t\t, isContainer: false\n" +
"\t\t\t, properties: [\n" +
"]\n" +
"\t\t}\n" +
"\t]\n" +
"}";
assertEquals(expected, r.toString());
}
@ -159,8 +167,6 @@ public final class TestEscherContainerRecord {
public int getRecordSize() { return 10; }
@Override
public String getRecordName() { return ""; }
@Override
protected Object[][] getAttributeMap() { return null; }
@Override
public Enum getGenericRecordType() { return EscherRecordTypes.UNKNOWN; }
}
@ -203,7 +209,7 @@ public final class TestEscherContainerRecord {
children0.add(chC);
List<EscherRecord> children1 = ecr.getChildRecords();
assertTrue(children0 != children1);
assertNotSame(children0, children1);
assertEquals(2, children1.size());
assertEquals(chA, children1.get(0));
assertEquals(chB, children1.get(1));

View File

@ -57,16 +57,17 @@ public final class TestEscherDgRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherDgRecord (Dg):" + nl +
" RecordId: 0xF008" + nl +
" Version: 0x0000" + nl +
" Instance: 0x0001" + nl +
" Options: 0x0010" + nl +
" Record Size: 16" + nl +
" NumShapes: 0x00000002" + nl +
" LastMSOSPID: 0x00000401";
"{ /* DG */\n" +
"\t recordId: -4088 /* 0xf008 */\n" +
"\t, version: 0\n" +
"\t, instance: 1\n" +
"\t, options: 16 /* 0x0010 */\n" +
"\t, recordSize: 16 /* 0x00000010 */\n" +
"\t, numShapes: 2\n" +
"\t, lastMSOSPID: 1025 /* 0x00000401 */\n" +
"\t, drawingGroupId: 1\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -68,20 +68,24 @@ public final class TestEscherDggRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherDggRecord (Dgg):" + nl +
" RecordId: 0xF006" + nl +
" Version: 0x0000" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0000" + nl +
" Record Size: 32" + nl +
" ShapeIdMax: 0x00000402" + nl +
" NumIdClusters: 0x00000002" + nl +
" NumShapesSaved: 0x00000002" + nl +
" DrawingsSaved: 0x00000001" + nl +
" FileId Clusters: 0x00000001" + nl +
" Group1: 0x00000002";
"{ /* DGG */\n" +
"\t recordId: -4090 /* 0xf006 */\n" +
"\t, version: 0\n" +
"\t, instance: 0\n" +
"\t, options: 0\n" +
"\t, recordSize: 32 /* 0x00000020 */\n" +
"\t, fileIdClusters: [\n" +
"\n" +
"\t{ /* FileIdCluster */\n" +
"\t\t drawingGroupId: 1\n" +
"\t\t, numShapeIdUsed: 2\n" +
"\t}]\n" +
"\t, shapeIdMax: 1026 /* 0x00000402 */\n" +
"\t, numIdClusters: 2\n" +
"\t, numShapesSaved: 2\n" +
"\t, drawingsSaved: 1\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -19,13 +19,13 @@ package org.apache.poi.ddf;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import org.apache.poi.POIDataSamples;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.poifs.storage.RawDataUtil;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.NullOutputStream;
@ -39,20 +39,51 @@ public class TestEscherDump {
public static void init() throws UnsupportedEncodingException {
nullPS = new NullPrinterStream();
}
// simple test to at least cover some parts of the class
@Test
public void testSimple() throws Exception {
// simple test to at least cover some parts of the class
EscherDump.main(new String[] {}, nullPS);
new EscherDump().dump(0, new byte[] {}, nullPS);
new EscherDump().dump(new byte[] {}, 0, 0, nullPS);
new EscherDump().dumpOld(0, new ByteArrayInputStream(new byte[] {}), nullPS);
final String recordData =
"H4sIAAAAAAAAAL2UaVCSWxjHX0SBChABLRXM1FxSEzXTzHK7dpVIcMmwxXCP9KaGTaWlGYLrtGmGmYEmYmqF2qIt4ppmjNG+" +
"2dWulUtOUdq1NHjva8v90HT7eM+Z5znP/M9/zpk5v3mONgAoc5AANBDKeVDW0gQAjZkVCti3mKnpAExpB/m8AKTyEiTCNd2J" +
"Z+O0o6W+srDCyH3DhzkgUAD76v86QNA4mKTMg4QfnUew/5qA29CZz6ALqGcSgNzOICB05gD1rhODJR2AZu3Ox3YOKAfVUPhH" +
"ULtbpdVJ0ccdijw0pY1A56M3Jup7U15jp7X4PPTTecx92/MT9eZwtUICrLJvsB6z0fHG5qbw7mRpFRaOnPYJ6SqXd5AQMSKM" +
"jceyMD4NsULkj1OwHncz5cO3pPvCXXPTMNdNa+kDfwku4q0RnFL8YGBI6N+oXHlgzCkGWGRdONJPK1PbusJrhBltylPBMm3e" +
"G0kw6DGdLhoU3pmgJ6n1maC1fXrs0uUL6cWG/kGVm3MWHh3pALq4+PH55k7Uu3d+x85u9zxwIzfQuU+3TIG5SkOgrS1tCJb3" +
"3nqHrxcx3XlJA6vZJ6Oi1ctaXppQyBQLbLLrPJaKKq+zIexFLrVdZM+r34pJJpNN1hSrWbM/lIyRmKpYRIi7CybTTUzBWt49" +
"11HRM/VbCiZ6Gyt9TZmhGXPS75xYjpH366vhgLJu4ZoZfM+/4FvGaBZIE9aZ2SduMrUT4mJA4NpP8F2AhB+dT+D/jY/7DZ84" +
"ULbaK4C4crJvZ4qej2+em2+Vni4mPluh2e5xyoGUWYRaoFnWubHcaX+L09Ya0ta4KrP13C2ozMyicr4ovY0fNhT2wfMF7ip8" +
"/tD0u96myXcn92gtTnEuGfBJxY0lFG0mJxPWpknjNxmzWvzKj18rpjO4hhQXAtaRVSmJu+D8egI3RdQVXYxzRhs1+HE2iNvM" +
"fVe2DsSjqJQbBdUajcaECC3/58MP97Q0Eo+GNTdKbhk1r7UJadrVj0rLplmAqU/BlGeXDObGLtl69vITp9tD25vVY9vUT17u" +
"WTGW8idcxUDMMX2PHa8X6xzG0C5cGJcVth40m3ycwCpcfuP4OClu6IpysV/9QuvrdW/Yb3Qj6Ul7e3nybqemdkvLXsXG2N3v" +
"qeVE0woXb06pLduuFWUv7NxY8jq1k63fcD5jvG/w/IE8eUNh0Pohz0WRx6tdOlf4XhlbF5pgfYYzn8w6cjYx/8rBXvtWNz8L" +
"6uu+ig35t+dgOc4jOpLirmFPtjQdKHovGZ4Bff4LaIPLnx6cbnKFo8JHDoGpJ1+BwKGfgM6GhB+d+F/0acj3PiVEABoProzN" +
"1dcsVo9TPoPIF+r9EQI0qtveV4WEI1YhFjfmLxDsyFJptHvx/0BD3bfKJY/XqlFTReyIko4tQSzFFRyGRbkyg7MyuCqTmsiA" +
"mAgs3FGB0BOR7LzNuUYMC9QWaXyUTcxELLOFQvaRIQZ1HlgkJtE25Ohym/xzkqxqbFI1fWKsGgKq0m/q9kwkVDJAvdKM+7c8" +
"wj8GVPdneU0GVaeLVO6Kd3T2lMQFRNeCRwUyx5LSIxI5RmIFNc2RnuSIfYOeOZ+0CwzE7BFTJO+5cVeUz2nDN7mMYUSYOZyv" +
"SyyaRRydLKPYMmqFbS5K8RJ6vQNIGtiuI8AKCEgXsqV9Vz1tgvzovKiD2FPtpNgRlb0keoprdS+hnsP6ICwLBrE9dz26g2YP" +
"DszibWNE7zW5xndwlsoqFRh87XTFw8BXiFdv0SDsGBnfNcOu/Qu7y7SLppfzLJq714byzYQ590BA+BN2xyDhR+fZX7CL/s5u" +
"Q9f/8ccWX28U3BaGw9qTiSqDfOtHmXXZq8XiHXAYoz901c5V2lVulTXZEMqwnLq8+8ds95s0FFrdl73saRntr/UuUxFHY0WU" +
"z5b333qXTe/NagSRrmqkqypoNG12Oz3nE5Yzyt7d05eY66Ci2oTR+rNS3K4OiClGK+07HWtFFLvAqv6sNkpFsLs4Wp8XfRp/" +
"11oPk3uTQB0ftHg1C16KRTBl+AbCzVaYfx6VFlJ7GL7Jme8bVOku8FKZL0eGgMVk4qhEnpZogNrtFU5yEyswJ+LbHOKsOPCn" +
"cT19LR+PfTgjN4CKCS5Es4LS+7nLt9hQ7ejwGQnEyxebOgJzlHjotWUACpoZsFkAgGqBeUDZAzB6h4N2MFCNhmIuFJMAgPsH" +
"eJr+iZEHAAA=";
// Create a new instance of the escher dumper
EscherDump dumper = new EscherDump();
// Decode the stream to bytes
byte[] bytes = RawDataUtil.decompress(recordData);
// Dump the contents of scher to screen.
dumper.dump(bytes, 0, bytes.length, nullPS);
dumper.dump(0, new byte[] {}, nullPS);
dumper.dump(new byte[] {}, 0, 0, nullPS);
}
@Test
public void testWithData() throws Exception {
new EscherDump().dumpOld(8, new ByteArrayInputStream(new byte[] {0, 0, 0, 0, 0, 0, 0, 0}), nullPS);
new EscherDump().dump(8, new byte[] {0, 0, 0, 0, 0, 0, 0, 0}, nullPS);
}
@Test

View File

@ -49,9 +49,10 @@ public final class TestEscherOptRecord {
assertEquals( (short) 0x0033, r.getOptions() );
assertEquals( (short) 0xF00B, r.getRecordId() );
assertEquals( 3, r.getEscherProperties().size() );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherComplexProperty prop2 = new EscherComplexProperty( (short) 1, false, new byte[] { 0x01, 0x02 } );
EscherBoolProperty prop3 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherComplexProperty prop2 = new EscherComplexProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, false, 2);
prop2.setComplexData(new byte[] { 0x01, 0x02 });
EscherBoolProperty prop3 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
assertEquals( prop1, r.getEscherProperty( 0 ) );
assertEquals( prop2, r.getEscherProperty( 1 ) );
assertEquals( prop3, r.getEscherProperty( 2 ) );
@ -71,9 +72,9 @@ public final class TestEscherOptRecord {
assertEquals( (short) 0x0033, r.getOptions() );
assertEquals( (short) 0xF00B, r.getRecordId() );
assertEquals( 3, r.getEscherProperties().size() );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296 );
EscherRGBProperty prop2 = new EscherRGBProperty( EscherProperties.FILL__FILLCOLOR, 0x08000009 );
EscherRGBProperty prop3 = new EscherRGBProperty( EscherProperties.LINESTYLE__COLOR, 0x08000040 );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 524296 );
EscherRGBProperty prop2 = new EscherRGBProperty( EscherPropertyTypes.FILL__FILLCOLOR, 0x08000009 );
EscherRGBProperty prop3 = new EscherRGBProperty( EscherPropertyTypes.LINESTYLE__COLOR, 0x08000040 );
assertEquals( prop1, r.getEscherProperty( 0 ) );
assertEquals( prop2, r.getEscherProperty( 1 ) );
assertEquals( prop3, r.getEscherProperty( 2 ) );
@ -91,9 +92,10 @@ public final class TestEscherOptRecord {
EscherOptRecord r = new EscherOptRecord();
r.setOptions( (short) 0x0033 );
r.setRecordId( (short) 0xF00B );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherComplexProperty prop2 = new EscherComplexProperty( (short) 1, false, new byte[] { 0x01, 0x02 } );
EscherBoolProperty prop3 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherComplexProperty prop2 = new EscherComplexProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, false, 2);
prop2.setComplexData(new byte[] { 0x01, 0x02 });
EscherBoolProperty prop3 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
r.addEscherProperty( prop1 );
r.addEscherProperty( prop2 );
r.addEscherProperty( prop3 );
@ -105,7 +107,7 @@ public final class TestEscherOptRecord {
"0B, F0, " +
"14, 00, 00, 00, " +
"BF, 00, 01, 00, 00, 00, " +
"01, 80, 02, 00, 00, 00, " +
"BF, 80, 02, 00, 00, 00, " +
"BF, 00, 01, 00, 00, 00, " +
"01, 02]";
assertEquals( dataStr, HexDump.toHex(data) );
@ -117,9 +119,9 @@ public final class TestEscherOptRecord {
EscherOptRecord r = new EscherOptRecord();
r.setOptions( (short) 0x0033 );
r.setRecordId( (short) 0xF00B );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherRGBProperty prop2 = new EscherRGBProperty( EscherProperties.FILL__FILLCOLOR, 0x08000009 );
EscherRGBProperty prop3 = new EscherRGBProperty( EscherProperties.LINESTYLE__COLOR, 0x08000040 );
EscherBoolProperty prop1 = new EscherBoolProperty( EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE, 1 );
EscherRGBProperty prop2 = new EscherRGBProperty( EscherPropertyTypes.FILL__FILLCOLOR, 0x08000009 );
EscherRGBProperty prop3 = new EscherRGBProperty( EscherPropertyTypes.LINESTYLE__COLOR, 0x08000040 );
r.addEscherProperty( prop1 );
r.addEscherProperty( prop2 );
r.addEscherProperty( prop3 );
@ -138,24 +140,31 @@ public final class TestEscherOptRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
EscherOptRecord r = new EscherOptRecord();
// don't try to shoot in foot, please -- vlsergey
// r.setOptions((short)0x000F);
r.setRecordId(EscherOptRecord.RECORD_ID);
EscherProperty prop1 = new EscherBoolProperty((short)1, 1);
EscherProperty prop1 = new EscherBoolProperty(EscherPropertyTypes.GEOMETRY__FILLOK, 1);
r.addEscherProperty(prop1);
String expected =
"org.apache.poi.ddf.EscherOptRecord (Opt):" + nl +
" RecordId: 0xF00B" + nl +
" Version: 0x0003" + nl +
" Instance: 0x0001" + nl +
" Options: 0x0013" + nl +
" Record Size: 14" + nl +
" isContainer: false" + nl +
" numchildren: 0x00000000" + nl +
" properties: 0x00000001" + nl +
" unknown: propNum: 1, RAW: 0x0001, propName: unknown, complex: false, blipId: false, value: 1 (0x00000001)";
"{ /* OPT */\n" +
"\t recordId: -4085 /* 0xf00b */\n" +
"\t, version: 3\n" +
"\t, instance: 1\n" +
"\t, options: 19 /* 0x0013 */\n" +
"\t, recordSize: 14 /* 0x0000000e */\n" +
"\t, isContainer: false\n" +
"\t, properties: [\n" +
"\n" +
"\t{ /* GEOMETRY__FILLOK */\n" +
"\t\t id: 383 /* 0x017f */\n" +
"\t\t, name: \"geometry.fillok\"\n" +
"\t\t, propertyNumber: 383 /* 0x017f */\n" +
"\t\t, propertySize: 6\n" +
"\t\t, flags: 0x17f /* */ \n" +
"\t\t, value: 1\n" +
"\t}]\n" +
"}";
assertEquals( expected, r.toString());
}
@ -255,7 +264,7 @@ public final class TestEscherOptRecord {
/**
* Test read/write against an OPT record from a real ppt file.
* In PowerPoint is is legal to have array properties with empty complex part.
* In PowerPoint it is legal to have array properties with empty complex part.
* In Glen's original implementation complex part is always 6 bytes which resulted
* in +6 extra bytes when writing back out. As the result the ppt becomes unreadable.
*
@ -295,7 +304,7 @@ public final class TestEscherOptRecord {
@Test
public void testEmptyArrayProperty() {
EscherOptRecord r = new EscherOptRecord();
EscherArrayProperty p = new EscherArrayProperty((short)(EscherProperties.FILL__SHADECOLORS + 0x8000), new byte[0] );
EscherArrayProperty p = new EscherArrayProperty(EscherPropertyTypes.FILL__SHADECOLORS, false, 0);
assertEquals(0, p.getNumberOfElementsInArray());
r.addEscherProperty(p);

View File

@ -31,22 +31,24 @@ public class TestEscherProperty {
*/
@Test
public void testPropertyNames() throws Exception {
EscherProperty p1 = new EscherSimpleProperty( EscherProperties.GROUPSHAPE__SHAPENAME, 0);
EscherProperty p1 = new EscherSimpleProperty( EscherPropertyTypes.GROUPSHAPE__SHAPENAME, 0);
assertEquals("groupshape.shapename", p1.getName());
assertEquals(EscherProperties.GROUPSHAPE__SHAPENAME, p1.getPropertyNumber());
assertEquals(EscherPropertyTypes.GROUPSHAPE__SHAPENAME.propNumber, p1.getPropertyNumber());
assertFalse(p1.isComplex());
EscherProperty p2 = new EscherComplexProperty(
EscherProperties.GROUPSHAPE__SHAPENAME, false, new byte[10]);
EscherComplexProperty p2 = new EscherComplexProperty(
EscherPropertyTypes.GROUPSHAPE__SHAPENAME, false, 10);
p2.setComplexData(new byte[10]);
assertEquals("groupshape.shapename", p2.getName());
assertEquals(EscherProperties.GROUPSHAPE__SHAPENAME, p2.getPropertyNumber());
assertEquals(EscherPropertyTypes.GROUPSHAPE__SHAPENAME.propNumber, p2.getPropertyNumber());
assertTrue(p2.isComplex());
assertFalse(p2.isBlipId());
EscherProperty p3 = new EscherComplexProperty(
EscherProperties.GROUPSHAPE__SHAPENAME, true, new byte[10]);
EscherComplexProperty p3 = new EscherComplexProperty(
EscherPropertyTypes.GROUPSHAPE__SHAPENAME, true, 10);
p2.setComplexData(new byte[10]);
assertEquals("groupshape.shapename", p3.getName());
assertEquals(EscherProperties.GROUPSHAPE__SHAPENAME, p3.getPropertyNumber());
assertEquals(EscherPropertyTypes.GROUPSHAPE__SHAPENAME.propNumber, p3.getPropertyNumber());
assertTrue(p3.isComplex());
assertTrue(p3.isBlipId());
}

View File

@ -57,18 +57,17 @@ public class TestEscherSpRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherSpRecord (Sp):" + nl +
" RecordId: 0xF00A" + nl +
" Version: 0x0002" + nl +
" Instance: 0x0000" + nl +
" Options: 0x0002" + nl +
" Record Size: 16" + nl +
" ShapeType: 0x0000" + nl +
" ShapeId: 0x00000400" + nl +
" Flags: GROUP|PATRIARCH (0x00000005)";
"{ /* SP */\n" +
"\t recordId: -4086 /* 0xf00a */\n" +
"\t, version: 2\n" +
"\t, instance: 0\n" +
"\t, options: 2\n" +
"\t, recordSize: 16 /* 0x00000010 */\n" +
"\t, shapeType: 0\n" +
"\t, shapeId: 1024 /* 0x00000400 */\n" +
"\t, flags: 0x5 /* GROUP | PATRIARCH */ \n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -63,18 +63,18 @@ public final class TestEscherSpgrRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherSpgrRecord (Spgr):" + nl +
" RecordId: 0xF009" + nl +
" Version: 0x0000" + nl +
" Instance: 0x0001" + nl +
" Options: 0x0010" + nl +
" Record Size: 24" + nl +
" RectX: 0x00000001" + nl +
" RectY: 0x00000002" + nl +
" RectWidth: 0x00000003" + nl +
" RectHeight: 0x00000004";
"{ /* SPGR */\n" +
"\t recordId: -4087 /* 0xf009 */\n" +
"\t, version: 0\n" +
"\t, instance: 1\n" +
"\t, options: 16 /* 0x0010 */\n" +
"\t, recordSize: 24 /* 0x00000018 */\n" +
"\t, rectX1: 1\n" +
"\t, rectY1: 2\n" +
"\t, rectX2: 3\n" +
"\t, rectY2: 4\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -63,18 +63,18 @@ public final class TestEscherSplitMenuColorsRecord {
@Test
public void testToString() {
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.EscherSplitMenuColorsRecord (SplitMenuColors):" + nl +
" RecordId: 0xF11E" + nl +
" Version: 0x0000" + nl +
" Instance: 0x0004" + nl +
" Options: 0x0040" + nl +
" Record Size: 24" + nl +
" Color1: 0x00000402" + nl +
" Color2: 0x00000002" + nl +
" Color3: 0x00000002" + nl +
" Color4: 0x00000001";
"{ /* SPLIT_MENU_COLORS */\n" +
"\t recordId: -3810 /* 0xf11e */\n" +
"\t, version: 0\n" +
"\t, instance: 4\n" +
"\t, options: 64 /* 0x0040 */\n" +
"\t, recordSize: 24 /* 0x00000018 */\n" +
"\t, color1: 1026 /* 0x00000402 */\n" +
"\t, color2: 2\n" +
"\t, color3: 2\n" +
"\t, color4: 1\n" +
"}";
assertEquals( expected, createRecord().toString() );
}

View File

@ -150,20 +150,15 @@ public final class TestUnknownEscherRecord {
r.setRecordId( (short) 0xF112 );
byte[] data = new byte[8];
r.serialize( 0, data, new NullEscherSerializationListener() );
String nl = System.getProperty("line.separator");
String expected =
"org.apache.poi.ddf.UnknownEscherRecord (Unknown 0xF112):" + nl +
" RecordId: 0xF112" + nl +
" Version: 0x0004" + nl +
" Instance: 0x0123" + nl +
" Options: 0x1234" + nl +
" Record Size: 8" + nl +
" isContainer: false" + nl +
" children: 0x00000000" + nl +
" Extra Data: " + nl +
" : 0";
"{ /* UNKNOWN */\n" +
"\t recordId: -3822 /* 0xf112 */\n" +
"\t, version: 4\n" +
"\t, instance: 291 /* 0x0123 */\n" +
"\t, options: 4660 /* 0x1234 */\n" +
"\t, recordSize: 8\n" +
"\t, data: \"\"\n" +
"}";
assertEquals(expected, r.toString() );
}
}

View File

@ -19,6 +19,7 @@ package org.apache.poi.hssf.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
@ -27,7 +28,16 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.List;
import org.apache.poi.ddf.*;
import org.apache.poi.ddf.EscherBoolProperty;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherDgRecord;
import org.apache.poi.ddf.EscherOptRecord;
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;
import org.apache.poi.ddf.EscherTextboxRecord;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.record.CommonObjectDataSubRecord;
import org.apache.poi.hssf.record.EscherAggregate;
@ -101,10 +111,10 @@ public class TestDrawingShapes {
EscherOptRecord opt = shape.getOptRecord();
assertEquals(7, opt.getEscherProperties().size());
assertTrue(((EscherBoolProperty) opt.lookup(EscherProperties.GROUPSHAPE__PRINT)).isTrue());
assertTrue(((EscherBoolProperty) opt.lookup(EscherProperties.LINESTYLE__NOLINEDRAWDASH)).isTrue());
assertEquals(0x00000004, ((EscherSimpleProperty) opt.lookup(EscherProperties.GEOMETRY__SHAPEPATH)).getPropertyValue());
assertNull(opt.lookup(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE));
assertNotEquals(((EscherSimpleProperty) opt.lookup(EscherPropertyTypes.GROUPSHAPE__FLAGS)).getPropertyValue(), 0);
assertTrue(((EscherBoolProperty) opt.lookup(EscherPropertyTypes.LINESTYLE__NOLINEDRAWDASH)).isTrue());
assertEquals(0x00000004, ((EscherSimpleProperty) opt.lookup(EscherPropertyTypes.GEOMETRY__SHAPEPATH)).getPropertyValue());
assertNull(opt.lookup(EscherPropertyTypes.TEXT__SIZE_TEXT_TO_FIT_SHAPE));
}
@Test
@ -153,7 +163,6 @@ public class TestDrawingShapes {
HSSFClientAnchor anchor = new HSSFClientAnchor(10, 10, 50, 50, (short) 2, 2, (short) 4, 4);
anchor.setAnchorType(AnchorType.MOVE_DONT_RESIZE);
assertEquals(AnchorType.MOVE_DONT_RESIZE, anchor.getAnchorType());
//noinspection deprecation
anchor.setAnchorType(AnchorType.MOVE_DONT_RESIZE);
assertEquals(AnchorType.MOVE_DONT_RESIZE, anchor.getAnchorType());
@ -175,10 +184,10 @@ public class TestDrawingShapes {
assertNotNull(escherContainer);
EscherRecord childById = escherContainer.getChildById(EscherOptRecord.RECORD_ID);
assertNotNull(childById);
EscherProperty lookup = ((EscherOptRecord) childById).lookup(EscherProperties.TEXT__TEXTID);
EscherProperty lookup = ((EscherOptRecord) childById).lookup(EscherPropertyTypes.TEXT__TEXTID);
assertNotNull(lookup);
assertEquals(((EscherSimpleProperty) lookup).getPropertyValue(), "teeeest".hashCode());
assertEquals(rectangle.isNoFill(), true);
assertTrue(rectangle.isNoFill());
assertEquals(rectangle.getWrapText(), HSSFSimpleShape.WRAP_NONE);
assertEquals(rectangle.getString().getString(), "teeeest");
@ -197,7 +206,7 @@ public class TestDrawingShapes {
assertEquals(anchor, rectangle2.getAnchor());
assertEquals(rectangle2.getLineStyleColor(), 1111);
assertEquals(rectangle2.getFillColor(), 777);
assertEquals(rectangle2.isNoFill(), true);
assertTrue(rectangle2.isNoFill());
assertEquals(rectangle2.getString().getString(), "teeeest");
assertEquals(rectangle.getWrapText(), HSSFSimpleShape.WRAP_NONE);
@ -229,7 +238,7 @@ public class TestDrawingShapes {
assertEquals(rectangle2.getAnchor().getDx2(), 3);
assertEquals(rectangle2.getAnchor().getDy1(), 4);
assertEquals(rectangle2.getAnchor().getDy2(), 5);
assertEquals(rectangle2.isNoFill(), false);
assertFalse(rectangle2.isNoFill());
assertEquals(rectangle2.getString().getString(), "test22");
HSSFSimpleShape rect3 = drawing.createSimpleShape(new HSSFClientAnchor());
@ -255,7 +264,7 @@ public class TestDrawingShapes {
assertEquals(picture.getFillColor(), 0x5DC943);
assertEquals(picture.getLineWidth(), HSSFShape.LINEWIDTH_DEFAULT);
assertEquals(picture.getLineStyle(), HSSFShape.LINESTYLE_DEFAULT);
assertEquals(picture.isNoFill(), false);
assertFalse(picture.isNoFill());
picture.setPictureIndex(2);
assertEquals(picture.getPictureIndex(), 2);
@ -272,7 +281,7 @@ public class TestDrawingShapes {
assertEquals(1, drawing.getChildren().size());
HSSFSimpleShape shape = (HSSFSimpleShape) drawing.getChildren().get(0);
assertEquals(shape.isNoFill(), false);
assertFalse(shape.isNoFill());
assertEquals(shape.getLineStyle(), HSSFShape.LINESTYLE_DASHDOTGEL);
assertEquals(shape.getLineStyleColor(), 0x616161);
assertEquals(HexDump.toHex(shape.getFillColor()), shape.getFillColor(), 0x2CE03D);
@ -332,10 +341,8 @@ public class TestDrawingShapes {
HSSFSheet sheet = wb.getSheetAt(0);
HSSFPatriarch patriarch = sheet.getDrawingPatriarch();
/**
* 2048 - main SpContainer id
* 2049 - existing shape id
*/
// 2048 - main SpContainer id
// 2049 - existing shape id
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 2050);
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 2051);
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 2052);
@ -343,10 +350,8 @@ public class TestDrawingShapes {
sheet = wb.getSheetAt(1);
patriarch = sheet.getDrawingPatriarch();
/**
* 3072 - main SpContainer id
* 3073 - existing shape id
*/
// 3072 - main SpContainer id
// 3073 - existing shape id
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 3074);
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 3075);
assertEquals(HSSFTestHelper.allocateNewShapeId(patriarch), 3076);
@ -617,13 +622,13 @@ public class TestDrawingShapes {
HSSFSimpleShape rectangle = patriarch.createSimpleShape(new HSSFClientAnchor());
rectangle.setShapeType(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE);
assertEquals(rectangle.isFlipVertical(), false);
assertEquals(rectangle.isFlipHorizontal(), false);
assertFalse(rectangle.isFlipVertical());
assertFalse(rectangle.isFlipHorizontal());
rectangle.setFlipVertical(true);
assertEquals(rectangle.isFlipVertical(), true);
assertTrue(rectangle.isFlipVertical());
rectangle.setFlipHorizontal(true);
assertEquals(rectangle.isFlipHorizontal(), true);
assertTrue(rectangle.isFlipHorizontal());
HSSFWorkbook wb2 = HSSFTestDataSamples.writeOutAndReadBack(wb1);
wb1.close();
@ -632,13 +637,13 @@ public class TestDrawingShapes {
rectangle = (HSSFSimpleShape) patriarch.getChildren().get(0);
assertEquals(rectangle.isFlipHorizontal(), true);
assertTrue(rectangle.isFlipHorizontal());
rectangle.setFlipHorizontal(false);
assertEquals(rectangle.isFlipHorizontal(), false);
assertFalse(rectangle.isFlipHorizontal());
assertEquals(rectangle.isFlipVertical(), true);
assertTrue(rectangle.isFlipVertical());
rectangle.setFlipVertical(false);
assertEquals(rectangle.isFlipVertical(), false);
assertFalse(rectangle.isFlipVertical());
HSSFWorkbook wb3 = HSSFTestDataSamples.writeOutAndReadBack(wb2);
wb2.close();
@ -647,8 +652,8 @@ public class TestDrawingShapes {
rectangle = (HSSFSimpleShape) patriarch.getChildren().get(0);
assertEquals(rectangle.isFlipVertical(), false);
assertEquals(rectangle.isFlipHorizontal(), false);
assertFalse(rectangle.isFlipVertical());
assertFalse(rectangle.isFlipHorizontal());
wb3.close();
}
@ -735,8 +740,7 @@ public class TestDrawingShapes {
@Test
public void testBug45312() throws Exception {
HSSFWorkbook wb = new HSSFWorkbook();
try {
try (HSSFWorkbook wb = new HSSFWorkbook()) {
HSSFSheet sheet = wb.createSheet();
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
@ -768,16 +772,7 @@ public class TestDrawingShapes {
shape1.setShapeType(HSSFSimpleShape.OBJECT_TYPE_LINE);
}
/*OutputStream stream = new FileOutputStream("/tmp/45312.xls");
try {
wb.write(stream);
} finally {
stream.close();
}*/
checkWorkbookBack(wb);
} finally {
wb.close();
}
}

View File

@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.apache.poi.ddf.EscherArrayProperty;
import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherPropertyTypes;
import org.apache.poi.ddf.EscherSpRecord;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.record.ObjRecord;
@ -85,16 +85,20 @@ public class TestPolygon {
polygon.setPolygonDrawArea( 100, 100 );
polygon.setPoints( new int[]{0, 90, 50, 90}, new int[]{5, 5, 44, 88} );
EscherArrayProperty verticesProp1 = polygon.getOptRecord().lookup(EscherProperties.GEOMETRY__VERTICES);
EscherArrayProperty verticesProp1 = polygon.getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__VERTICES);
String expected =
"<EscherArrayProperty id=\"0x8145\" name=\"geometry.vertices\" blipId=\"false\">"+
"<Element>[00, 00, 05, 00]</Element>"+
"<Element>[5A, 00, 05, 00]</Element>"+
"<Element>[32, 00, 2C, 00]</Element>"+
"<Element>[5A, 00, 58, 00]</Element>"+
"<Element>[00, 00, 05, 00]</Element>"+
"</EscherArrayProperty>";
"<record type=\"GEOMETRY__VERTICES\" id=\"-32443\" name=\"geometry.vertices\" propertyNumber=\"325\" propertySize=\"32\" numElements=\"5\" numElementsInMemory=\"5\" sizeOfElements=\"-16\">" +
"<flags flag=\"0x8145\" description=\"IS_COMPLEX\"/>" +
"<data>BQAFAPD/AAAFAFoABQAyACwAWgBYAAAABQA=</data>" +
"<elements>" +
"<item>>AAAFAA==</item>" +
"<item>>WgAFAA==</item>" +
"<item>>MgAsAA==</item>" +
"<item>>WgBYAA==</item>" +
"<item>>AAAFAA==</item>" +
"</elements>" +
"</record>";
String actual = verticesProp1.toXml("").replaceAll("[\r\n\t]","");
assertEquals(verticesProp1.getNumberOfElementsInArray(), 5);
@ -104,15 +108,18 @@ public class TestPolygon {
assertArrayEquals(polygon.getXPoints(), new int[]{1, 2, 3});
assertArrayEquals(polygon.getYPoints(), new int[]{4, 5, 6});
verticesProp1 = polygon.getOptRecord().lookup(EscherProperties.GEOMETRY__VERTICES);
verticesProp1 = polygon.getOptRecord().lookup(EscherPropertyTypes.GEOMETRY__VERTICES);
expected =
"<EscherArrayProperty id=\"0x8145\" name=\"geometry.vertices\" blipId=\"false\">" +
"<Element>[01, 00, 04, 00]</Element>" +
"<Element>[02, 00, 05, 00]</Element>" +
"<Element>[03, 00, 06, 00]</Element>" +
"<Element>[01, 00, 04, 00]</Element>" +
"</EscherArrayProperty>";
"<record type=\"GEOMETRY__VERTICES\" id=\"-32443\" name=\"geometry.vertices\" propertyNumber=\"325\" propertySize=\"28\" numElements=\"4\" numElementsInMemory=\"4\" sizeOfElements=\"-16\">" +
"<flags flag=\"0x8145\" description=\"IS_COMPLEX\"/>" +
"<data>BAAEAPD/AQAEAAIABQADAAYAAQAEAA==</data>" +
"<elements>" +
"<item>>AQAEAA==</item>" +
"<item>>AgAFAA==</item>" +
"<item>>AwAGAA==</item>" +
"<item>>AQAEAA==</item>" +
"</elements></record>";
actual = verticesProp1.toXml("").replaceAll("[\r\n\t]","");
assertEquals(verticesProp1.getNumberOfElementsInArray(), 4);
@ -261,7 +268,7 @@ public class TestPolygon {
EscherSpRecord spRecord = polygon1.getEscherContainer().getChildById(EscherSpRecord.RECORD_ID);
spRecord.setShapeType((short)77/**RANDOM**/);
spRecord.setShapeType((short)77/*RANDOM*/);
HSSFWorkbook wb3 = HSSFTestDataSamples.writeOutAndReadBack(wb2);
wb2.close();