You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/05/17 11:36:25 UTC

svn commit: r538849 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java

Author: jeremias
Date: Thu May 17 02:36:24 2007
New Revision: 538849

URL: http://svn.apache.org/viewvc?view=rev&rev=538849
Log:
Bugfix for ClassCastException with spaces inside a table-cell (using fox:widow/orphan-content-limit)

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

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java?view=diff&rev=538849&r1=538848&r2=538849
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java Thu May 17 02:36:24 2007
@@ -143,10 +143,15 @@
                     i.add(new KnuthPenalty(0, KnuthPenalty.INFINITE, false, 
                             null, false));
                 }
-            } else if (el instanceof BreakElement) {
-                BreakElement breakEl = (BreakElement)el;
-                if (breakEl.getPenaltyValue() < KnuthPenalty.INFINITE) {
-                    breakEl.setPenaltyValue(KnuthPenalty.INFINITE);
+            } else if (el.isUnresolvedElement()) {
+                if (el instanceof BreakElement) {
+                    BreakElement breakEl = (BreakElement)el;
+                    if (breakEl.getPenaltyValue() < KnuthPenalty.INFINITE) {
+                        breakEl.setPenaltyValue(KnuthPenalty.INFINITE);
+                    }
+                } else if (el instanceof UnresolvedListElementWithLength) {
+                    UnresolvedListElementWithLength uel = (UnresolvedListElementWithLength)el;
+                    len += uel.getLength().opt;
                 }
             } else {
                 KnuthElement kel = (KnuthElement)el;



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