xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lfur...@apache.org
Subject svn commit: r321084 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
Date Fri, 14 Oct 2005 12:20:41 GMT
Author: lfurini
Date: Fri Oct 14 05:20:25 2005
New Revision: 321084

URL: http://svn.apache.org/viewcvs?rev=321084&view=rev
Log:
Fixing a ClassCastException due to the incorrect "pattern" of elements representing a space
checked when there are inline borders and padding.

Maybe not very elegant ... but at least it works; as Manuel suggested, the removal of trailing
spaces should maybe happen somewhere else.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=321084&r1=321083&r2=321084&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
Fri Oct 14 05:20:25 2005
@@ -296,8 +296,14 @@
                 removedElements = new LinkedList();
                 inlineLM = (InlineLevelLayoutManager)
                     ((KnuthElement) this.get(this.size() - 1)).getLayoutManager();
-                if (effectiveAlignment == EN_CENTER) {
-                    // centered text: the pattern is
+                if (effectiveAlignment == EN_CENTER
+                    || this.size() > 6
+                       && ((KnuthElement) this.get(this.size() - 6)).isGlue()
+                       && ((KnuthElement) this.get(this.size() - 5)).isPenalty()
+                       && ((KnuthElement) this.get(this.size() - 4)).isGlue()
+                       && ((KnuthElement) this.get(this.size() - 3)).isBox()
+                       && ((KnuthElement) this.get(this.size() - 2)).isPenalty())
{
+                    // centered text (or text with inline borders and padding): the pattern
is
                     //     <glue> <penaly> <glue> <box> <penaly>
<glue>
                     removedElements.addFirst((KnuthGlue) this.remove(this.size() - 1));
                     removedElements.addFirst((KnuthPenalty) this.remove(this.size() - 1));



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message