summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-08-10 17:35:19 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-08-11 08:36:45 +0200
commit46b4eb8b0e9325f8c29cd391baf9504bccee1837 (patch)
treef6ace8a387f3862b5b440274599e8ad61f91fa1a
parentf12b59d17c88def06828117904f8d3cc5adf6fec (diff)
tdf#111492 Honor ODF 1.2 style tab indentation in XHTML export
Change-Id: I9db61ed54b59b142d5198ec977044f7f52ba6b4d Reviewed-on: https://gerrit.libreoffice.org/40981 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl30
1 files changed, 7 insertions, 23 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index d638f6294ad9..124411bfa639 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1273,32 +1273,16 @@
</xsl:attribute>
<xsl:element name="span">
- <!-- outline style 'text:min-label-distance' is interpreted as a CSS 'margin-right' attribute
+ <!-- Convert the "label-followed-by" to margins. According to ODF, possible values are: 'listtab', 'space', and 'nothing'.
+ 'space' seems not to be written out by LO, and for 'nothing' we obviously need do nothing.
NOTE: Should be handled as CSS style in style header -->
- <xsl:variable name="minLabelDistance" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/*/@text:min-label-distance"/>
- <xsl:variable name="minLabelWidth" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/*/@text:min-label-width"/>
+ <xsl:variable name="currentOutlineLevel" select="@text:outline-level"/>
+ <xsl:variable name="labelFollowedBy" select="$globalData//office:document/office:styles/text:outline-style/text:outline-level-style[@text:level = $currentOutlineLevel]/style:list-level-properties[@text:list-level-position-and-space-mode='label-alignment']/style:list-level-label-alignment/@text:label-followed-by"/>
- <xsl:if test="$minLabelDistance | $minLabelWidth">
+ <!-- Add some margin (a tab is around 0.64cm in LO), but only if there is a number preceding the heading. -->
+ <xsl:if test="$labelFollowedBy='listtab' and $headingNumber != ''">
<xsl:attribute name="style">
- <xsl:if test="$minLabelDistance">
- <xsl:text>margin-right:</xsl:text>
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$minLabelDistance"/>
- </xsl:call-template>
- <xsl:text>cm;</xsl:text>
- </xsl:if>
- <xsl:if test="$minLabelWidth">
- <xsl:text>display:block;float:</xsl:text>
- <xsl:call-template name="getOppositeWritingDirection">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
- </xsl:call-template>;
- <xsl:text>min-width:</xsl:text>
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$minLabelWidth"/>
- </xsl:call-template>
- <xsl:text>cm;</xsl:text>
- </xsl:if>
+ <xsl:text>margin-right:0.64cm;</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$headingNumber"/>