summaryrefslogtreecommitdiff
path: root/xmlhelp/util/main_transform.xsl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-26 17:55:14 +0100
committerAndras Timar <andras.timar@collabora.com>2015-10-29 13:08:59 +0100
commitd42d6dbfc6beac895ee778a1f30eab0435adf544 (patch)
treec4a119eb7c622568d8a4bbe3d8031d40137064aa /xmlhelp/util/main_transform.xsl
parent6dffbfbc3e98e82a951c6af6d44ae4f559343145 (diff)
tdf#75637: Resolve help images via a vnd.libreoffice.image UCP
...which uses the logic already available in VCL's ImplImageTree to locate the image zip files and find fallbacks for incomplete themes and for localized images. (cherry picked from commit 6948c546fdc00dddec7d58e03150dcc87921d6b2, plus f5174c89cd037d35b975590083cf91b36633808d "...but do not erase localize attributes from image elements," which is needed to make localized image references work again) Conflicts: vcl/osx/vclnsapp.mm Change-Id: Ic1c15fcacb6596a27a2b051093232902202bf472 Reviewed-on: https://gerrit.libreoffice.org/19644 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 74453dbed460c0c428ce989b07a65d5cac5db49a)
Diffstat (limited to 'xmlhelp/util/main_transform.xsl')
-rw-r--r--xmlhelp/util/main_transform.xsl53
1 files changed, 5 insertions, 48 deletions
diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl
index b6b9c2e6c76c..b30effe1ca94 100644
--- a/xmlhelp/util/main_transform.xsl
+++ b/xmlhelp/util/main_transform.xsl
@@ -99,7 +99,7 @@
<xsl:value-of select="translate($productversion,' ','')"/>
</xsl:variable>
<!-- this is were the images are -->
-<xsl:param name="imgrepos" select="''"/>
+<xsl:param name="imgtheme" select="''"/>
<xsl:param name="Id" />
<xsl:param name="Language" select="'en-US'"/>
<xsl:variable name="lang" select="$Language"/>
@@ -110,7 +110,7 @@
<!-- parts of help and image urls -->
<xsl:variable name="help_url_prefix" select="'vnd.sun.star.help://'"/>
-<xsl:variable name="img_url_prefix" select="concat('vnd.sun.star.zip://',$imgrepos,'/')"/>
+<xsl:variable name="img_url_prefix" select="concat('vnd.libreoffice.image://',$imgtheme,'/')"/>
<xsl:variable name="urlpost" select="concat('?Language=',$lang,$am,'System=',$System,$am,'UseDB=no')"/>
<xsl:variable name="urlpre" select="$help_url_prefix" />
<xsl:variable name="linkprefix" select="$urlpre"/>
@@ -801,19 +801,6 @@
<!-- Insert an image -->
<xsl:template name="insertimage">
-
- <xsl:variable name="fpath">
- <xsl:call-template name="getfpath">
- <xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="fname">
- <xsl:call-template name="getfname">
- <xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
<xsl:variable name="src">
<xsl:choose>
<xsl:when test="not($ExtensionId='') and starts-with(@src,$ExtensionId)">
@@ -821,11 +808,11 @@
</xsl:when>
<xsl:otherwise>
<xsl:choose>
- <xsl:when test="(@localize='true') and not($lang='en-US')">
- <xsl:value-of select="concat($img_url_prefix,$fpath,$lang,'/',$fname)"/>
+ <xsl:when test="@localize='true'">
+ <xsl:value-of select="concat($img_url_prefix,@src,'?lang=',$lang)"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="concat($img_url_prefix,$fpath,$fname)"/>
+ <xsl:value-of select="concat($img_url_prefix,@src)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
@@ -931,36 +918,6 @@
</xsl:choose>
</xsl:template>
-<xsl:template name="getfpath">
- <xsl:param name="s"/>
- <xsl:param name="p"/>
- <xsl:choose>
- <xsl:when test="contains($s,'/')">
- <xsl:call-template name="getfpath">
- <xsl:with-param name="p"><xsl:value-of select="concat($p,substring-before($s,'/'),'/')"/></xsl:with-param>
- <xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$p"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template name="getfname">
- <xsl:param name="s"/>
- <xsl:choose>
- <xsl:when test="contains($s,'/')">
- <xsl:call-template name="getfname">
- <xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$s"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
<xsl:template name="createDBpostfix">
<xsl:param name="archive"/>
<xsl:variable name="newDB">