summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-12-04 09:58:20 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-12-04 15:24:28 +0100
commitc6f3a5375a59f9982626f601897249398bab11bf (patch)
tree79b8df530128ceb441836602607d40df94ef8806 /filter
parent4e8f20a5c2731f3aecffa515dc73a3fc071af6d6 (diff)
xhtml export: Prefer svg if it's available
And not use the replacement graphic in this case. Change-Id: I5e1bb7a694f210e2681ff5acf241a131d38a4c5d Reviewed-on: https://gerrit.libreoffice.org/45782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit aa768bdbfd7442947cf0756f58c9bfe791ce047a) Reviewed-on: https://gerrit.libreoffice.org/45801
Diffstat (limited to 'filter')
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl10
1 files changed, 6 insertions, 4 deletions
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 9719932fcf2d..78d4117b1a84 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1483,10 +1483,12 @@
<xsl:template match="draw:image | draw:object-ole">
<xsl:param name="globalData"/>
- <!-- If there is a replacement graphic, we take it.
- It is a png which browsers are more likely able to render than the original graphic
- which might have arbitrary formats. -->
- <xsl:if test="not(following-sibling::draw:image)">
+ <!-- If there is a replacement graphic, we take it (only exception is if the main image is svg).
+ The replacement graphic is a png which browsers are more likely able to render than the
+ original graphic which might have arbitrary formats. -->
+ <xsl:if test="(@loext:mime-type = 'image/svg+xml') or
+ (not(following-sibling::draw:image) and
+ not(preceding-sibling::draw:image[1]/@loext:mime-type = 'image/svg+xml'))">
<xsl:choose>
<xsl:when test="ancestor::text:p or parent::text:span or parent::text:h or parent::draw:a or parent::text:a or text:ruby-base">
<!-- XHTML does not allow the mapped elements to contain paragraphs -->