diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-04-04 16:01:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-04-04 16:01:51 +0100 |
commit | e9e3bdfe8cd7b04455faa61b9c1f8215fafae7cd (patch) | |
tree | a2483a19a97d7a7959a1cddf0f7f363a34b7e22f | |
parent | d099a280f8df3f07b45f6d23a2785580ef8e9c4f (diff) |
WaE: rework to avoid warnings
-rw-r--r-- | registry/source/regimpl.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 77cce3bc1589..cfb867f1eb88 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -468,6 +468,7 @@ ORegistry::~ORegistry() // RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMode) { + RegError eRet = REG_INVALID_REGISTRY; OStoreFile rRegFile; storeAccessMode sAccessMode = REG_MODE_OPEN; storeError errCode; @@ -475,8 +476,8 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo if (accessMode & REG_CREATE) { sAccessMode = REG_MODE_CREATE; - } else - if (accessMode & REG_READONLY) + } + else if (accessMode & REG_READONLY) { sAccessMode = REG_MODE_OPENREAD; m_readOnly = sal_True; @@ -496,17 +497,21 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo { switch (errCode) { - case store_E_NotExists: - return REG_REGISTRY_NOT_EXISTS; + case store_E_NotExists: + eRet = REG_REGISTRY_NOT_EXISTS; + break; case store_E_LockingViolation: - return REG_CANNOT_OPEN_FOR_READWRITE; + eRet = REG_CANNOT_OPEN_FOR_READWRITE; + break; default: - return REG_INVALID_REGISTRY; + eRet = REG_INVALID_REGISTRY; + break; } - } else + } + else { OStoreDirectory rStoreDir; - storeError _err = rStoreDir.create(rRegFile, OUString(), OUString(), sAccessMode); + storeError _err = rStoreDir.create(rRegFile, OUString(), OUString(), sAccessMode); if ( _err == store_E_None ) { @@ -515,14 +520,13 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo m_isOpen = sal_True; m_openKeyTable[ROOT] = new ORegKey(ROOT, this); - return REG_NO_ERROR; - } else - return REG_INVALID_REGISTRY; + eRet = REG_NO_ERROR; + } + else + eRet = REG_INVALID_REGISTRY; } - // this line is never accessed - // just workaround to avoid warning: control reaches end of non-void function - return REG_INVALID_REGISTRY; + return eRet; } |