summaryrefslogtreecommitdiff
path: root/help3xsl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-09-07 10:31:49 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-09-07 17:58:55 +0200
commitf3124329e336603ba6684e913a61a58e7a202020 (patch)
tree7cdf9e80638320988cde7d748c536fc58fde6121 /help3xsl
parentcaa4981835ffce40ba409f05435a5ecc08be80b6 (diff)
Prepare to handle native SVG icons
Today icons are PNG images, if later they become SVG natively... Change-Id: I42d886257b55b5676767c8b8879a6bf35eb4d5e6 Reviewed-on: https://gerrit.libreoffice.org/60156 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r--help3xsl/online_transform.xsl12
1 files changed, 11 insertions, 1 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 70843b4c36..90b8a44a25 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -1089,7 +1089,17 @@
<img src="{$src2}" alt="{$alt}" title="{$alt}" height="{$height}" width="{$width}">
<xsl:if test="ancestor::tablecell">
<xsl:attribute name="class"><xsl:value-of select="'imageicon'"/></xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="concat(substring-before($src2,'.png'),'.svg')"/></xsl:attribute>
+ <xsl:attribute name="src">
+ <!--Check if icon is already svg-->
+ <xsl:choose>
+ <xsl:when test="substring($src2,string-length($src2) - 3, 4)='.png'">
+ <xsl:value-of select="concat(substring-before($src2,'.png'),'.svg')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$src2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
</xsl:if>
</img>
</xsl:template>