]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix for ClassCastException as shown in text-align2 (Reported by Lawrence Michel).
authorJeremias Maerki <jeremias@apache.org>
Tue, 30 Aug 2005 12:57:44 +0000 (12:57 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 30 Aug 2005 12:57:44 +0000 (12:57 +0000)
Wrong alignment was taken to remove trailing spaces.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@264773 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

index e294908a8d2876d74446625ed6a32839127bdcda..f5a19c08fff963ceddb5e3196c2dd8a1e96e6202 100644 (file)
@@ -279,7 +279,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
             KnuthElement removedElement;
             while (this.size() > ignoreAtStart
                    && ((KnuthElement) this.get(this.size() - 1)).isGlue()) {
-                if (textAlignment == EN_CENTER) {
+                if (textAlignmentLast == EN_CENTER) {
                     // centered text: the pattern is
                     //     <glue> <penaly> <glue> <box> <penaly> <glue>
                     removedElement = (KnuthGlue) this.remove(this.size() - 1);
@@ -288,7 +288,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
                     removedElement = (KnuthGlue) this.remove(this.size() - 1);
                     removedElement = (KnuthPenalty) this.remove(this.size() - 1);
                     removedElement = (KnuthGlue) this.remove(this.size() - 1);
-                } else if (textAlignment == EN_START || textAlignment == EN_END) {
+                } else if (textAlignmentLast == EN_START || textAlignmentLast == EN_END) {
                     // left- or right-aligned text: the pattern is
                     //     <glue> <penalty> <glue>
                     removedElement = (KnuthGlue) this.remove(this.size() - 1);
@@ -1411,7 +1411,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager
                     break;
                 }
             }
-
             // collect word fragments, ignoring auxiliary elements;
             // each word fragment was created by a different TextLM
             if (firstElement.isBox() && !firstElement.isAuxiliary()) {