]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix problems introduced with $body.start.indent. FOP reverts
authorBob Stayton <bobs@sagehill.net>
Tue, 8 Mar 2005 07:48:33 +0000 (07:48 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 8 Mar 2005 07:48:33 +0000 (07:48 +0000)
back to using $title.margin.left.

xsl/fo/autotoc.xsl
xsl/fo/pagesetup.xsl
xsl/fo/titlepage.templates.xml

index b6d3afab5f88eef858a0d3473345b4f215d7994f..beea4c364c7d739c72dc0794924ced2939c0568f 100644 (file)
   <xsl:if test="$toc.section.depth > 0 
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{count(ancestor::*)*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+
       <xsl:apply-templates select="$nodes" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
 
   <xsl:variable name="nodes" select="chapter|appendix|preface|reference|
                                      refentry|article|index|glossary|
-                                    bibliography"/>
+                                     bibliography"/>
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
   <xsl:if test="$toc.section.depth > 0 
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{count(ancestor::*)*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+      
       <xsl:apply-templates select="$nodes" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:if test="$toc.section.depth > 0
                 and $toc.max.depth > $depth.from.context
                 and refentry">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{count(ancestor::*)*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="refentry" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:call-template name="toc.line"/>
 
   <xsl:variable name="nodes" select="section|sect1
-                                    |simplesect[$simplesect.in.toc != 0]
-                                    |refentry"/>
+                                     |simplesect[$simplesect.in.toc != 0]
+                                     |refentry"/>
 
   <xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
   <xsl:if test="$toc.section.depth > 0 
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{count(ancestor::*)*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="$nodes" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:if test="$toc.section.depth > 1 
                 and $toc.max.depth > $depth.from.context
                 and sect2">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{count(ancestor::*)*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent"/>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="sect2" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:if test="$toc.section.depth > 2 
                 and $toc.max.depth > $depth.from.context
                 and sect3">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{$reldepth*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent">
+          <xsl:with-param name="reldepth" select="$reldepth"/>
+        </xsl:call-template>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="sect3" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:if test="$toc.section.depth > 3 
                 and $toc.max.depth > $depth.from.context
                 and sect4">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{$reldepth*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent">
+          <xsl:with-param name="reldepth" select="$reldepth"/>
+        </xsl:call-template>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="sect4" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:if test="$toc.section.depth > 4 
                 and $toc.max.depth > $depth.from.context
                 and sect5">
-    <fo:block id="toc.{$cid}.{$id}"
-              start-indent="{$reldepth*$toc.indent.width}pt">
+    <fo:block id="toc.{$cid}.{$id}">
+      <xsl:attribute name="margin-left">
+        <xsl:call-template name="set.toc.indent">
+          <xsl:with-param name="reldepth" select="$reldepth"/>
+        </xsl:call-template>
+      </xsl:attribute>
+              
       <xsl:apply-templates select="sect5" mode="toc">
         <xsl:with-param name="toc-context" select="$toc-context"/>
       </xsl:apply-templates>
   <xsl:call-template name="toc.line"/>
 </xsl:template>
 
+<xsl:template name="set.toc.indent">
+  <xsl:param name="reldepth"/>
+
+  <xsl:variable name="depth">
+    <xsl:choose>
+      <xsl:when test="$reldepth != ''">
+        <xsl:value-of select="$reldepth"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="count(ancestor::*)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
+       <xsl:value-of select="concat($depth*$toc.indent.width, 'pt')"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="concat($toc.indent.width, 'pt')"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
 <xsl:template match="section" mode="toc">
   <xsl:param name="toc-context" select="."/>
 
     <xsl:if test="$toc.section.depth > $depth 
                   and $toc.max.depth > $depth.from.context
                   and section">
-      <fo:block id="toc.{$cid}.{$id}"
-                start-indent="{$reldepth*$toc.indent.width}pt">
+      <fo:block id="toc.{$cid}.{$id}">
+        <xsl:attribute name="margin-left">
+          <xsl:call-template name="set.toc.indent">
+            <xsl:with-param name="reldepth" select="$reldepth"/>
+          </xsl:call-template>
+        </xsl:attribute>
+                
         <xsl:apply-templates select="section" mode="toc">
           <xsl:with-param name="toc-context" select="$toc-context"/>
         </xsl:apply-templates>
index 6eb8421f9e12388e0277a3e5055519d4cfc5202a..52321fa06bf20612dc021fa433ef019c4c36df86 100644 (file)
   <!-- Customize this template to set attributes on fo:flow -->
 
   <xsl:choose>
+    <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
+      <!-- body.start.indent does not work well with these processors -->
+    </xsl:when>
     <xsl:when test="$master-reference = 'body' or
+                    $master-reference = 'lot' or
+                    $master-reference = 'front' or
                     $element = 'preface' or
                     ($master-reference = 'back' and
                     $element = 'appendix')">
index 4943d6b6fd8d06f10b92fcaa2caebd59ce441f15..0d26a89f81eabeee5f38701f3837506343121316 100644 (file)
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>
              space-before.maximum="2em"
             space-after="0.5em"
             margin-left="{$title.margin.left}"
+            start-indent="0pt"
             font-size="&hsize3;"
             font-weight="bold"
             font-family="{$title.fontset}"/>