Bug 32671 - "fo:text with no fo:block ancestor" when using fo:title
Summary: "fo:text with no fo:block ancestor" when using fo:title
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-13 19:59 UTC by Bj
Modified: 2012-04-01 06:48 UTC (History)
0 users



Attachments
Test file to trigger the bug (583 bytes, text/plain)
2004-12-13 20:02 UTC, Bj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bj 2004-12-13 19:59:27 UTC
When using <fo:title>foo</fo:title> (which seems perfectly legal), FOP dies with
a NullPointerException after giving the message "Unexpected: fo:text with no
fo:block ancestor".

The exception is raised in
org.apache.fop.fo.FOText.createBlockPointers(FOText.java:199), which tries to
find a fo:block ancestor, gives the "Unexpected" message when it reaches Root,
and then loops back and gets a NullPointerException.

Inserting a "break;" after the "Unexpected" message instead gives a
ClassCastException at
org.apache.fop.layoutmgr.ContentLayoutManager.addChildLM(ContentLayoutManager.java:287),
where it tries to add an org.apache.fop.layoutmgr.InlineStackingLayoutManager,
which isn't an InlineLevelLayoutManager.

I'll add an attachment with sample code.
Comment 1 Bj 2004-12-13 20:02:01 UTC
Created attachment 13746 [details]
Test file to trigger the bug

Use:
./fop.sh frotz.fo frotz.pdf
Comment 2 Simon Pepping 2004-12-22 19:23:40 UTC
This is only a rough solution: leaders, external graphics, page numbers cause
null pointer exceptions.
Comment 3 Glenn Adams 2012-04-01 06:48:11 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed