summaryrefslogtreecommitdiff
path: root/configmgr/source/registry
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2001-03-02 14:52:25 +0000
committerOliver Bolte <obo@openoffice.org>2001-03-02 14:52:25 +0000
commit29abf46ad010ba3be60975fdbfc1de20a3d285cc (patch)
treef86aa764c203070738c8a3bf3a274b740d419a09 /configmgr/source/registry
parent30d7e25fe344b6b74012c56a1aad4f650a2a16a5 (diff)
Do not throw when getting Value of NULL value
Diffstat (limited to 'configmgr/source/registry')
-rw-r--r--configmgr/source/registry/cfgregistrykey.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/configmgr/source/registry/cfgregistrykey.cxx b/configmgr/source/registry/cfgregistrykey.cxx
index 4242b0c09d..9316f83910 100644
--- a/configmgr/source/registry/cfgregistrykey.cxx
+++ b/configmgr/source/registry/cfgregistrykey.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cfgregistrykey.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-02-23 10:39:30 $
+ * last change: $Author: obo $ $Date: 2001-03-02 15:52:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -165,6 +165,8 @@ namespace {
return true;
}
}
+// temporary helper
+inline static void checkNullable() {}
//==========================================================================
//= OConfigurationRegistryKey
@@ -1023,7 +1025,10 @@ Sequence< sal_Int32 > SAL_CALL OConfigurationRegistryKey::getLongListValue( ) t
Any aValue = implGetValue();
Sequence< sal_Int32 > aReturn;
- if (!(aValue >>= aReturn))
+ if (!aValue.hasValue())
+ checkNullable();// let NULL values pass
+
+ else if (!(aValue >>= aReturn))
{
// TODO : maybe it's a sequence of sal_Int8 or anything like that which we're able to convert ....
@@ -1087,7 +1092,10 @@ void SAL_CALL OConfigurationRegistryKey::setAsciiListValue( const Sequence< ::rt
Any aValue = implGetValue();
OUString sReturn;
- if (!(aValue >>= sReturn))
+ if (!aValue.hasValue())
+ checkNullable();// let NULL values pass
+
+ else if (!(aValue >>= sReturn))
throw InvalidValueException(UNISTRING("This node does not contain a string value."), THISREF());
return sReturn;
@@ -1109,7 +1117,10 @@ Sequence< ::rtl::OUString > SAL_CALL OConfigurationRegistryKey::getStringListVal
Any aValue = implGetValue();
Sequence< OUString > aReturn;
- if (!(aValue >>= aReturn))
+ if (!aValue.hasValue())
+ checkNullable();// let NULL values pass
+
+ else if (!(aValue >>= aReturn))
throw InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());
return aReturn;
@@ -1131,7 +1142,10 @@ Sequence< sal_Int8 > SAL_CALL OConfigurationRegistryKey::getBinaryValue( ) thro
Any aValue = implGetValue();
Sequence< sal_Int8 > aReturn;
- if (!(aValue >>= aReturn))
+ if (!aValue.hasValue())
+ checkNullable();// let NULL values pass
+
+ else if (!(aValue >>= aReturn))
return aReturn;
throw InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());