diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 08:05:58 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 08:05:58 +0000 |
commit | 4ca5c503bc36f0300bb3f3ec1577ed41df098ab2 (patch) | |
tree | 0e6a4a4fddafd0cafd18601f5345e371c7fe1f99 /registry/source | |
parent | c490a9f0684dd5cc7efd897afbf70e2f73444f72 (diff) |
CWS-TOOLING: integrate CWS jsc311
Diffstat (limited to 'registry/source')
-rw-r--r-- | registry/source/keyimpl.cxx | 54 | ||||
-rw-r--r-- | registry/source/keyimpl.hxx | 7 | ||||
-rw-r--r-- | registry/source/reflcnst.hxx | 4 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 50 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 92 | ||||
-rw-r--r-- | registry/source/regimpl.hxx | 9 | ||||
-rw-r--r-- | registry/source/registry.cxx | 63 |
7 files changed, 7 insertions, 272 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 4412ca208487..8b9c6ce00de2 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: keyimpl.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.10.1 $ * * This file is part of OpenOffice.org. * @@ -58,41 +58,6 @@ ORegKey::ORegKey(const OUString& keyName, ORegistry* pReg) } //********************************************************************* -// ORegKey() -// -ORegKey::ORegKey(const OUString& keyName, const OUString& linkName, - ORegistry* pReg) - : m_refCount(1) - , m_name(keyName) - , m_bDeleted(sal_False) - , m_pRegistry(pReg) -{ - if (linkName.getLength()) - { - m_link = linkName; - m_isLink = sal_True; - - setValue(OUString( RTL_CONSTASCII_USTRINGPARAM("LINK_TARGET") ), RG_VALUETYPE_UNICODE, - (RegValue*)linkName.pData->buffer, linkName.getLength()+1); - } else - { - m_isLink = sal_False; - } -} - -//********************************************************************* -// ORegKey() -// -ORegKey::ORegKey() - : m_refCount(1) - , m_bDeleted(sal_False) - , m_isLink(sal_False) - , m_pRegistry(NULL) -{ -} - - -//********************************************************************* // ~ORegKey() // ORegKey::~ORegKey() @@ -260,23 +225,6 @@ RegError ORegKey::getKeyNames(const OUString& keyName, //********************************************************************* -// closeSubKeys -// -RegError ORegKey::closeSubKeys(RegKeyHandle* phSubKeys, sal_uInt32 nSubKeys) -{ - RegError _ret = REG_NO_ERROR; - - for (sal_uInt32 i=0; i < nSubKeys; i++) - { - _ret = closeKey(phSubKeys[i]); - } - - rtl_freeMemory(phSubKeys); - return _ret; -} - - -//********************************************************************* // closeKey // RegError ORegKey::closeKey(RegKeyHandle hKey) diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx index 174ab5a25c9d..0325aa08e4b5 100644 --- a/registry/source/keyimpl.hxx +++ b/registry/source/keyimpl.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: keyimpl.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.10.1 $ * * This file is part of OpenOffice.org. * @@ -43,8 +43,6 @@ class ORegKey public: ORegKey(const OUString& keyName, ORegistry* pReg); - ORegKey(const OUString& keyName, const OUString& linkName, - ORegistry* pReg); sal_uInt32 acquire() { return ++m_refCount; } @@ -65,8 +63,6 @@ public: rtl_uString*** pSubKeyNames, sal_uInt32* pnSubKeys); - RegError closeSubKeys(RegKeyHandle* phSubKeys, sal_uInt32 len); - RegError closeKey(RegKeyHandle hKey); RegError deleteKey(const OUString& keyName); @@ -120,7 +116,6 @@ public: OUString& resolvedName); public: - ORegKey(); virtual ~ORegKey(); diff --git a/registry/source/reflcnst.hxx b/registry/source/reflcnst.hxx index f32dfb3bc640..6cd9c2fe08a6 100644 --- a/registry/source/reflcnst.hxx +++ b/registry/source/reflcnst.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: reflcnst.hxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.10.1 $ * * This file is part of OpenOffice.org. * @@ -284,9 +284,7 @@ inline sal_uInt32 readUtf8(const sal_uInt8* buffer, sal_Char* v, sal_uInt32 maxS sal_uInt32 writeFloat(sal_uInt8* buffer, float v); -sal_uInt32 readFloat(const sal_uInt8* buffer, float& v); sal_uInt32 writeDouble(sal_uInt8* buffer, double v); -sal_uInt32 readDouble(const sal_uInt8* buffer, double& v); sal_uInt32 writeString(sal_uInt8* buffer, const sal_Unicode* v); sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSize); diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index c1c8726a6306..218286820ed3 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: reflwrit.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.15.10.1 $ * * This file is part of OpenOffice.org. * @@ -170,25 +170,6 @@ sal_uInt32 writeFloat(sal_uInt8* buffer, float v) return sizeof(sal_uInt32); } -sal_uInt32 readFloat(const sal_uInt8* buffer, float& v) -{ - union - { - float v; - sal_uInt32 b; - } x; - -#ifdef REGTYPE_IEEE_NATIVE - readUINT32(buffer, x.b); -#else -# error no IEEE -#endif - - v = x.v; - - return sizeof(sal_uInt32); -} - sal_uInt32 writeDouble(sal_uInt8* buffer, double v) { union @@ -218,35 +199,6 @@ sal_uInt32 writeDouble(sal_uInt8* buffer, double v) return (sizeof(sal_uInt32) + sizeof(sal_uInt32)); } -sal_uInt32 readDouble(const sal_uInt8* buffer, double& v) -{ - union - { - double v; - struct - { - sal_uInt32 b1; - sal_uInt32 b2; - } b; - } x; - -#ifdef REGTYPE_IEEE_NATIVE -# ifdef OSL_BIGENDIAN - readUINT32(buffer, x.b.b1); - readUINT32(buffer + sizeof(sal_uInt32), x.b.b2); -# else - readUINT32(buffer, x.b.b2); - readUINT32(buffer + sizeof(sal_uInt32), x.b.b1); -# endif -#else -# error no IEEE -#endif - - v = x.v; - - return (sizeof(sal_uInt32) + sizeof(sal_uInt32)); -} - /************************************************************************** buffer write functions diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 40d20f821384..08db223806e3 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: regimpl.cxx,v $ - * $Revision: 1.28 $ + * $Revision: 1.28.10.1 $ * * This file is part of OpenOffice.org. * @@ -1198,42 +1198,6 @@ RegError ORegistry::saveKey(RegKeyHandle hKey, const OUString& regFileName, //********************************************************************* -// isKeyOpen() -// -sal_Bool ORegistry::isKeyOpen(const OUString& keyName) const -{ - return(m_openKeyTable.count(keyName) > 0); -} - - - -//********************************************************************* -// countSubKeys() -// -sal_uInt32 ORegistry::countSubKeys(ORegKey* pKey) -{ - REG_GUARD(m_mutex); - - OStoreDirectory::iterator iter; - sal_uInt32 count = 0; - OStoreDirectory rStoreDir(pKey->getStoreDir()); - storeError _err = rStoreDir.first(iter); - - while ( _err == store_E_None) - { - if (iter.m_nAttrib & STORE_ATTRIB_ISDIR) - { - count++; - } - - _err = rStoreDir.next(iter); - } - - return count; -} - - -//********************************************************************* // loadValue() // RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, @@ -2039,60 +2003,6 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In } //********************************************************************* -// createLink() -// -RegError ORegistry::createLink(RegKeyHandle hKey, - const OUString& linkName, - const OUString& linkTarget) -{ - ORegKey* pKey; - - if ( !linkName.getLength() ) - { - return REG_INVALID_LINKNAME; - } - - REG_GUARD(m_mutex); - - if (hKey) - pKey = (ORegKey*)hKey; - else - pKey = m_openKeyTable[ROOT]; - - OUString sFullLinkName = resolveLinks(pKey, linkName); - - if (sFullLinkName.getLength() == 0) - return REG_DETECT_RECURSION; - - OStoreDirectory rStoreDir; - OUString sFullPath(ROOT); - - sal_Int32 nIndex = 0; - OUString token; - - do - { - token = sFullLinkName.getToken(0, '/', nIndex); - - if( token.getLength() > 0 ) - { - if (rStoreDir.create(pKey->getStoreFile(), sFullPath, token, KEY_MODE_CREATE)) - { - return REG_CREATE_KEY_FAILED; - } - - sFullPath += token; - sFullPath += ROOT; - } - } while( nIndex != -1 && token.getLength() > 0 ); - - pKey = new ORegKey(sFullLinkName, linkTarget, this); - delete pKey; - - return REG_NO_ERROR; -} - -//********************************************************************* // deleteLink() // RegError ORegistry::deleteLink(RegKeyHandle hKey, const OUString& linkName) diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index ea6d386d4c15..d761709dc50f 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: regimpl.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.10.1 $ * * This file is part of OpenOffice.org. * @@ -124,17 +124,12 @@ public: RegError dumpRegistry(RegKeyHandle hKey) const; - RegError createLink(RegKeyHandle hKey, - const OUString& linkName, - const OUString& linkTarget); - RegError deleteLink(RegKeyHandle hKey, const OUString& linkName); public: virtual ~ORegistry(); - sal_Bool isKeyOpen(const OUString& keyName) const; sal_Bool isReadOnly() const { return m_readOnly; } @@ -162,8 +157,6 @@ protected: RegError deleteSubkeysAndValues(ORegKey* pKey, RESOLVE eResolve=RESOLVE_FULL); - sal_uInt32 countSubKeys(ORegKey* pKey); - RegError loadAndSaveValue(ORegKey* pTargetKey, ORegKey* pSourceKey, const OUString& valueName, diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index ea4dc224e194..89028260e0c1 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: registry.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.20.10.1 $ * * This file is part of OpenOffice.org. * @@ -53,63 +53,6 @@ ORealDynamicLoader* ODynamicLoader<Registry_Api>::m_pLoader = NULL; #endif -OString getTempName() -{ - static OUString TMP(RTL_CONSTASCII_USTRINGPARAM("TMP")); - static OUString TEMP(RTL_CONSTASCII_USTRINGPARAM("TEMP")); - - OUString uTmpPattern; - sal_Char tmpPattern[512] = ""; - sal_Char *pTmpName = NULL; - - if ( osl_getEnvironment(TMP.pData, &uTmpPattern.pData) != osl_Process_E_None ) - { - if ( osl_getEnvironment(TEMP.pData, &uTmpPattern.pData) != osl_Process_E_None ) - { -#if defined(SAL_W32) || defined(SAL_OS2) - OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) ); - strncpy(tmpPattern, ".", sizeof(tmpPattern)-1); -#else - OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) ); - strncpy(tmpPattern, ".", sizeof(tmpPattern)-1); -#endif - } - } - - if ( uTmpPattern.getLength() ) - { - OString aOStr( OUStringToOString(uTmpPattern, RTL_TEXTENCODING_UTF8) ); - OSL_ASSERT( - sizeof(tmpPattern) - > sal::static_int_cast< sal_uInt32 >(aOStr.getLength()) ); - strncpy(tmpPattern, aOStr.getStr(), sizeof(tmpPattern)-1); - } - -#if defined(WIN32) || defined(WNT) || defined(OS2) - OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern) - + RTL_CONSTASCII_LENGTH("\\reg_XXXXXX") ) ); - strncat(tmpPattern, "\\reg_XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern)); - pTmpName = mktemp(tmpPattern); -#endif - -#ifdef OS2__YD - char* tmpname = tempnam(NULL, "reg_"); - OSL_ASSERT( sizeof(tmpPattern) > strlen(tmpname) ); - strncpy(tmpPattern, tmpname, sizeof(tmpPattern)-1); - pTmpName = tmpPattern; -#endif - -#ifdef UNX - OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern) - + RTL_CONSTASCII_LENGTH("/reg_XXXXXX") ) ); - strncat(tmpPattern, "/reg_XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern)); - - pTmpName = mktemp(tmpPattern); -#endif - - return OString(pTmpName); -} - extern "C" { //********************************************************************* @@ -456,10 +399,6 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, pNewKey = pKey; } - /* - OString tmpName = getTempName(); - pReg->saveKey(pNewKey, tmpName, sal_False, sal_False); - */ _ret = pKey->getRegistry()->loadKey(pNewKey, regFileName, bWarnings, bReport); if (_ret == REG_MERGE_ERROR || |