From: Robert S. <bob...@us...> - 2005-03-08 07:48:51
|
Update of /cvsroot/docbook/xsl/fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9551 Modified Files: autotoc.xsl pagesetup.xsl titlepage.templates.xml Log Message: Fix problems introduced with $body.start.indent. FOP reverts back to using $title.margin.left. Index: autotoc.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/fo/autotoc.xsl,v retrieving revision 1.25 retrieving revision 1.26 diff -u -U2 -r1.25 -r1.26 --- autotoc.xsl 14 Feb 2005 13:22:47 -0000 1.25 +++ autotoc.xsl 8 Mar 2005 07:48:33 -0000 1.26 @@ -237,6 +237,9 @@ 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"/> @@ -263,5 +266,5 @@ <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::*)"/> @@ -270,6 +273,9 @@ 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"/> @@ -299,6 +305,9 @@ 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"/> @@ -331,6 +340,6 @@ <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::*)"/> @@ -339,6 +348,9 @@ 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"/> @@ -368,6 +380,9 @@ 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"/> @@ -400,6 +415,11 @@ 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"/> @@ -432,6 +452,11 @@ 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"/> @@ -464,6 +489,11 @@ 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"/> @@ -479,4 +509,29 @@ </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="."/> @@ -504,6 +559,11 @@ 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"/> Index: pagesetup.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/fo/pagesetup.xsl,v retrieving revision 1.54 retrieving revision 1.55 diff -u -U2 -r1.54 -r1.55 --- pagesetup.xsl 22 Jan 2005 06:29:45 -0000 1.54 +++ pagesetup.xsl 8 Mar 2005 07:48:33 -0000 1.55 @@ -2079,5 +2079,10 @@ <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 Index: titlepage.templates.xml =================================================================== RCS file: /cvsroot/docbook/xsl/fo/titlepage.templates.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -u -U2 -r1.23 -r1.24 --- titlepage.templates.xml 16 Dec 2003 00:30:49 -0000 1.23 +++ titlepage.templates.xml 8 Mar 2005 07:48:33 -0000 1.24 @@ -1029,4 +1029,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1058,4 +1059,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1087,4 +1089,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1116,4 +1119,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1145,4 +1149,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1174,4 +1179,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" @@ -1203,4 +1209,5 @@ space-after="0.5em" margin-left="{$title.margin.left}" + start-indent="0pt" font-size="&hsize3;" font-weight="bold" |