From: Jeremias Maerki Date: Tue, 6 Jan 2009 08:05:57 +0000 (+0000) Subject: Bugfix: remaining chunk of over-long text strings didn't get handled properly. X-Git-Tag: fop-1_0~115^2~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f6768c2460e3bd6f99b60fa296e0f1a4919e2ce5;p=xmlgraphics-fop.git Bugfix: remaining chunk of over-long text strings didn't get handled properly. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@731869 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/afp/modca/PresentationTextData.java index 645a461d8..d71f54687 100644 --- a/src/java/org/apache/fop/afp/modca/PresentationTextData.java +++ b/src/java/org/apache/fop/afp/modca/PresentationTextData.java @@ -25,6 +25,7 @@ import java.io.OutputStream; import java.io.UnsupportedEncodingException; import org.apache.commons.io.output.ByteArrayOutputStream; + import org.apache.fop.afp.AFPLineDataInfo; import org.apache.fop.afp.AFPTextDataInfo; import org.apache.fop.afp.util.BinaryUtils; @@ -321,13 +322,13 @@ public class PresentationTextData extends AbstractAFPObject { byte[] buff = new byte[TRANSPARENT_MAX_SIZE]; int currIndex = 0; for (int transDataCnt = 0; transDataCnt < numTransData; transDataCnt++) { - currIndex = transDataCnt * TRANSPARENT_MAX_SIZE; System.arraycopy(data, currIndex, buff, 0, TRANSPARENT_MAX_SIZE); addTransparentData(buff, afpdata); + currIndex += TRANSPARENT_MAX_SIZE; } - int remainingTransData = data.length / TRANSPARENT_MAX_SIZE; - buff = new byte[remainingTransData]; - System.arraycopy(data, currIndex, buff, 0, remainingTransData); + int left = data.length - currIndex; + buff = new byte[left]; + System.arraycopy(data, currIndex, buff, 0, left); addTransparentData(buff, afpdata); } currentX = -1;