diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-14 19:11:13 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-14 19:11:13 +0100 |
commit | ac27218d0d423c99fed81f7726ef0bb10d67c14e (patch) | |
tree | a8046e11a6fad9af2487ec0c4c26969be1316f25 /registry/source | |
parent | 98ff20e30873c73ca8ba3995fd0c959a1b28fc78 (diff) | |
parent | 6e8628fb7374b7d19e15f03e63f8ad221ca25f1e (diff) |
rebase to DEV300_m69
Diffstat (limited to 'registry/source')
-rw-r--r-- | registry/source/keyimpl.cxx | 8 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 22 | ||||
-rw-r--r-- | registry/source/regimpl.hxx | 2 | ||||
-rw-r--r-- | registry/source/registry.cxx | 2 |
4 files changed, 26 insertions, 8 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 281c8e27cbf0..b41fbbb5ada9 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -365,7 +365,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -424,7 +424,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -492,7 +492,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -560,7 +560,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 8a4dd8b88ee9..b9edca734232 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -848,7 +848,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) { return REG_DELETE_KEY_FAILED; } - sFile.flush(); + //sFile.flush(); // set flag deleted !!! ((ORegKey*)hOldKey)->setDeleted(sal_True); @@ -894,7 +894,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey) { return REG_DELETE_VALUE_FAILED; } - ((OStoreFile&)pKey->getStoreFile()).flush(); + //((OStoreFile&)pKey->getStoreFile()).flush(); } _err = rStoreDir.next(iter); @@ -1065,7 +1065,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, { return REG_VALUE_NOT_EXISTS; } - pSourceKey->getStoreFile().flush(); + //pSourceKey->getStoreFile().flush(); pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); @@ -1137,7 +1137,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, rtl_freeMemory(pBuffer); return REG_INVALID_VALUE; } - rTargetFile.flush(); + //rTargetFile.flush(); if (rwBytes != nSize) { @@ -1482,6 +1482,20 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const return REG_NO_ERROR; } +RegError ORegistry::flush() +{ + REG_GUARD(m_mutex); + + if (m_file.isValid()) + { + m_file.flush(); + return REG_NO_ERROR; + } else + { + return REG_REGISTRY_NOT_EXISTS; + } +} + //********************************************************************* // dumpValue() diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index c32dcf3527df..32baf9cc6ed5 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -113,6 +113,8 @@ public: RegError dumpRegistry(RegKeyHandle hKey) const; + RegError flush(); + ~ORegistry(); sal_Bool isReadOnly() const diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index cb145b3910c2..139646f7cdc7 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -430,6 +430,8 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, */ _ret = pKey->closeKey(pNewKey); + if (_ret == REG_NO_ERROR ) + _ret = pReg->flush(); return _ret; } |