diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 09:56:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 09:56:23 +0000 |
commit | cc57f28d17c9ce04f02a2428c00b1463bd42cc0a (patch) | |
tree | 13adc983c1d40e87f4cb4a61a453fd68026fb377 /stoc | |
parent | 75f9926ecd485c349b5c66b8881aa5137aacde26 (diff) |
simplify this a bit
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/simpleregistry/simpleregistry.cxx | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index 123ed41de..2e98594f1 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -298,32 +298,43 @@ RegistryValueType SAL_CALL RegistryKeyImpl::getValueType( ) throw InvalidRegistryException( OUString( RTL_CONSTASCII_USTRINGPARAM("InvalidRegistryException") ), (OWeakObject *)this ); - } else - { - RegValueType type; - sal_uInt32 size; - - if (m_key.getValueInfo(OUString(), &type, &size)) - { - return RegistryValueType_NOT_DEFINED; - } else - { - switch (type) - { - case RG_VALUETYPE_LONG: return RegistryValueType_LONG; - case RG_VALUETYPE_STRING: return RegistryValueType_ASCII; - case RG_VALUETYPE_UNICODE: return RegistryValueType_STRING; - case RG_VALUETYPE_BINARY: return RegistryValueType_BINARY; - case RG_VALUETYPE_LONGLIST: return RegistryValueType_LONGLIST; - case RG_VALUETYPE_STRINGLIST: return RegistryValueType_ASCIILIST; - case RG_VALUETYPE_UNICODELIST: return RegistryValueType_STRINGLIST; - default: return RegistryValueType_NOT_DEFINED; - } - } } - - return RegistryValueType_NOT_DEFINED; -} + + RegValueType type; + sal_uInt32 size; + if (m_key.getValueInfo(OUString(), &type, &size)) + return RegistryValueType_NOT_DEFINED; + + RegistryValueType eRet = RegistryValueType_NOT_DEFINED; + switch (type) + { + case RG_VALUETYPE_LONG: + eRet = RegistryValueType_LONG; + break; + case RG_VALUETYPE_STRING: + eRet = RegistryValueType_ASCII; + break; + case RG_VALUETYPE_UNICODE: + eRet = RegistryValueType_STRING; + break; + case RG_VALUETYPE_BINARY: + eRet = RegistryValueType_BINARY; + break; + case RG_VALUETYPE_LONGLIST: + eRet = RegistryValueType_LONGLIST; + break; + case RG_VALUETYPE_STRINGLIST: + eRet = RegistryValueType_ASCIILIST; + break; + case RG_VALUETYPE_UNICODELIST: + eRet = RegistryValueType_STRINGLIST; + break; + default: + eRet = RegistryValueType_NOT_DEFINED; + break; + } + return eRet; +} //************************************************************************* sal_Int32 SAL_CALL RegistryKeyImpl::getLongValue( ) |