Hi all,
Using trunk revision 412972 from June 9th (0.92beta) I get a
ClassCastException in the ListBlockLayoutManager.java line 286. I made
a patch for my local copy to avoid the crash but now the list items
don't come out. Any possibility of a real patch/fix? Tia,
This function
public boolean mustKeepTogether() {
//TODO Keeps will have to be more sophisticated sooner or later
return ((BlockLevelLayoutManager)getParent()).mustKeepTogether()
|| !getListBlockFO().getKeepTogether().getWithinPage().isAuto()
|| !getListBlockFO().getKeepTogether().getWithinColumn().isAuto();
}
fails because the getParent() returns an InlineLayoutManager,
not a block level layout manager.
The stylesheet that fails takes xml like
<ul>
<li>NA </li>
<li>B </li>
<li>C</li>
<li>D/li>
<li>E</li>
</ul>
and tries to convert to a list-block (obviously :-). I made the function
look like all the other ones and got rid of the
((BlockLevelLayoutManager)getParent()).mustKeepTogether() in order to
have it not fail.
Would you like any further information? I wouldn't be surprised if the
stylesheet is bad but I couldn't see how. The relevant portion of the
stylesheet is
<xsl:template match="*[local-name() = 'ul']">
<fo:list-block provisional-distance-between-starts="0.125in"
provisional-label-separation="0.125cm"
space-after="2pt"
margin-left="0.5cm">
<xsl:apply-templates select="*"/>
</fo:list-block>
</xsl:template>
<xsl:template match="*[local-name() = 'li' and
parent::*[local-name() = 'ul']]">
<xsl:variable name="listType"
select="parent::*[local-name() = 'ul']/@type"/>
<xsl:variable name="listLabel">
<xsl:choose>
<xsl:when
test="$listType = 'dash'">-</xsl:when>
<xsl:when
test="$listType =
'circle'">*</xsl:when>
<xsl:otherwise>*</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:value-of select="$listLabel"/></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="*|text()"/></fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
Here's the top of the stacktrace:
java.lang.ClassCastException
at
org.apache.fop.layoutmgr.list.ListBlockLayoutManager.mustKeepTogether
(ListBlockLayoutManager.java:286)
at
org.apache.fop.layoutmgr.list.ListItemLayoutManager.mustKeepTogether(List
ItemLayoutManager.java:622)
at
org.apache.fop.layoutmgr.list.ListItemContentLayoutManager.mustKeepTogeth
er(ListItemContentLayoutManager.java:240)
at
org.apache.fop.layoutmgr.BlockLayoutManager.mustKeepTogether(BlockLayoutM
anager.java:205)
-arturo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]