diff options
author | Peter Jentsch <pjotr@guineapics.de> | 2012-11-25 20:45:52 +0100 |
---|---|---|
committer | Peter Jentsch <pjotr@guineapics.de> | 2012-11-25 21:32:24 +0100 |
commit | c8836e0b6d67ff7f4be04fe72ca9834fc5b5b0b7 (patch) | |
tree | 3bf84c53d5b698ad407c6ed759f3e437caa77d05 /filter | |
parent | a08f4a983de1170d9d2cc3490a392469886980cd (diff) |
fix: fdo#55610 - FILESAVE: CRASH when exporting particular .odt to XHTML
Change-Id: I2456f35a2aab9cefb11d2412c86ddaf06fc3afd4
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xslt/odf2xhtml/export/xhtml/header.xsl | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl index b4876a846eeb..556d31701d4f 100644 --- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl +++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl @@ -118,45 +118,21 @@ <xsl:template name="write-mapped-CSS-styles"> <xsl:param name="globalData" /> - <xsl:param name="styleNo" select="1"/> <xsl:param name="emptyStyles"/> - <xsl:choose> - <xsl:when test="$globalData/all-styles/style[$styleNo]"> - <!-- If there is still a style to be written --> - <!-- setting the context --> - <xsl:for-each select="$globalData/all-styles/style[$styleNo]"> - <xsl:choose> - <xsl:when test="final-properties != ''"> - <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous --> - <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>} + <xsl:for-each select="$globalData/all-styles/style"> + <xsl:if test="final-properties != ''"> + <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous --> + <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>} </xsl:text> - <xsl:call-template name="write-mapped-CSS-styles"> - <xsl:with-param name="globalData" select="$globalData" /> - <xsl:with-param name="emptyStyles" select="$emptyStyles"/> - <xsl:with-param name="styleNo" select="$styleNo + 1"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="write-mapped-CSS-styles"> - <xsl:with-param name="globalData" select="$globalData" /> - <xsl:with-param name="emptyStyles" select="concat($emptyStyles, '.', @style:name, ' ')"/> - <xsl:with-param name="styleNo" select="$styleNo + 1"/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> + </xsl:if> + + </xsl:for-each> <!-- Otherwise all styles have been processed and the empty styles have to be given out --> <xsl:comment> ODF styles with no properties representable as CSS </xsl:comment><xsl:text> - </xsl:text><xsl:value-of select="$emptyStyles"/><xsl:text>{ } - </xsl:text> - </xsl:otherwise> - </xsl:choose> + </xsl:text><xsl:for-each select="$globalData/all-styles/style[final-properties = '']"><xsl:value-of select="concat('.', @style:name, ' ')"/></xsl:for-each> { } </xsl:template> - <!-- Creating CSS page layout based on first office master style --> <xsl:template name='create-page-layout'> <xsl:param name="globalData" /> |