From 9ff780f79dafdfbd0a25d2dbb7721bb049ae9663 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Fri, 29 Aug 2008 20:12:34 +0000 Subject: [PATCH] Bugzilla 45667: avoid NullPointerExceptions during hyphenation for empty inlines. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@690382 13f79535-47bb-0310-9956-ffa450edef68 --- .../inline/InlineStackingLayoutManager.java | 3 +- status.xml | 4 ++ .../empty-inline_hyphenation_bug45667.xml | 49 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 test/layoutengine/hyphenation-testcases/empty-inline_hyphenation_bug45667.xml diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java index a27fc6516..963b98b37 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java @@ -334,7 +334,8 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager fromIndex = oldListIterator.previousIndex(); } else if (currLM == prevLM) { bSomethingChanged - = prevLM.applyChanges(oldList.subList(fromIndex, oldList.size())) + = (prevLM != null) + && prevLM.applyChanges(oldList.subList(fromIndex, oldList.size())) || bSomethingChanged; } else { bSomethingChanged diff --git a/status.xml b/status.xml index c5d699725..42d606538 100644 --- a/status.xml +++ b/status.xml @@ -53,6 +53,10 @@ + + Quick-fix to avoid a possible NullPointerException when using + empty inlines and hyphenation. + Added missing generation of areas for empty grid units in tables with collapsing border model. diff --git a/test/layoutengine/hyphenation-testcases/empty-inline_hyphenation_bug45667.xml b/test/layoutengine/hyphenation-testcases/empty-inline_hyphenation_bug45667.xml new file mode 100644 index 000000000..c66b10de9 --- /dev/null +++ b/test/layoutengine/hyphenation-testcases/empty-inline_hyphenation_bug45667.xml @@ -0,0 +1,49 @@ + + + + + +

+ This test checks for Bugzilla 45667: NPE thrown by an empty inline + in combination with hyphenate="true". +

+
+ + + + + + + + + + + + + + Some inline text formatting. + + + + + + +
-- 2.39.5