aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-02-27 03:21:59 +0000
committerGlen Mazza <gmazza@apache.org>2004-02-27 03:21:59 +0000
commitd0445ec2ecec867923743875dcadcaeed61d1984 (patch)
tree54ce66b49a10c9de65d12ff0c9a49dc5f15c2812
parent02cf7bed6dc6b9b34632c6b2305c47a0809760b1 (diff)
downloadxmlgraphics-fop-d0445ec2ecec867923743875dcadcaeed61d1984.tar.gz
xmlgraphics-fop-d0445ec2ecec867923743875dcadcaeed61d1984.zip
Some simplification of FOText object.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197383 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fo/FOText.java16
-rw-r--r--src/java/org/apache/fop/fo/FObjMixed.java2
2 files changed, 8 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java
index 5243c0560..67d0182e7 100644
--- a/src/java/org/apache/fop/fo/FOText.java
+++ b/src/java/org/apache/fop/fo/FOText.java
@@ -74,7 +74,6 @@ public class FOText extends FObj {
* the character array containing the text
*/
public char[] ca;
- public int start;
/**
* the length of the character array containing the text
@@ -121,17 +120,16 @@ public class FOText extends FObj {
*
* @param chars array of chars which contains the text in this object (may
* be a superset of the text in this object
- * @param s starting index into char[] for the text in this object
- * @param e ending index into char[] for the text in this object
+ * @param start starting index into char[] for the text in this object
+ * @param end ending index into char[] for the text in this object
* @param ti TextInfo object for the text in this object
* @param parent FONode that is the parent of this object
*/
- public FOText(char[] chars, int s, int e, TextInfo ti, FONode parent) {
+ public FOText(char[] chars, int start, int end, TextInfo ti, FONode parent) {
super(parent);
- this.start = 0;
- this.ca = new char[e - s];
- System.arraycopy(chars, s, ca, 0, e - s);
- this.length = e - s;
+ length = end - start;
+ this.ca = new char[length];
+ System.arraycopy(chars, start, ca, 0, length);
textInfo = ti;
createBlockPointers();
textTransform();
@@ -152,7 +150,7 @@ public class FOText extends FObj {
return true;
}
- for (int i = start; i < start + length; i++) {
+ for (int i = 0; i < length; i++) {
char ch = ca[i];
if (!((ch == ' ')
|| (ch == '\n')
diff --git a/src/java/org/apache/fop/fo/FObjMixed.java b/src/java/org/apache/fop/fo/FObjMixed.java
index 17b3e7abd..8d882b98d 100644
--- a/src/java/org/apache/fop/fo/FObjMixed.java
+++ b/src/java/org/apache/fop/fo/FObjMixed.java
@@ -87,7 +87,7 @@ public class FObjMixed extends FObj {
ft.setName("text");
/* characters() processing empty for FOTreeHandler, not empty for RTF & MIFHandlers */
- getFOTreeControl().getFOInputHandler().characters(ft.ca, ft.start, ft.length);
+ getFOTreeControl().getFOInputHandler().characters(ft.ca, 0, ft.length);
addChild(ft);
}