diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-12-13 19:50:59 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-12-13 19:50:59 +0000 |
commit | b45765ff3c9cc5deed81c299a203b221af0dbb6d (patch) | |
tree | b68a5816dbab43cdf4247a87b2f805419b52c7d1 /src/java/org/apache/fop | |
parent | b9c18acdd094acfc29b4619b9785b19aa83d29e1 (diff) | |
download | xmlgraphics-fop-b45765ff3c9cc5deed81c299a203b221af0dbb6d.tar.gz xmlgraphics-fop-b45765ff3c9cc5deed81c299a203b221af0dbb6d.zip |
Bugzilla #37880:
Bugfix for lost footnotes in centered text.
Skip elements with no Position in TextLayoutManager.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@356594 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java | 6 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java index 29087b029..48a919896 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java @@ -79,7 +79,7 @@ public class FootnoteLayoutManager extends AbstractLayoutManager //Inline part of the footnote is empty. Need to send back an auxiliary //zero-width, zero-height inline box so the footnote gets painted. KnuthSequence seq = new KnuthSequence(true); - seq.add(new KnuthInlineBox(0, null, null, true)); + seq.add(new KnuthInlineBox(0, null, null, false)); returnedList.add(seq); } setFinished(true); @@ -106,7 +106,7 @@ public class FootnoteLayoutManager extends AbstractLayoutManager ListIterator nestedIterator = seq.listIterator(seq.size()); while (nestedIterator.hasPrevious() && lastBox == null) { KnuthElement element = (KnuthElement)nestedIterator.previous(); - if (element instanceof KnuthInlineBox) { + if (element instanceof KnuthInlineBox && !element.isAuxiliary()) { lastBox = (KnuthInlineBox) element; } } @@ -114,6 +114,8 @@ public class FootnoteLayoutManager extends AbstractLayoutManager } if (lastBox != null) { lastBox.setFootnoteBodyLM(bodyLM); + } else { + throw new IllegalStateException("No anchor box was found for a footnote."); } } diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index cbf798b03..f6de2e939 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -271,7 +271,9 @@ public class TextLayoutManager extends LeafNodeLayoutManager { */ while (posIter.hasNext()) { LeafPosition tbpNext = (LeafPosition) posIter.next(); - // + if (tbpNext == null) { + continue; //Ignore elements without Positions + } if (tbpNext.getLeafPos() != -1) { ai = (AreaInfo) vecAreaInfo.get(tbpNext.getLeafPos()); if (firstAreaInfoIndex == -1) { |