diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-05-27 19:05:53 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-05-27 19:05:53 +0000 |
commit | a567b5af74fc4c36f81cecc0d1e1a0044b9939bc (patch) | |
tree | 9850a545da861012b4ccf3b4cd69bd524312ba9f /src | |
parent | f8b0abd875bc7562e640c2a56c53db0765261527 (diff) | |
download | xmlgraphics-fop-a567b5af74fc4c36f81cecc0d1e1a0044b9939bc.tar.gz xmlgraphics-fop-a567b5af74fc4c36f81cecc0d1e1a0044b9939bc.zip |
Obsolete code removed and text-transform behaviour changed based on input from Victor Mote: http://marc.theaimsgroup.com/?t=111718934800001&r=1&w=2
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198698 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/fo/FOText.java | 114 |
1 files changed, 2 insertions, 112 deletions
diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index 0beca3791..ec86ef867 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -24,8 +24,6 @@ import java.util.NoSuchElementException; // FOP import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.ColorType; -import org.apache.fop.fo.flow.Block; -import org.apache.fop.fo.pagination.Root; import org.apache.fop.fo.properties.CommonFont; import org.apache.fop.fo.properties.CommonHyphenation; import org.apache.fop.fo.properties.CommonTextDecoration; @@ -82,33 +80,6 @@ public class FOText extends FONode { private int wrapOption; // End of property values - /** - * Keeps track of the last FOText object created within the current - * block. This is used to create pointers between such objects. - * TODO: As soon as the control hierarchy is straightened out, this static - * variable needs to become an instance variable in some parent object, - * probably the page-sequence. - */ - private static FOText lastFOTextProcessed = null; - - /** - * Points to the previous FOText object created within the current - * block. If this is "null", this is the first such object. - */ - private FOText prevFOTextThisBlock = null; - - /** - * Points to the next FOText object created within the current - * block. If this is "null", this is the last such object. - */ - private FOText nextFOTextThisBlock = null; - - /** - * Points to the ancestor Block object. This is used to keep track of - * which FOText nodes are descendants of the same block. - */ - private Block ancestorBlock = null; - /** Holds the text decoration values. May be null */ private CommonTextDecoration textDecoration; @@ -150,7 +121,6 @@ public class FOText extends FONode { } protected void startOfNode() { - createBlockPointers(); textTransform(); } @@ -188,42 +158,6 @@ public class FOText extends FONode { return new TextCharIterator(); } - /** - * This method is run as part of the Constructor, to create xref pointers to - * the previous FOText objects within the same Block - */ - private void createBlockPointers() { - // build pointers between the FOText objects withing the same Block - // - // find the ancestorBlock of the current node - FONode ancestorFONode = this; - while (this.ancestorBlock == null) { - ancestorFONode = ancestorFONode.parent; - Class myclass = ancestorFONode.getClass(); - if (ancestorFONode instanceof org.apache.fop.fo.pagination.Title) { - return; - } else if (ancestorFONode instanceof Root) { - getLogger().warn("Unexpected: fo:text with no fo:block ancestor"); - return; - } else if (ancestorFONode instanceof Block) { - this.ancestorBlock = (Block)ancestorFONode; - } - } - // if the last FOText is a sibling, point to it, and have it point here - if (lastFOTextProcessed != null) { - if (lastFOTextProcessed.ancestorBlock == this.ancestorBlock) { - prevFOTextThisBlock = lastFOTextProcessed; - prevFOTextThisBlock.nextFOTextThisBlock = this; - } else { - prevFOTextThisBlock = null; - } - } - // save the current node in static field so the next guy knows where - // to look - lastFOTextProcessed = this; - return; - } - /** * This method is run as part of the Constructor, to handle the * text-transform property. @@ -299,54 +233,9 @@ public class FOText extends FONode { // The easy case is where the desired character is in the same FOText if (((i + offset) >= 0) && ((i + offset) <= this.endIndex)) { return ca[i + offset]; - } - // For now, we can't look at following FOText nodes - if (offset > 0) { + } else { return '\u0000'; } - // Remaining case has the text in some previous FOText node - boolean foundChar = false; - char charToReturn = '\u0000'; - FOText nodeToTest = this; - int remainingOffset = offset + i; - while (!foundChar) { - if (nodeToTest.prevFOTextThisBlock == null) { - foundChar = true; - break; - } - nodeToTest = nodeToTest.prevFOTextThisBlock; - if ((nodeToTest.endIndex + remainingOffset) >= 0) { - charToReturn = nodeToTest.ca[nodeToTest.endIndex + remainingOffset]; - foundChar = true; - } else { - remainingOffset = remainingOffset + nodeToTest.endIndex; - } - } - return charToReturn; - } - - /** - * @return The previous FOText node in this Block; null, if this is the - * first FOText in this Block. - */ - public FOText getPrevFOTextThisBlock () { - return prevFOTextThisBlock; - } - - /** - * @return The next FOText node in this Block; null if this is the last - * FOText in this Block; null if subsequent FOText nodes have not yet been - * processed. - */ - public FOText getNextFOTextThisBlock () { - return nextFOTextThisBlock; - } - - /** - * @return The nearest ancestor block object which contains this FOText. - */ - public Block getAncestorBlock () { - return ancestorBlock; } /** @@ -576,6 +465,7 @@ public class FOText extends FONode { return textDecoration; } + /** @see java.lang.Object#toString() */ public String toString() { StringBuffer sb = new StringBuffer(super.toString()); sb.append(" (").append(ca).append(")"); |