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 | d9cd5a64cd16e4243fc7443fb5ebb974c2744a21 (patch) | |
tree | e5f8e78ebbee7ad8e47abdb68744ee05332c6bdc | |
parent | 11db8cce4928a6510341d97bb28d100068037987 (diff) |
simplify this a bit
-rw-r--r-- | stoc/source/simpleregistry/simpleregistry.cxx | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index f54a362b66ec..cb2de10fa327 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -298,31 +298,42 @@ 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; } //************************************************************************* |