summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-05-15 22:03:02 +0200
committerAndras Timar <andras.timar@collabora.com>2017-05-30 10:19:44 +0200
commitd3c63ec1b1eb2d02902fe7086e061f2ef6c6fc7b (patch)
treebbd1d38d7ea5029ba3175f9034aac5a946b21f3f /filter
parent4784733ad3ae5637deaac35af607927344cc4b3d (diff)
tdf#107696: fix exports Heading style numbers
by taking into account text:is-list-header="true" (thank you for having pointing at this attribute of header Regina!) Change-Id: Ia0d9e0042e7ca3f31284c85f6b5336e1434bc0e6 Reviewed-on: https://gerrit.libreoffice.org/37655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit d67747c59c22e0346e13560810b9f3bf6c698428) Reviewed-on: https://gerrit.libreoffice.org/37661 Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 9b4c1e9d85445f4ddfb45359ad661d4826fe6a3c)
Diffstat (limited to 'filter')
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl12
1 files changed, 11 insertions, 1 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 7e9eb59734db..a8edf4b14167 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1416,14 +1416,24 @@
<xsl:param name="i" select="1"/>
<xsl:variable name="precedingoutlineLevel" select="preceding-sibling::text:h[$i]/@text:outline-level"/>
+ <!-- tdf#107696: if text:h has attribute "is-list-header" with "true" value, it mustn't be counted for numbering -->
+ <xsl:variable name="precedingoutlineLevel-is-list-header" select="preceding-sibling::text:h[$i][@text:is-list-header='true']/@text:outline-level"/>
<xsl:choose>
- <xsl:when test="$currentoutlineLevel = $precedingoutlineLevel">
+ <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and (not($precedingoutlineLevel-is-list-header)) ">
<xsl:call-template name="calc-heading-digit">
<xsl:with-param name="value" select="$value + 1"/>
<xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
<xsl:with-param name="i" select="$i + 1"/>
</xsl:call-template>
</xsl:when>
+ <!-- tdf#107696: case text:h has attribute "is-list-header" with "true" value, we don't increment value -->
+ <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and ($precedingoutlineLevel-is-list-header) ">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="$value"/>
+ <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
+ <xsl:with-param name="i" select="$i + 1"/>
+ </xsl:call-template>
+ </xsl:when>
<xsl:when test="$currentoutlineLevel &lt; $precedingoutlineLevel">
<xsl:call-template name="calc-heading-digit">
<xsl:with-param name="value" select="$value"/>