]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed toc.line for FOP to align numbers
authorBob Stayton <bobs@sagehill.net>
Thu, 8 Aug 2002 09:07:10 +0000 (09:07 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 8 Aug 2002 09:07:10 +0000 (09:07 +0000)
by adding leader-pattern-width property
as suggested by Nicolas Nieswandt.  Was able to remove
the fop.extensions choose/when structure because
it works for all processors.  The numbers in fop
align left rather than right, but at least they
line up.

xsl/fo/autotoc.xsl

index 2230aaf7fc1f584e89429897635067f0ada2c539..da8c606a7c7877029d38f861000ff88f00aef957 100644 (file)
     <xsl:apply-templates select="." mode="label.markup"/>
   </xsl:variable>
 
-  <xsl:choose>
-    <xsl:when test="$fop.extensions != 0">
-      <fo:block text-align="start">
-        <fo:basic-link internal-destination="{$id}">
-          <fo:inline keep-with-next.within-line="always">
-            <xsl:apply-templates select="." mode="object.title.markup"/>
-          </fo:inline>
-          <fo:inline keep-together.within-line="always" font-style="italic">
-            <xsl:text>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</xsl:text>
-            <fo:page-number-citation ref-id="{$id}"/>
-            <xsl:text></xsl:text>
-          </fo:inline>
-        </fo:basic-link>
-      </fo:block>
-    </xsl:when>
-    <xsl:otherwise>
-      <fo:block text-align-last="justify"
-                end-indent="{$toc.indent.width}pt"
-                last-line-end-indent="-{$toc.indent.width}pt">
-        <fo:inline keep-with-next.within-line="always">
-          <fo:basic-link internal-destination="{$id}">
-            <xsl:if test="$label != ''">
-              <xsl:copy-of select="$label"/>
-              <xsl:value-of select="$autotoc.label.separator"/>
-            </xsl:if>
-            <xsl:apply-templates select="." mode="title.markup"/>
-          </fo:basic-link>
-        </fo:inline>
-        <fo:inline keep-together.within-line="always">
-          <xsl:text> </xsl:text>
-          <fo:leader leader-pattern="dots"
-                     keep-with-next.within-line="always"/>
-          <xsl:text> </xsl:text>
-          <fo:basic-link internal-destination="{$id}">
-            <fo:page-number-citation ref-id="{$id}"/>
-          </fo:basic-link>
-        </fo:inline>
-      </fo:block>
-    </xsl:otherwise>
-  </xsl:choose>
+  <fo:block text-align-last="justify"
+            end-indent="{$toc.indent.width}pt"
+            last-line-end-indent="-{$toc.indent.width}pt">
+    <fo:inline keep-with-next.within-line="always">
+      <fo:basic-link internal-destination="{$id}">
+        <xsl:if test="$label != ''">
+          <xsl:copy-of select="$label"/>
+          <xsl:value-of select="$autotoc.label.separator"/>
+        </xsl:if>
+        <xsl:apply-templates select="." mode="title.markup"/>
+      </fo:basic-link>
+    </fo:inline>
+    <fo:inline keep-together.within-line="always">
+      <xsl:text> </xsl:text>
+      <fo:leader leader-pattern="dots"
+                 leader-pattern-width="3pt"
+                 leader-alignment="reference-area"
+                 keep-with-next.within-line="always"/>
+      <xsl:text> </xsl:text> 
+      <fo:basic-link internal-destination="{$id}">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+    </fo:inline>
+  </fo:block>
 </xsl:template>
 
 <!-- ==================================================================== -->