[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - 2 commits - filter/source

Julien Nabet serval2412 at yahoo.fr
Fri May 26 10:54:01 UTC 2017


 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 6ee4771aff5d756f45014b88aebbcfb25b5cadfe
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed May 17 00:13:18 2017 +0200

    Related tdf#107696: deal with non empty header without number
    
    See first case of https://bugs.documentfoundation.org/show_bug.cgi?id=107696#c11
    
    Change-Id: Ic76301cb10ae891901be7dd5a385356c1cc0523b
    Reviewed-on: https://gerrit.libreoffice.org/37694
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 296c2296f5565556eea9fab51563050f28bbcafc)
    Reviewed-on: https://gerrit.libreoffice.org/37792
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index a8edf4b14167..34bb181db569 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1222,7 +1222,7 @@
 		<!-- writing out a heading number if desired.-->
 		<!-- if a corresponding 'text:outline-style' exist or is not empty -->
 		<xsl:choose>
-			<xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-format != ''">
+			<xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-format != '' and not(@text:is-list-header='true')">
 
 				<!-- Every heading element will get an unique anchor for its file, from its hiearchy level and name:
 					 For example:  The heading title 'My favorite heading' might get <a name="1_2_2_My_favorite_heading" /> -->
commit 9b4c1e9d85445f4ddfb45359ad661d4826fe6a3c
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon May 15 22:03:02 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit d67747c59c22e0346e13560810b9f3bf6c698428)
    Reviewed-on: https://gerrit.libreoffice.org/37661
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

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 < $precedingoutlineLevel">
 				<xsl:call-template name="calc-heading-digit">
 					<xsl:with-param name="value" select="$value"/>


More information about the Libreoffice-commits mailing list