]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: remaining chunk of over-long text strings didn't get handled properly.
authorJeremias Maerki <jeremias@apache.org>
Tue, 6 Jan 2009 08:05:57 +0000 (08:05 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 6 Jan 2009 08:05:57 +0000 (08:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@731869 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/afp/modca/PresentationTextData.java

index 645a461d8ec720ababc620d9c10f4708d56950b1..d71f54687d0166776acb624854aefe8602348722 100644 (file)
@@ -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;