tags 570095 + patch kthxbye I *believe* that normally fop omits empty fo:inline elements. However, in this case, fop can't do that, since the element in question has an id attribute, which might be referenced by something else.
As a consequence, in the failing function, currLM is null, where it would normally be non-null. However, a sanity check is missing, and therefore the code matches the currLM == prevLM condition (since they're both null) and prevLM has a method called on it. Boom. I don't really understand the fop code here very well, so I've basically had it punt if currLM is null: it simply moves onto the next iteration of the loop. My debugging leads me to believe that the length of oldList only ever has one element in this case, so this does not appear to break anything. I've tested with the DocBook 5 example, as well as an extended version that actually references the anchor, and both appear to result in PDFs that are acceptable to Evince. In the latter case, the link works correctly. It also, AFAICT, builds other PDFs correctly as well, so I'm not too terribly concerned about breakage. Patch is attached. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
diff -ur fop.old/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java fop-0.95.dfsg/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java --- fop.old/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2010-02-17 20:56:53.000000000 +0000 +++ fop-0.95.dfsg/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java 2010-02-17 21:00:00.000000000 +0000 @@ -331,6 +331,11 @@ while (oldListIterator.hasNext()) { oldElement = (KnuthElement) oldListIterator.next(); currLM = (InlineLevelLayoutManager) oldElement.getLayoutManager(); + // This can occur if a fo:inline element is empty but has an id + // attribute on it. Punt in that case. + if (currLM == null) { + continue; + } // initialize prevLM if (prevLM == null) { prevLM = currLM;
signature.asc
Description: Digital signature