diff options
author | Simon Pepping <spepping@apache.org> | 2006-05-19 15:10:44 +0000 |
---|---|---|
committer | Simon Pepping <spepping@apache.org> | 2006-05-19 15:10:44 +0000 |
commit | 276670d6bbb7cf51f8f8365675335f4ac945209e (patch) | |
tree | 00c0da5e3a75f667f2ea7085929b2475a8228f02 /src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java | |
parent | 5db46401762875432068ec08a6558213b80d540f (diff) | |
download | xmlgraphics-fop-276670d6bbb7cf51f8f8365675335f4ac945209e.tar.gz xmlgraphics-fop-276670d6bbb7cf51f8f8365675335f4ac945209e.zip |
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 <max@berger.name>, 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
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java | 4 |
1 files changed, 3 insertions, 1 deletions
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(); |