summaryrefslogtreecommitdiff
path: root/solenv/bin
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-16 21:39:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-16 21:43:12 +0100
commitb1d65c9f1535c9ef283d2a91a225359e5983f747 (patch)
tree9fa6c419d271067578f716167073e0121b9693c0 /solenv/bin
parent9630b973553c7db8e591adb34470228965f01491 (diff)
Allow setting environment value directly in .component files
...for internal loader="com.sun.star.loader.SharedLibrary" components, instead of exported component_getImplementationEnvironmen (or implicit CPPU_CURRENT_LANGUAGE_BINDING_NAME). Adapted a few .component files as proof- of-concept, more to follow. Change-Id: I82332e0a48e6fc1da245990bb72265fe6e58447e
Diffstat (limited to 'solenv/bin')
-rw-r--r--solenv/bin/createcomponent.xslt30
1 files changed, 30 insertions, 0 deletions
diff --git a/solenv/bin/createcomponent.xslt b/solenv/bin/createcomponent.xslt
index b6cb14187e76..4e20a2db1901 100644
--- a/solenv/bin/createcomponent.xslt
+++ b/solenv/bin/createcomponent.xslt
@@ -22,6 +22,7 @@
xmlns="http://openoffice.org/2010/uno-components"
xmlns:uc="http://openoffice.org/2010/uno-components">
<xsl:param name="uri"/>
+ <xsl:param name="cppu_env"/>
<xsl:strip-space elements="*"/>
<xsl:template match="uc:component">
<components>
@@ -40,7 +41,36 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
+ <xsl:template match="@environment">
+ <xsl:attribute name="environment">
+ <xsl:call-template name="replace">
+ <xsl:with-param name="input" select="current()"/>
+ <xsl:with-param name="pattern" select="'@CPPU_ENV@'"/>
+ <xsl:with-param name="replace" select="$cppu_env"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:template>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
+ <xsl:template name="replace">
+ <xsl:param name="input"/>
+ <xsl:param name="pattern"/>
+ <xsl:param name="replace"/>
+ <xsl:choose>
+ <xsl:when test="contains($input, $pattern)">
+ <xsl:value-of select="substring-before($input, $pattern)"/>
+ <xsl:value-of select="$replace"/>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="substring-after($input, $pattern)"/>
+ <xsl:with-param name="pattern" select="$pattern"/>
+ <xsl:with-param name="replace" select="$replace"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$input"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>