From 276670d6bbb7cf51f8f8365675335f4ac945209e Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Fri, 19 May 2006 15:10:44 +0000 Subject: An emergency patch to avoid that a non-breaking space at the end of an fo:inline with padding, followed by another fo:inline, while text-align is justify, does not cause a NullPointerException due to InlineStackingLayoutManager.addALetterSpaceTo(). Patch submitted by Max Berger , applied with some modifications. This patch solves bug 39571. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@407819 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java') diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java index 0e48eb1ae..f66c0d119 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java @@ -140,7 +140,9 @@ public class InlineKnuthSequence extends KnuthSequence { addAll(((InlineLevelLayoutManager) prevBox.getLayoutManager()) .addALetterSpaceTo(oldList)); - if (((KnuthInlineBox) prevBox).isAnchor()) { + // prevBox may not be a KnuthInlineBox; + // this may happen if it is a padding box; see bug 39571. + if ( prevBox instanceof KnuthInlineBox && ((KnuthInlineBox) prevBox).isAnchor()) { // prevBox represents a footnote citation: copy footnote info // from prevBox to the new box KnuthInlineBox newBox = (KnuthInlineBox) getLast(); -- cgit v1.2.3