Author: acumiskey
Date: Wed Nov 19 03:36:55 2008
New Revision: 718933
URL: http://svn.apache.org/viewvc?rev=718933&view=rev
Log:
Structured field length bug fix.
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java?rev=718933&r1=718932&r2=718933&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java
(original)
+++
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/afp/modca/ObjectAreaDescriptor.java
Wed Nov 19 03:36:55 2008
@@ -47,22 +47,21 @@
super(width, height, widthRes, heightRes);
}
- private static final byte oapId = 0x01;
+ private static final byte OBJECT_AREA_POSITION_ID = 0x01;
/** [EMAIL PROTECTED] */
public void writeToStream(OutputStream os) throws IOException {
- // add triplets
- addTriplet(new DescriptorPositionTriplet(oapId));
+ byte[] data = new byte[9];
+ copySF(data, Type.DESCRIPTOR, Category.OBJECT_AREA);
+
+ addTriplet(new DescriptorPositionTriplet(OBJECT_AREA_POSITION_ID));
addTriplet(new MeasurementUnitsTriplet(widthRes, heightRes));
addTriplet(new ObjectAreaSizeTriplet(width, height));
addTriplet(new PresentationSpaceResetMixingTriplet(
PresentationSpaceResetMixingTriplet.NOT_RESET));
- byte[] data = new byte[9];
- copySF(data, Type.DESCRIPTOR, Category.OBJECT_AREA);
-
int tripletDataLength = getTripletDataLength();
- byte[] len = BinaryUtils.convert(data.length + tripletDataLength, 2);
+ byte[] len = BinaryUtils.convert(data.length + tripletDataLength - 1,
2);
data[1] = len[0]; // Length
data[2] = len[1];
os.write(data);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]