From a384db0b1c91bf7f75c5ce8cf8ca621b18206e1e Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Tue, 6 Apr 2004 22:50:44 +0000 Subject: [PATCH] Comments added. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197492 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FOText.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index ad203a5ab..37a032d20 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -443,6 +443,14 @@ public class FOText extends FObj { private class TextCharIterator extends AbstractCharIterator { private int curIndex = 0; + + /* Current space removal process: just increment the startIndex + to "remove" leading spaces from ca, until an unremoved character + is found. Then perform arraycopy's to remove extra spaces + between words. nextCharCalled is used to determine if an + unremoved character has already been found--if its value > 2 + than it means that has occurred (it is reset to zero each time we + remove a space via incrementing the startIndex.) */ private int nextCharCalled = 0; public boolean hasNext() { @@ -476,7 +484,8 @@ public class FOText extends FObj { // System.out.println("removeB: " + new String(ca, startIndex, endIndex - startIndex)); } else if (curIndex == endIndex) { // System.out.println("removeC: " + new String(ca, startIndex, endIndex - startIndex)); - curIndex = --endIndex; + endIndex--; + curIndex--; } } -- 2.39.5