diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-30 12:19:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-30 12:27:47 +0100 |
commit | e8bb827571f540ac4af2247cb11239bb96876669 (patch) | |
tree | 24a7ee39d336a476c88f76f533fb292d5fdd9332 /officecfg/registry/cppheader.xsl | |
parent | dc6953f932ffbddd5168f039e58075789b91b98b (diff) |
Fixed cppheader.xsl nillable treatment.
* cppheader.xsl had initially been written under the false assumption that a
missing oor:nillable attribute defaults to "false" instead of "true". That has
been fixed.
* As a result, many places that use the new simplified officecfg/*.hxx headers
broke as they did not expect value types to be wrapped boost::optional. To keep
the code simple, I decided to change all occurrences in
officecfg/registry/schema/ of properties that specify a default <value> and do
not explicitly specify oor:nillable="true" to oor:nillable="false". Strictly
speaking, this is an incompatible change, but in many cases it should be what
was intended, anyway.
* Some places that use the new simplified officecfg/*.hxx headers still had to
be adapted to boost::optional wrapping.
* This showed that unotools/configuration.hxx did not yet work for those wrapped
properties and needed fixing, too.
Diffstat (limited to 'officecfg/registry/cppheader.xsl')
-rw-r--r-- | officecfg/registry/cppheader.xsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/officecfg/registry/cppheader.xsl b/officecfg/registry/cppheader.xsl index 2522aca68d5d..85ccafcf18d9 100644 --- a/officecfg/registry/cppheader.xsl +++ b/officecfg/registry/cppheader.xsl @@ -95,7 +95,8 @@ <xsl:text>#include "sal/config.h"
</xsl:text> <xsl:text>
</xsl:text> <xsl:if test=".//prop or .//set"> - <xsl:if test=".//prop/@oor:nillable = 'true'"> + <xsl:if + test=".//prop[count(@oor:nillable) = 0 or @oor:nillable = 'true']"> <xsl:text>#include "boost/optional.hpp"
</xsl:text> </xsl:if> <xsl:if test=".//prop/@oor:type = 'oor:any'"> @@ -215,7 +216,7 @@ <xsl:text><</xsl:text> <xsl:value-of select="$name"/> <xsl:text>, </xsl:text> - <xsl:if test="@oor:nillable = 'true'"> + <xsl:if test="not(@oor:nillable = 'false')"> <xsl:text>boost::optional<</xsl:text> </xsl:if> <xsl:choose> @@ -266,7 +267,7 @@ -->com::sun::star::uno::Sequence<sal_Int8> > </xsl:text> </xsl:when> </xsl:choose> - <xsl:if test="@oor:nillable = 'true'"> + <xsl:if test="not(@oor:nillable = 'false')"> <xsl:text>> </xsl:text> </xsl:if> <xsl:text>> {
</xsl:text> |