summaryrefslogtreecommitdiff
path: root/officecfg
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-17 23:15:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-18 08:47:28 +0200
commitd2799676584b51f66721717b69a5604cf4a65af8 (patch)
treec105106e6afda51f03f335c78f4a1d2a8a8bedff /officecfg
parentf2df50ab7c443932bf75be1795e93998c52d7575 (diff)
Find non-set-elements marked as mandatory
Change-Id: I7f75c835339b61ba9e545c13d7e5bb208c12df4c Reviewed-on: https://gerrit.libreoffice.org/53069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'officecfg')
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Impress.xcu4
-rw-r--r--officecfg/util/data_val.xsl13
2 files changed, 14 insertions, 3 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/Impress.xcu b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
index 72d2fb8b4155..b8323973c891 100644
--- a/officecfg/registry/data/org/openoffice/Office/Impress.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
@@ -195,12 +195,12 @@
<value oor:separator=";">vnd.sun.star.expand:$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/simpress/transitions.xml;vnd.sun.star.expand:$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/simpress/transitions-ogl.xml</value>
</prop>
</node>
- <node oor:name="Pictures" oor:op="fuse" oor:mandatory="true">
+ <node oor:name="Pictures" oor:op="fuse">
<prop oor:name="Path">
<value>$(work)</value>
</prop>
</node>
- <node oor:name="Sound" oor:op="fuse" oor:mandatory="true">
+ <node oor:name="Sound" oor:op="fuse">
<prop oor:name="Path">
<value>$(work)</value>
</prop>
diff --git a/officecfg/util/data_val.xsl b/officecfg/util/data_val.xsl
index 97508eb34a00..3e2200dbd526 100644
--- a/officecfg/util/data_val.xsl
+++ b/officecfg/util/data_val.xsl
@@ -48,6 +48,7 @@
<xsl:apply-templates select=".">
<xsl:with-param name="context" select="$component-schema/component/*[@oor:name = current()/@oor:name]"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="parent-schema-type" select="local-name($component-schema)"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
@@ -72,9 +73,11 @@
<xsl:choose>
<xsl:when test="$schema-type='node-ref'">
+ <xsl:variable name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
<xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
+ <xsl:with-param name="context" select="$context"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="parent-schema-type" select="local-name($context)"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$schema-type='set'">
@@ -82,6 +85,7 @@
<xsl:apply-templates select=".">
<xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="parent-schema-type" select="$schema-type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
@@ -99,6 +103,7 @@
<xsl:template match="node">
<xsl:param name = "context"/>
<xsl:param name = "component-schema"/>
+ <xsl:param name = "parent-schema-type"/>
<xsl:variable name = "path">
<xsl:call-template name="collectPath"/>
</xsl:variable>
@@ -139,6 +144,7 @@
<xsl:apply-templates select="." mode="extensible">
<xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="parent-schema-type" select="local-name($context)"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
@@ -147,10 +153,15 @@
<xsl:apply-templates select=".">
<xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="parent-schema-type" select="local-name($context)"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
+
+ <xsl:if test="@oor:mandatory='true' and $parent-schema-type!='set'">
+ <xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' that is not a set element is marked as mandatory!</xsl:message>
+ </xsl:if>
</xsl:template>
<!-- ****************************************** -->