]> granicus.if.org Git - docbook-dsssl/commitdiff
Replace literal space inserted next to fo:leader in ToC with a padding. This
authorAlexey Neyman <stilor@att.net>
Sat, 19 Oct 2013 00:45:49 +0000 (00:45 +0000)
committerAlexey Neyman <stilor@att.net>
Sat, 19 Oct 2013 00:45:49 +0000 (00:45 +0000)
works around a bug in FOP (see FOP-1444).
Make ToC fo:leader properties configurable via attribute set.

xsl/fo/autotoc.xsl
xsl/fo/param.ent
xsl/fo/param.xweb
xsl/fo/toc.xsl
xsl/params/toc.leader.properties.xml [new file with mode: 0644]

index 45c63c4fcd3b61820128e6811c0e724b0adf89ed..543cc139e69fb2cd1907ebcca7e4650979b8025b 100644 (file)
       </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:leader xsl:use-attribute-sets="toc.leader.properties"/>
       <fo:basic-link internal-destination="{$id}">
         <fo:page-number-citation ref-id="{$id}"/>
       </fo:basic-link>
       </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:leader xsl:use-attribute-sets="toc.leader.properties"/>
       <fo:basic-link internal-destination="{$id}">
         <fo:page-number-citation ref-id="{$id}"/>
       </fo:basic-link>
index 43f3d615daaafb9b38a4bf98980fa14bbf7b0f83..c8eb6b699a7b2c10635166795f3a328808f8e54b 100644 (file)
 <!ENTITY title.font.family SYSTEM "../params/title.font.family.xml">
 <!ENTITY title.margin.left SYSTEM "../params/title.margin.left.xml">
 <!ENTITY toc.indent.width SYSTEM "../params/toc.indent.width.xml">
+<!ENTITY toc.leader.properties SYSTEM "../params/toc.leader.properties.xml">
 <!ENTITY toc.margin.properties SYSTEM "../params/toc.margin.properties.xml">
 <!ENTITY toc.max.depth SYSTEM "../params/toc.max.depth.xml">
 <!ENTITY toc.section.depth SYSTEM "../params/toc.section.depth.xml">
index 89501faaa225ac6da8e4666fc8e67ad331921bfb..8bdd9ce9b2ac5b1ea01beffac73fecf963d55f52 100644 (file)
@@ -86,6 +86,7 @@ $Id$
 &toc.max.depth;
 &toc.indent.width;
 &toc.line.properties;
+&toc.leader.properties;
 &toc.margin.properties;
 &bridgehead.in.toc;
 &simplesect.in.toc;
@@ -893,6 +894,7 @@ around all these parameters.</para>
 <src:fragref linkend="title.margin.left.frag"/>
 <src:fragref linkend="toc.indent.width.frag"/>
 <src:fragref linkend="toc.line.properties.frag"/>
+<src:fragref linkend="toc.leader.properties.frag"/>
 <src:fragref linkend="toc.margin.properties.frag"/>
 <src:fragref linkend="toc.max.depth.frag"/>
 <src:fragref linkend="toc.section.depth.frag"/>
index 8ca82330e19104d57274fe86c9a6bbd58f4f6307..287e2bf9a1a5e6bbff798eac00cdcd0b84b8b357 100644 (file)
     <xsl:choose>
       <xsl:when test="@linkend">
         <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:leader xsl:use-attribute-sets="toc.leader.properties"/>
           <fo:basic-link internal-destination="{@linkend}">
             <xsl:choose>
               <xsl:when test="@pagenum">
       </xsl:when>
       <xsl:when test="@pagenum">
         <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:leader xsl:use-attribute-sets="toc.leader.properties"/>
           <xsl:value-of select="@pagenum"/>
         </fo:inline>
       </xsl:when>
-      <xsl:otherwise>
-        <!-- just the leaders, what else can I do? -->
-        <fo:inline keep-together.within-line="always">
-          <xsl:text> </xsl:text>
-          <fo:leader leader-pattern="space"
-                     keep-with-next.within-line="always"/>
-        </fo:inline>
-      </xsl:otherwise>
     </xsl:choose>
   </fo:block>
 </xsl:template>
diff --git a/xsl/params/toc.leader.properties.xml b/xsl/params/toc.leader.properties.xml
new file mode 100644 (file)
index 0000000..94213f1
--- /dev/null
@@ -0,0 +1,31 @@
+<refentry xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude"
+          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+          version="5.0" xml:id="toc.leader.properties">
+<refmeta>
+<refentrytitle>toc.leader.properties</refentrytitle>
+<refmiscinfo class="other" otherclass="datatype">attribute set</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>toc.leader.properties</refname>
+<refpurpose>How the leaders (rows of dots) are going to look like in ToC?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment xml:id="toc.leader.properties.frag">
+<xsl:attribute-set name="toc.leader.properties">
+  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
+  <xsl:attribute name="leader-pattern-width">3pt</xsl:attribute>
+  <xsl:attribute name="leader-alignment">reference-area</xsl:attribute>
+  <xsl:attribute name="padding-left">3pt</xsl:attribute>
+  <xsl:attribute name="padding-right">3pt</xsl:attribute>
+</xsl:attribute-set>
+</src:fragment>
+</refsynopsisdiv>
+<refsection><info><title>Description</title></info>
+<para>Specify leader pattern, </para>
+</refsection>
+</refentry>
+