[Libreoffice-commits] help.git: help3xsl/online_transform.xsl

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 7 15:59:17 UTC 2018


 help3xsl/online_transform.xsl |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit f3124329e336603ba6684e913a61a58e7a202020
Author:     Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Fri Sep 7 10:31:49 2018 -0300
Commit:     Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Fri Sep 7 17:58:55 2018 +0200

    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 at libreoffice.org>

diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 70843b4c3..90b8a44a2 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>


More information about the Libreoffice-commits mailing list