From 4dbd4bd6aacc9d6265c7a234aff6501d67e49876 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 17 May 2007 09:36:24 +0000 Subject: [PATCH] Bugfix for ClassCastException with spaces inside a table-cell (using fox:widow/orphan-content-limit) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@538849 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/ElementListUtils.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java index 1166482a9..08450db98 100644 --- a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java +++ b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java @@ -143,10 +143,15 @@ public class ElementListUtils { 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; -- 2.39.5