summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Wang <fred.wang@free.fr>2013-07-06 15:57:42 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2013-07-09 09:03:16 +0000
commitfb2edd686c8b8ba4318e957f7cf23060ffd3e2c3 (patch)
tree365bee997d9bc2104a0925f00a4378ebc4369a51
parent6e2815a0ffdb5811f220978734354b1033801927 (diff)
fdo#66645 XHTML export: ignore incorrect style on math objects
Change-Id: Ied09a189184380aa3eba30261c7517f6bccf6d09 Reviewed-on: https://gerrit.libreoffice.org/4751 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl22
1 files changed, 19 insertions, 3 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index e83195c50cda..2dada31591ad 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1068,6 +1068,23 @@
<xsl:value-of select="$elem-name"/>' is a draw:frame.
</xsl:comment>
<xsl:element name="{$elem-name}">
+ <xsl:choose>
+ <xsl:when test="draw:object/math:math">
+ <!-- draw:frame elements contain many data that are not
+ relevant for mathematical formulas and that may
+ cause incorrect rendering. Let's ignore the
+ replacement image and keep only the id attribute.
+ See fdo#66645 -->
+ <xsl:apply-templates select="@draw:name"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="draw:object[1]"/>
+ <!-- TODO: do not always add a space after the formula,
+ for example when it is followed by a comma, period,
+ dash etc This will probably require using regexp
+ features like xsl:analyze-string -->
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
<xsl:attribute name="style">
<xsl:call-template name="widthAndHeight"/>
<xsl:text> padding:0; </xsl:text>
@@ -1090,6 +1107,8 @@
<xsl:apply-templates select="node()">
<xsl:with-param name="globalData" select="$globalData"/>
</xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
</xsl:template>
@@ -2969,7 +2988,4 @@
<xsl:apply-templates select="*[1]" mode="math"/>
</xsl:template>
- <!-- Ignore the replacement image -->
- <xsl:template match="draw:frame/draw:image[preceding-sibling::*[1]/math:math]"/>
-
</xsl:stylesheet>