]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix fo output for segmented lists with more than one <segtitle> (see r9001, reverted...
authorDaniel Leidert <dleidert@debian.org>
Mon, 16 May 2011 17:26:31 +0000 (17:26 +0000)
committerDaniel Leidert <dleidert@debian.org>
Mon, 16 May 2011 17:26:31 +0000 (17:26 +0000)
Bug report and patch from: http://bugs.debian.org/620556

xsl/fo/lists.xsl

index 8153c1ca2741497a166eea33b0f77fdf74ce107d..6b30df8f52d81b1ad945a32cfd6857bcc3e3e9be 100644 (file)
 <xsl:template match="segmentedlist" mode="seglist-table">
   <xsl:apply-templates select="title" mode="list.title.mode" />
   <fo:table table-layout="fixed">
-    <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
-    <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
+    <xsl:call-template name="segmentedlist.table.columns">
+      <xsl:with-param name="cols" select="count(segtitle)"/>
+    </xsl:call-template>
     <fo:table-header start-indent="0pt" end-indent="0pt">
       <fo:table-row>
         <xsl:apply-templates select="segtitle" mode="seglist-table"/>
   </fo:table>
 </xsl:template>
 
+<xsl:template name="segmentedlist.table.columns">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="curcol" select="1"/>
+
+  <fo:table-column column-number="{$curcol}"
+                   column-width="proportional-column-width(1)"/>
+  <xsl:if test="$curcol &lt; $cols">
+    <xsl:call-template name="segmentedlist.table.columns">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="curcol" select="$curcol+1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template match="segtitle" mode="seglist-table">
   <fo:table-cell>
     <fo:block font-weight="bold">