From: Jeremias Maerki Date: Tue, 30 Aug 2005 12:57:44 +0000 (+0000) Subject: Fix for ClassCastException as shown in text-align2 (Reported by Lawrence Michel). X-Git-Tag: fop-0_90-alpha1~307 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7c11b556c2e1dbe2dfe6c1978b1c9e17afb43bdf;p=xmlgraphics-fop.git Fix for ClassCastException as shown in text-align2 (Reported by Lawrence Michel). 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 --- diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index e294908a8..f5a19c08f 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -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 // 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 // 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()) {