diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-12 09:18:09 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-12 09:18:09 +0000 |
commit | e591a08dc3d37e13703c855a7f4056faa4e34406 (patch) | |
tree | b68b0ea9d11b8450db6dbcf1040a12c918a44f1a /registry | |
parent | 788a7beaa020b50e9f657a4e53d1c41c6ef78f1d (diff) |
CWS-TOOLING: integrate CWS sb103
2009-01-15 15:28:08 +0100 sb r266375 : #i97629# set UNO_PATH in python start program and use it in bootstrap function in officehelper.py (and do not erroneously encode a vnd.sun.star.pathname URE_BOOTSTRAP value in tools::extendApplicationEnvironment)
2009-01-15 10:40:17 +0100 sb r266338 : #i97424# explicit shut down of ImplImageTree singleton in DeInitVCL still required
2009-01-14 12:07:15 +0100 sb r266276 : CWS-TOOLING: rebase CWS sb103 to trunk@265758 (milestone: DEV300:m38)
2009-01-14 08:53:02 +0100 sb r266266 : #i96284# remove implementation of unused (but expensive) link feature; plus some general cleanup
2009-01-08 14:42:59 +0100 sb r266010 : #i96683# enable dlclose for GCC 3 (based on a patch by cmc)
2009-01-06 14:18:23 +0100 sb r265920 : #i97424# spurious unreferenced local variables
2008-12-19 15:33:39 +0100 sb r265727 : #i57359# no need for a special glibc 2.2.4 based libgcc_s.so.1 for URE any more as the general one used for OOo is guaranteed to be based on at least glibc 2.2.4, anyway
2008-12-19 13:54:37 +0100 sb r265724 : #i97424# clean up and speed up vcl ImplImageTree
2008-12-18 14:28:10 +0100 sb r265690 : #i97132# spread usage of the rtl::Static pattern (patch by cmc)
2008-12-15 14:33:00 +0100 sb r265499 : #i90492# generate UTF-8 encoded output (patch by tora)
2008-12-15 11:45:05 +0100 sb r265469 : #i95593# -Djava.library.path to find libtest_javauno_any.so
2008-12-15 11:23:14 +0100 sb r265468 : #i93769# it appears that Java nowadays expects file URIs in UTF-8, so ExternalUriReferenceTranslator.toExternal must not be called
2008-12-10 12:02:50 +0100 sb r265164 : #i93219# use (corrected) signal handling instead of forking again (to avoid unintended generation of core files)
Diffstat (limited to 'registry')
-rw-r--r-- | registry/inc/registry/registry.h | 42 | ||||
-rw-r--r-- | registry/inc/registry/registry.hxx | 34 | ||||
-rw-r--r-- | registry/inc/registry/regtype.h | 18 | ||||
-rw-r--r-- | registry/source/keyimpl.cxx | 195 | ||||
-rw-r--r-- | registry/source/keyimpl.hxx | 30 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 480 | ||||
-rw-r--r-- | registry/source/regimpl.hxx | 56 | ||||
-rw-r--r-- | registry/source/regkey.cxx | 62 | ||||
-rw-r--r-- | registry/source/regmap.hxx | 73 | ||||
-rw-r--r-- | registry/tools/checksingleton.cxx | 3 | ||||
-rw-r--r-- | registry/tools/regcompare.cxx | 6 |
11 files changed, 149 insertions, 850 deletions
diff --git a/registry/inc/registry/registry.h b/registry/inc/registry/registry.h index 294aaa0b3cad..99b314b5767c 100644 --- a/registry/inc/registry/registry.h +++ b/registry/inc/registry/registry.h @@ -281,29 +281,21 @@ RegError REGISTRY_CALLTYPE reg_freeValueList(RegValueType valueType, RegValue pValueList, sal_uInt32 len); -/** This function creates a link with the specified link name and link target. +/** This function used to create a link. - Links in the registry are similar to links in the UNIX fielsystem. If a link will be opened, - the link target will be resolved and the key speciefied by the link target will be opened. - @param hKey identifies a currently open key. The link which will be created is a subkey - of the key identified by hKey. - @param linkName points to a null terminated string specifying the name of the new link. - @param linkTarget points to a null terminated string specifying the link target of the new link. - The linktarget must specify a valid name of an existing key. The linktarget itself - can contain links in the full qualified name. All links will be resolved if the - link will be opened. - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ RegError REGISTRY_CALLTYPE reg_createLink(RegKeyHandle hKey, rtl_uString* linkName, rtl_uString* linkTarget); -/** This function deletes a link with the specified linkname. +/** This function used to delete a link. - @param hKey identifies a currently open key. The link which will be deleted is a subkey - of the key identified by hKey. - @param linkName points to a null terminated string specifying the name of the link. - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ RegError REGISTRY_CALLTYPE reg_deleteLink(RegKeyHandle hKey, rtl_uString* linkName); @@ -312,7 +304,7 @@ RegError REGISTRY_CALLTYPE reg_deleteLink(RegKeyHandle hKey, The registry differentiates two possible types: - RG_KEYTYPE represents a real key - - RG_LINKTYPE represents a link + - RG_LINKTYPE used to represent a link (no longer used) @param keyName points to a null terminated string specifying the name of the key which keytype will be returned. @param pKeyType returns the type of the key. @@ -322,24 +314,24 @@ RegError REGISTRY_CALLTYPE reg_getKeyType(RegKeyHandle hKey, rtl_uString* keyName, RegKeyType* pKeyType); -/** This function returns the linktarget of a link. +/** This function used to return the linktarget of a link. - @param linkName points to a null terminated string specifying the name of the link which - linktarget will be returned. - @param pLinkTarget contains the linktarget if succeeds else an empty string. - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ RegError REGISTRY_CALLTYPE reg_getLinkTarget(RegKeyHandle hKey, rtl_uString* linkName, rtl_uString** pLinkTarget); -/** This function resolves all or only the first link of a keyname. +/** This function resolves a keyname. and returns the resolved keyName in pResolvedName. @param hKey identifies a currently open key. The key specified by keyName is a subkey of the key identified by hKey. @param keyName points to a null terminated string specifying the relativ name of a key. - The name of hKey together with keyName will be resolved from links. + The name of hKey together with keyName will be generated. + @param firstLinkOnly ignored @return REG_NO_ERROR if succeeds else an error code. */ RegError REGISTRY_CALLTYPE reg_getResolvedKeyName(RegKeyHandle hKey, @@ -473,7 +465,7 @@ RegError REGISTRY_CALLTYPE reg_destroyRegistry(RegHandle hRegistry, /** This function reports the complete registry information of a key and all of its subkeys. - All information which are available (keynames, value types, values, linknames, linktargets, ...) + All information which are available (keynames, value types, values, ...) will be printed to stdout for report issues only. @param hKey identifies a currently open key which content will be reported. @return REG_NO_ERROR if succeeds else an error code. diff --git a/registry/inc/registry/registry.hxx b/registry/inc/registry/registry.hxx index c1c4d106fc8f..e3ee4574023d 100644 --- a/registry/inc/registry/registry.hxx +++ b/registry/inc/registry/registry.hxx @@ -219,7 +219,7 @@ public: /** This function reports the complete registry information of a key and all of its subkeys. - All information which are available (keynames, value types, values, linknames, linktargets, ...) + All information which are available (keynames, value types, values, ...) will be printed to stdout for report issues only. @param rKey references a currently open key which content will be reported. @return REG_NO_ERROR if succeeds else an error code. @@ -597,46 +597,46 @@ public: inline RegError getUnicodeListValue(const ::rtl::OUString& keyName, RegistryValueList<sal_Unicode*>& rValueList); - /** creates a new link with the specified name and target. + /** used to create a link. - @param linkName specifies the name of link - @param linkTarget specifies a full qualified keyname as target for the link. - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ inline RegError createLink(const ::rtl::OUString& linkName, const ::rtl::OUString& linkTarget); - /** deletes an existing link. + /** used to delete a link. - @param linkName specifies the name of link - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ inline RegError deleteLink(const ::rtl::OUString& linkName); - /** returns the type of the specified key if it is a link or a real key. + /** returns the type of the specified key. @param name specifies the name of the key or link. - @param pKeyType returns the type of the key. + @param pKeyType returns the type of the key (always RG_KEYTYPE). @return REG_NO_ERROR if succeeds else an error code. */ inline RegError getKeyType(const ::rtl::OUString& name, RegKeyType* pKeyType) const; - /** returns the target of the specified link. + /** used to return the target of a link. - @param linkName specifies the name of link. - @param rLinkTarget returns the target keyname of the link. - @return REG_NO_ERROR if succeeds else an error code. + @obsolete Links are no longer supported. + + @return REG_INVALID_LINK */ inline RegError getLinkTarget(const ::rtl::OUString& linkName, ::rtl::OUString& rLinkTarget) const; - /** resolves all or only the first link of a keyname. + /** resolves a keyname. - The function resolves either only the first link or it resolves all links - which exists in the keyname or recursive in the resolved parts. @param keyName specifies the name of the key which will be resolved relativ to this key. The resolved name will be prefixed with the name of this key. + @param firstLinkOnly ignored @return REG_NO_ERROR if succeeds else an error code. */ inline RegError getResolvedKeyName(const ::rtl::OUString& keyName, diff --git a/registry/inc/registry/regtype.h b/registry/inc/registry/regtype.h index 7e4ec33adab4..7e22f0cd4d12 100644 --- a/registry/inc/registry/regtype.h +++ b/registry/inc/registry/regtype.h @@ -64,13 +64,13 @@ typedef sal_uInt16 RegAccessMode; The registry differs between normal keys which can contain subkeys or a value and link keys which navigate over the linktarget to an existing - other key. The mechanism is similar to links in a UNIX filesystem. + other key (which are no longer supported). */ enum RegKeyType { /// represents a real key RG_KEYTYPE, - /// represents a link + /// represents a link (which is no longer supported) RG_LINKTYPE }; @@ -158,15 +158,19 @@ enum RegError */ REG_MERGE_CONFLICT, - /// a recursion was detected resolving different link targets. + /** a recursion was detected resolving different link targets (no longer + used). + */ REG_DETECT_RECURSION, - /// the link is invalid and can not be resolved. + /** the link is invalid and can not be resolved (now used by all + link-related operations, as links are no longer supported). + */ REG_INVALID_LINK, - /// the specified linkname is not valid. + /// the specified linkname is not valid (no longer used). REG_INVALID_LINKNAME, - /// the linknane is not valid. + /// the linknane is not valid (no longer used). REG_INVALID_LINKTARGET, - /// the link target points to a nonexisting key. + /// the link target points to a nonexisting key (no longer used). REG_LINKTARGET_NOT_EXIST, /// the reserved buffer for the resolved keyname is to small. REG_BUFFERSIZE_TOSMALL diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 8b9c6ce00de2..f8de7e20b148 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -31,13 +31,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_registry.hxx" -#ifndef __REFLCNST_HXX__ #include "reflcnst.hxx" -#endif #include "keyimpl.hxx" #include <rtl/alloc.h> #include <rtl/memory.h> +#include "rtl/ustrbuf.hxx" + +namespace { static char const VALUE_PREFIX[] = "$VL_"; } //********************************************************************* // ORegKey() @@ -46,24 +47,8 @@ ORegKey::ORegKey(const OUString& keyName, ORegistry* pReg) : m_refCount(1) , m_name(keyName) , m_bDeleted(sal_False) - , m_isLink(sal_False) , m_pRegistry(pReg) -{ - if (pReg) - { - m_storeFile = pReg->getStoreFile(); - } - - checkLink(); -} - -//********************************************************************* -// ~ORegKey() -// -ORegKey::~ORegKey() -{ -} - +{} //********************************************************************* // createKey @@ -77,9 +62,9 @@ RegError ORegKey::createKey(const OUString& keyName, RegKeyHandle* phNewKey) //********************************************************************* // openKey // -RegError ORegKey::openKey(const OUString& keyName, RegKeyHandle* phOpenKey, RESOLVE eResolve) +RegError ORegKey::openKey(const OUString& keyName, RegKeyHandle* phOpenKey) { - return (m_pRegistry->openKey(this, keyName, phOpenKey, eResolve)); + return (m_pRegistry->openKey(this, keyName, phOpenKey)); } @@ -172,7 +157,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, if (keyName.getLength()) { - _ret = openKey(keyName, (RegKeyHandle*)&pKey, RESOLVE_PART); + _ret = openKey(keyName, (RegKeyHandle*)&pKey); if (_ret) { *pSubKeyNames = NULL; @@ -261,7 +246,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy REG_GUARD(m_pRegistry->m_mutex); - if ( rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) + if ( rValue.create(m_pRegistry->getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { *pValueType = RG_VALUETYPE_NOT_DEFINED; *pValueSize = 0; @@ -332,7 +317,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal REG_GUARD(m_pRegistry->m_mutex); - if ( rValue.create(m_storeFile, m_name + m_pRegistry->ROOT , sImplValueName, VALUE_MODE_CREATE) ) + if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT , sImplValueName, VALUE_MODE_CREATE) ) { return REG_SET_VALUE_FAILED; } @@ -402,7 +387,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL REG_GUARD(m_pRegistry->m_mutex); - if (rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) + if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) { return REG_SET_VALUE_FAILED; } @@ -460,7 +445,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu REG_GUARD(m_pRegistry->m_mutex); - if (rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) + if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) { return REG_SET_VALUE_FAILED; } @@ -527,7 +512,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p REG_GUARD(m_pRegistry->m_mutex); - if (rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) + if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) ) { return REG_SET_VALUE_FAILED; } @@ -597,7 +582,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const REG_GUARD(m_pRegistry->m_mutex); - if (rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) + if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { return REG_VALUE_NOT_EXISTS; } @@ -691,7 +676,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue REG_GUARD(m_pRegistry->m_mutex); - if (rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) + if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { pValueList = NULL; *pLen = 0; @@ -788,7 +773,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal REG_GUARD(m_pRegistry->m_mutex); - if ( rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) + if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { pValueList = NULL; *pLen = 0; @@ -894,7 +879,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** REG_GUARD(m_pRegistry->m_mutex); - if ( rValue.create(m_storeFile, m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) + if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { pValueList = NULL; *pLen = 0; @@ -994,109 +979,25 @@ RegError ORegKey::getKeyType(const OUString& name, RegKeyType* pKeyType) const if ( name.getLength() ) { _ret = ((ORegKey*)this)->openKey( - name, (RegKeyHandle*)&pKey, RESOLVE_PART); + name, (RegKeyHandle*)&pKey); if (_ret) return _ret; - - if (pKey->isLink()) - *pKeyType = RG_LINKTYPE; - ((ORegKey*)this)->closeKey((RegKeyHandle)pKey); return _ret; } else { - if (m_isLink) - *pKeyType = RG_LINKTYPE; - - return _ret; - } -} - -//********************************************************************* -// createLink() -// -RegError ORegKey::createLink(const OUString& linkName, const OUString& linkTarget) -{ - ORegKey* pKey; - RegError _ret = REG_NO_ERROR; - - if ( !linkName.getLength() ) - return REG_INVALID_LINKNAME; - - if ( !linkTarget.getLength() ) - return REG_INVALID_LINKTARGET; - - REG_GUARD(m_pRegistry->m_mutex); - - if (m_pRegistry->openKey(this, linkName, (RegKeyHandle*)&pKey, RESOLVE_PART)) - { - _ret = m_pRegistry->createKey(this, linkName, (RegKeyHandle*)&pKey); - if (_ret) - return _ret; - } else - { - if (!pKey->isLink()) - { - m_pRegistry->closeKey(pKey); - return REG_INVALID_LINK; - } - } - - if ((_ret = pKey->setValue(OUString( RTL_CONSTASCII_USTRINGPARAM("LINK_TARGET") ), - RG_VALUETYPE_UNICODE, (RegValue)linkTarget.getStr(), (linkTarget.getLength()+1)*2))) - { - m_pRegistry->closeKey(pKey); - _ret = m_pRegistry->deleteKey(this, linkName); return _ret; } - - return m_pRegistry->closeKey(pKey); -} - -//********************************************************************* -// deleteLink() -// -RegError ORegKey::deleteLink(const OUString& linkName) -{ - return (m_pRegistry->deleteLink(this, linkName)); -} - -//********************************************************************* -// getLinkTarget() -// -RegError ORegKey::getLinkTarget(const OUString& linkName, OUString& linkTarget) const -{ - ORegKey* pKey; - RegError _ret = REG_NO_ERROR; - - REG_GUARD(m_pRegistry->m_mutex); - - if ( linkName.getLength() ) - { - _ret = ((ORegKey*)this)->openKey( - linkName, (RegKeyHandle*)&pKey, RESOLVE_PART); - if (_ret) - return REG_INVALID_LINK; - - _ret = pKey->getLinkTarget(OUString(), linkTarget); - ((ORegKey*)this)->closeKey((RegKeyHandle)pKey); - return _ret; - } else - { - if (m_isLink) - { - linkTarget = m_link; - return REG_NO_ERROR; - } else - return REG_LINKTARGET_NOT_EXIST; - } } RegError ORegKey::getResolvedKeyName(const OUString& keyName, OUString& resolvedName) { - return - m_pRegistry->getResolvedKeyName((ORegKey*)this, keyName, resolvedName); + if (keyName.getLength() == 0) { + return REG_INVALID_KEYNAME; + } + resolvedName = getFullPath(keyName); + return REG_NO_ERROR; } //********************************************************************* @@ -1124,39 +1025,6 @@ sal_uInt32 ORegKey::countSubKeys() return count; } - -//********************************************************************* -// checkLink() -// -sal_Bool ORegKey::checkLink() -{ - - OUString aPath (m_name); aPath += m_pRegistry->ROOT; - OUString aName (RTL_CONSTASCII_USTRINGPARAM(VALUE_PREFIX "LINK_TARGET")); - - if (m_storeFile.attrib (aPath, aName, 0, 0) == store_E_None) - { - OUString valueName (RTL_CONSTASCII_USTRINGPARAM("LINK_TARGET")); - RegValueType valueType = RG_VALUETYPE_NOT_DEFINED; - sal_uInt32 valueSize = 0; - - ORegKey* pThis = const_cast<ORegKey*>(this); - if (pThis->getValueInfo (valueName, &valueType, &valueSize) == REG_NO_ERROR) - { - sal_Unicode* value = (sal_Unicode*)rtl_allocateMemory(valueSize); - if (pThis->getValue (valueName, value) == REG_NO_ERROR) - { - m_link = OUString (value); - m_isLink = sal_True; - } - - rtl_freeMemory (value); - return sal_True; - } - } - return sal_False; -} - OStoreDirectory ORegKey::getStoreDir() { OStoreDirectory rStoreDir; @@ -1179,8 +1047,25 @@ OStoreDirectory ORegKey::getStoreDir() accessMode = KEY_MODE_OPENREAD; } - rStoreDir.create(m_storeFile, fullPath, relativName, accessMode); + rStoreDir.create(getStoreFile(), fullPath, relativName, accessMode); return rStoreDir; } +OUString ORegKey::getFullPath(OUString const & path) const { + OSL_ASSERT(m_name.getLength() != 0 && path.getLength() != 0); + OUStringBuffer b(m_name); + if (b.charAt(b.getLength() - 1) == '/') { + if (path[0] == '/') { + b.append(path.getStr() + 1, path.getLength() - 1); + } else { + b.append(path); + } + } else { + if (path[0] != '/') { + b.append(sal_Unicode('/')); + } + b.append(path); + } + return b.makeStringAndClear(); +} diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx index 0325aa08e4b5..4e99696bcd44 100644 --- a/registry/source/keyimpl.hxx +++ b/registry/source/keyimpl.hxx @@ -52,8 +52,7 @@ public: RegError createKey(const OUString& keyName, RegKeyHandle* phNewKey); - RegError openKey(const OUString& keyName, RegKeyHandle* phOpenKey, - RESOLVE eResolve=RESOLVE_FULL); + RegError openKey(const OUString& keyName, RegKeyHandle* phOpenKey); RegError openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubKeys, @@ -102,23 +101,12 @@ public: sal_Unicode*** pValueList, sal_uInt32* pLen) const; - RegError createLink(const OUString& linkName, const OUString& linkTarget); - - RegError deleteLink(const OUString& linkName); - RegError getKeyType(const OUString& name, RegKeyType* pKeyType) const; - RegError getLinkTarget(const OUString& linkName, - OUString& pLinkTarget) const; - RegError getResolvedKeyName(const OUString& keyName, OUString& resolvedName); -public: - virtual ~ORegKey(); - - sal_Bool isDeleted() const { return m_bDeleted; } @@ -130,17 +118,11 @@ public: sal_uInt32 countSubKeys(); - sal_Bool isLink() const - { return m_isLink; } - - const OUString& getLinkTarget() const - { return m_link; } - ORegistry* getRegistry() const { return m_pRegistry; } const OStoreFile& getStoreFile() const - { return m_storeFile; } + { return m_pRegistry->getStoreFile(); } OStoreDirectory getStoreDir(); @@ -150,17 +132,13 @@ public: sal_uInt32 getRefCount() const { return m_refCount; } - friend class ORegistry; -protected: - sal_Bool checkLink(); + OUString getFullPath(OUString const & path) const; +private: sal_uInt32 m_refCount; OUString m_name; - OUString m_link; sal_Bool m_bDeleted; - sal_Bool m_isLink; ORegistry* m_pRegistry; - OStoreFile m_storeFile; }; diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 08db223806e3..86165b42bd1d 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_registry.hxx" +#include <memory> #include <string.h> #include <stdio.h> @@ -641,10 +642,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, else pKey = m_openKeyTable[ROOT]; - OUString sFullKeyName = resolveLinks(pKey, keyName); - - if ( !sFullKeyName.getLength() ) - return REG_DETECT_RECURSION; + OUString sFullKeyName = pKey->getFullPath(keyName); if (m_openKeyTable.count(sFullKeyName) > 0) { @@ -688,96 +686,10 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, //********************************************************************* // openKey // -static OUString makePath( const OUString & resolvedPath, const OUString &path ) -{ - OUStringBuffer buf(resolvedPath); - if( ! resolvedPath.getLength() || - '/' != resolvedPath[resolvedPath.getLength()-1]) - { - buf.appendAscii( "/" ); - } - - if( path[0] == '/' ) - { - buf.append( path.getStr()+1 ); - } - else - { - buf.append( path ); - } - return buf.makeStringAndClear(); -} - -RegError ORegistry::openKeyWithoutLink( - RegKeyHandle hKey, const OUString& keyName, - RegKeyHandle* phOpenKey) -{ - ORegKey* pKey; - ORegKey* pRet; - storeAccessMode accessMode = KEY_MODE_OPEN; - - *phOpenKey = NULL; - - if ( !keyName.getLength() ) - { - return REG_INVALID_KEYNAME; - } - - if ( isReadOnly() ) - { - accessMode = KEY_MODE_OPENREAD; - } - - REG_GUARD(m_mutex); - - if (hKey) - pKey = (ORegKey*)hKey; - else - pKey = m_openKeyTable[ROOT]; - - OUString sFullKeyName = makePath( pKey->getName(), keyName ); - OUString sFullPath; - OUString sRelativKey; - - sal_Int32 lastIndex = sFullKeyName.lastIndexOf('/'); - sRelativKey = sFullKeyName.copy(lastIndex + 1); - sFullPath = sFullKeyName.copy(0, lastIndex + 1); - - KeyMap::iterator ii = m_openKeyTable.find( sFullKeyName ); - if( ii == m_openKeyTable.end() ) - { - OStoreDirectory rStoreDir; - storeError _err = rStoreDir.create(pKey->getStoreFile(), sFullPath, sRelativKey, accessMode); - - if (_err == store_E_NotExists) - return REG_KEY_NOT_EXISTS; - else - if (_err == store_E_WrongFormat) - return REG_INVALID_KEY; - - if( _err != store_E_None ) - return REG_KEY_NOT_EXISTS; - - pRet = new ORegKey(sFullKeyName, this); - *phOpenKey = pRet; - m_openKeyTable[sFullKeyName] = pRet; - } - else - { - // try to open it directly - pRet = ii->second; - OSL_ASSERT( pRet ); - *phOpenKey = pRet; - pRet->acquire(); - } - return REG_NO_ERROR; -} - RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, - RegKeyHandle* phOpenKey, RESOLVE eResolve) + RegKeyHandle* phOpenKey) { ORegKey* pKey; - storeAccessMode accessMode = KEY_MODE_OPEN; *phOpenKey = NULL; @@ -786,11 +698,6 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, return REG_INVALID_KEYNAME; } - if ( isReadOnly() ) - { - accessMode = KEY_MODE_OPENREAD; - } - REG_GUARD(m_mutex); if (hKey) @@ -798,111 +705,28 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, else pKey = m_openKeyTable[ROOT]; - OUString sFullKeyName; - OUString sFullPath; - OUString sRelativKey; - - switch (eResolve) - { - case RESOLVE_FULL: - { - // try the optimistic approach (links aren't recognized) - RegKeyHandle handle = 0; - if( REG_NO_ERROR == openKeyWithoutLink( hKey, keyName,&handle ) ) - { - *phOpenKey = handle; - return REG_NO_ERROR; - } - - sFullKeyName = resolveLinks(pKey, keyName); - if ( !sFullKeyName.getLength() ) - return REG_DETECT_RECURSION; - - sal_Int32 lastIndex = sFullKeyName.lastIndexOf('/'); - sRelativKey = sFullKeyName.copy(lastIndex + 1); - sFullPath = sFullKeyName.copy(0, lastIndex + 1); - } - break; - case RESOLVE_PART: - { - sal_Int32 lastIndex = keyName.lastIndexOf('/'); - if ( lastIndex >= 0 ) - { - OUString sRelativ(keyName.copy(lastIndex)); - OUString tmpKey(keyName.copy(0, lastIndex + 1)); - sFullKeyName = resolveLinks(pKey, tmpKey); - - sFullPath = sFullKeyName; - sFullPath += ROOT; - sFullKeyName += sRelativ; - sRelativKey = sRelativ.copy(1); - } else - { - sFullKeyName = pKey->getName(); - sFullPath = sFullKeyName; - - sRelativKey = keyName; - - if ( sFullKeyName.getLength() > 1 ) - sFullKeyName += ROOT; - - sFullKeyName += keyName; - - if ( sFullPath.getLength() > 1 ) - sFullPath += ROOT; - } - } - break; - case RESOLVE_NOTHING: - { - sFullKeyName = pKey->getName(); - sFullPath = sFullKeyName; - - if (sFullKeyName.getLength() > 1) - sFullKeyName += ROOT; - - sal_Int32 lastIndex = keyName.lastIndexOf('/'); - if ( lastIndex >= 0 && lastIndex < keyName.getLength() ) - { - OUString sRelativ(keyName.copy(lastIndex+1)); - sRelativKey = sRelativ; - sFullKeyName += keyName.copy(1); - - sFullPath = sFullKeyName.copy(0, keyName.lastIndexOf('/') + 1); - } else - { - - sRelativKey += keyName; - sFullKeyName += keyName; - - if ( sFullPath.getLength() > 1 ) - sFullPath += ROOT; - } - } + OUString path(pKey->getFullPath(keyName)); + KeyMap::iterator i(m_openKeyTable.find(path)); + if (i == m_openKeyTable.end()) { + sal_Int32 n = path.lastIndexOf('/') + 1; + switch (OStoreDirectory().create( + pKey->getStoreFile(), path.copy(0, n), path.copy(n), + isReadOnly() ? KEY_MODE_OPENREAD : KEY_MODE_OPEN)) + { + case store_E_NotExists: + return REG_KEY_NOT_EXISTS; + case store_E_WrongFormat: + return REG_INVALID_KEY; + default: break; + } + std::auto_ptr< ORegKey > p(new ORegKey(path, this)); + i = m_openKeyTable.insert(std::make_pair(path, p.get())).first; + p.release(); + } else { + i->second->acquire(); } - - if (m_openKeyTable.count(sFullKeyName) > 0) - { - m_openKeyTable[sFullKeyName]->acquire(); - *phOpenKey = m_openKeyTable[sFullKeyName]; - return REG_NO_ERROR; - } - - OStoreDirectory rStoreDir; - storeError _err = rStoreDir.create(pKey->getStoreFile(), sFullPath, sRelativKey, accessMode); - - if (_err == store_E_NotExists) - return REG_KEY_NOT_EXISTS; - else - if (_err == store_E_WrongFormat) - return REG_INVALID_KEY; - - pKey = new ORegKey(sFullKeyName, this); - - *phOpenKey = pKey; - m_openKeyTable[sFullKeyName] = pKey; - + *phOpenKey = i->second; return REG_NO_ERROR; } @@ -956,18 +780,15 @@ RegError ORegistry::deleteKey(RegKeyHandle hKey, const OUString& keyName) else pKey = m_openKeyTable[ROOT]; - OUString sFullKeyName = resolveLinks(pKey, keyName); - - if ( !sFullKeyName.getLength() ) - return REG_DETECT_RECURSION; + OUString sFullKeyName = pKey->getFullPath(keyName); pKey = m_openKeyTable[ROOT]; - _ret = eraseKey(pKey, sFullKeyName, RESOLVE_NOTHING); + _ret = eraseKey(pKey, sFullKeyName); return _ret; } -RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName, RESOLVE eResolve) +RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) { RegError _ret = REG_NO_ERROR; @@ -1004,13 +825,13 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName, RESOLVE eRe } RegKeyHandle hOldKey; - _ret = pKey->openKey(keyName, &hOldKey, eResolve); + _ret = pKey->openKey(keyName, &hOldKey); if (_ret) { return _ret; } - _ret = deleteSubkeysAndValues((ORegKey*)hOldKey, eResolve); + _ret = deleteSubkeysAndValues((ORegKey*)hOldKey); if (_ret) { pKey->closeKey(hOldKey); @@ -1043,7 +864,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName, RESOLVE eRe //********************************************************************* // deleteSubKeys // -RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey, RESOLVE eResolve) +RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey) { OStoreDirectory::iterator iter; OUString keyName; @@ -1057,7 +878,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey, RESOLVE eResolve) if (iter.m_nAttrib & STORE_ATTRIB_ISDIR) { - _ret = eraseKey(pKey, keyName, eResolve); + _ret = eraseKey(pKey, keyName); if (_ret) return _ret; } else @@ -1434,7 +1255,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue, static sal_uInt32 checkTypeReaders(RegistryTypeReader& reader1, RegistryTypeReader& reader2, - StringSet& nameSet) + std::set< OUString >& nameSet) { sal_uInt32 count=0; sal_uInt16 i; @@ -1463,7 +1284,7 @@ RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue, { sal_uInt16 index = 0; - StringSet nameSet; + std::set< OUString > nameSet; sal_uInt32 count = checkTypeReaders(reader, reader2, nameSet); if (count != reader.getFieldCount()) @@ -1567,7 +1388,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey, } _ret = pSourceKey->openKey( - keyName, (RegKeyHandle*)&pTmpKey, RESOLVE_NOTHING); + keyName, (RegKeyHandle*)&pTmpKey); if (_ret) { return _ret; @@ -1618,33 +1439,6 @@ ORegKey* ORegistry::getRootKey() //********************************************************************* -// getResolvedKeyName() -// -RegError ORegistry::getResolvedKeyName(RegKeyHandle hKey, - const OUString& keyName, - OUString& resolvedName) -{ - ORegKey* pKey; - - if ( !keyName.getLength() ) - return REG_INVALID_KEYNAME; - - REG_GUARD(m_mutex); - - if (hKey) - pKey = (ORegKey*)hKey; - else - pKey = m_openKeyTable[ROOT]; - - resolvedName = resolveLinks(pKey, keyName); - - if ( resolvedName.getLength() ) - return REG_NO_ERROR; - else - return REG_DETECT_RECURSION; -} - -//********************************************************************* // dumpRegistry() // RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const @@ -1696,7 +1490,6 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ OUString sFullPath(sPath); OString sIndent; storeAccessMode accessMode = VALUE_MODE_OPEN; - sal_Bool bLinkValue = sal_False; if (isReadOnly()) { @@ -1714,12 +1507,6 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ return REG_VALUE_NOT_EXISTS; } - OUString tmpName( RTL_CONSTASCII_USTRINGPARAM(VALUE_PREFIX) ); - tmpName += OUString( RTL_CONSTASCII_USTRINGPARAM("LINK_TARGET") ); - if (sName == tmpName) - { - bLinkValue = sal_True; - } pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); sal_uInt32 rwBytes; @@ -1773,20 +1560,11 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ { sal_Char* value = (sal_Char*)rtl_allocateMemory(valueSize); readUtf8(pBuffer, value, valueSize); - - if (bLinkValue) - { - fprintf(stdout, "%sKEY: Type = RG_LINKTYPE\n", indent); - fprintf(stdout, "%s LinkTarget = \"%s\"\n", indent, value); - } else - { - fprintf(stdout, "%sValue: Type = RG_VALUETYPE_STRING\n", indent); - fprintf( - stdout, "%s Size = %lu\n", indent, - sal::static_int_cast< unsigned long >(valueSize)); - fprintf(stdout, "%s Data = \"%s\"\n", indent, value); - } - + fprintf(stdout, "%sValue: Type = RG_VALUETYPE_STRING\n", indent); + fprintf( + stdout, "%s Size = %lu\n", indent, + sal::static_int_cast< unsigned long >(valueSize)); + fprintf(stdout, "%s Data = \"%s\"\n", indent, value); rtl_freeMemory(value); } break; @@ -2001,185 +1779,3 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In return REG_NO_ERROR; } - -//********************************************************************* -// deleteLink() -// -RegError ORegistry::deleteLink(RegKeyHandle hKey, const OUString& linkName) -{ - ORegKey* pKey; - - if ( !linkName.getLength() ) - { - return REG_INVALID_LINKNAME; - } - - REG_GUARD(m_mutex); - - if (hKey) - pKey = (ORegKey*)hKey; - else - pKey = m_openKeyTable[ROOT]; - - OUString tmpPath(linkName); - OUString tmpName; - OUString resolvedPath; - sal_Int32 lastIndex = tmpPath.lastIndexOf('/'); - - if ( lastIndex > 0 && tmpPath.getStr()[0] == '/') - { - tmpName = tmpPath.copy(lastIndex); - - OUString linkPath = tmpPath.copy(0, lastIndex); - - resolvedPath = resolveLinks(pKey, linkPath); - - if ( !resolvedPath.getLength() ) - { - return REG_DETECT_RECURSION; - } - - resolvedPath += tmpName; - } else - { - resolvedPath = pKey->getName(); - - if (lastIndex != 0 && resolvedPath.getLength() > 1) - resolvedPath += ROOT; - - resolvedPath += linkName; - } - - pKey = m_openKeyTable[ROOT]; - - RegKeyType keyType; - RegError ret = REG_NO_ERROR; - ret = pKey->getKeyType(resolvedPath, &keyType); - if (ret) - return ret; - - if (keyType != RG_LINKTYPE) - return REG_INVALID_LINK; - - return eraseKey(pKey, resolvedPath, RESOLVE_PART); -} - -//********************************************************************* -// resolveLinks() -// - -OUString ORegistry::resolveLinks(ORegKey* pKey, const OUString& path) -{ - OUString resolvedPath(pKey->getName()); - sal_Int32 nIndex = 0; - OUString token; - ORegKey* pLink = NULL; - - if ( path.getStr()[0] == '/' ) - nIndex++; - - do - { - token = path.getToken( 0, '/', nIndex ); - if( token.getLength() && resolvedPath.getLength() > 1 ) - resolvedPath += ROOT; - - pLink = resolveLink(pKey, resolvedPath, token); - - if (pLink) - { - OUString tmpName; - sal_Int32 lastIndex; - - while(pLink) - { - if (!insertRecursionLink(pLink)) - { - resetRecursionLinks(); - delete pLink; - return OUString(); - } - - - lastIndex = resolvedPath.lastIndexOf('/'); - tmpName = resolvedPath.copy(lastIndex + 1); - resolvedPath = resolvedPath.copy(0, lastIndex + 1); - - pLink = resolveLink(pKey, resolvedPath, tmpName); - } - - resetRecursionLinks(); - } - } while( nIndex != -1 ); - - return resolvedPath; -} - -//********************************************************************* -// resolveLink() -// -ORegKey* ORegistry::resolveLink(ORegKey* pKey, OUString& resolvedPath, const OUString& name) -{ - OStoreDirectory rStoreDir; - ORegKey* pTmpKey = NULL; - - if ( !rStoreDir.create(pKey->getStoreFile(), resolvedPath, - name, KEY_MODE_OPENREAD) ) - { - resolvedPath += name; - pTmpKey = new ORegKey(resolvedPath, pKey->getRegistry()); - RegKeyType keyType; - if (!pTmpKey->getKeyType(OUString(), &keyType) && (keyType == RG_LINKTYPE)) - { - resolvedPath = pTmpKey->getLinkTarget(); - return pTmpKey; - } - - delete pTmpKey; - return NULL; - } else - { - resolvedPath += name; - - return NULL; - } -} - -sal_Bool ORegistry::insertRecursionLink(ORegKey* pLink) -{ - if (m_recursionList.empty()) - { - m_recursionList.push_back(pLink); - } else - { - LinkList::iterator iter = m_recursionList.begin(); - - while (iter != m_recursionList.end()) - { - if ((*iter)->getName() == pLink->getName()) - return sal_False; - - iter++; - } - m_recursionList.push_back(pLink); - } - - return sal_True; -} - -sal_Bool ORegistry::resetRecursionLinks() -{ - LinkList::iterator iter = m_recursionList.begin(); - - while (iter != m_recursionList.end()) - { - delete *iter; - iter++; - } - - m_recursionList.erase(m_recursionList.begin(), m_recursionList.end()); - - return sal_True; -} - - diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index d761709dc50f..c32dcf3527df 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -31,8 +31,11 @@ #ifndef _REGIMPL_HXX_ #define _REGIMPL_HXX_ +#include <set> + +#include <hash_map> + #include <registry/registry.h> -#include "regmap.hxx" #include <osl/mutex.hxx> #include <store/store.hxx> @@ -51,9 +54,6 @@ #define VALUE_MODE_OPEN store_AccessReadWrite #define VALUE_MODE_OPENREAD store_AccessReadOnly -#define VALUE_PREFIX "$VL_" -#define VALUE_LINKTARGET "$VL_LINK_TARGET" - // 5 Bytes = 1 (Byte fuer den Typ) + 4 (Bytes fuer die Groesse der Daten) #define VALUE_HEADERSIZE 5 #define VALUE_TYPEOFFSET 1 @@ -68,17 +68,7 @@ using namespace rtl; using namespace osl; using namespace store; -enum RESOLVE -{ - // alle Links werden aufgeloest - RESOLVE_FULL, - // alles bis zum letzten TeilStueck wird aufgeloest - RESOLVE_PART, - // kein Link wird aufgeloest - RESOLVE_NOTHING -}; - -class ORegManager; +class ORegKey; class RegistryTypeReader; class ORegistry @@ -105,8 +95,7 @@ public: RegError openKey(RegKeyHandle hKey, const OUString& keyName, - RegKeyHandle* phOpenKey, - RESOLVE eResolve=RESOLVE_FULL); + RegKeyHandle* phOpenKey); RegError closeKey(RegKeyHandle hKey); @@ -124,11 +113,7 @@ public: RegError dumpRegistry(RegKeyHandle hKey) const; - RegError deleteLink(RegKeyHandle hKey, - const OUString& linkName); - -public: - virtual ~ORegistry(); + ~ORegistry(); sal_Bool isReadOnly() const { return m_readOnly; } @@ -144,18 +129,12 @@ public: const OUString& getName() const { return m_name; } - RegError getResolvedKeyName(RegKeyHandle hKey, - const OUString& keyName, - OUString& resolvedName); - friend class ORegKey; -protected: - RegError eraseKey(ORegKey* pKey, - const OUString& keyName, - RESOLVE eResolve=RESOLVE_FULL); - RegError deleteSubkeysAndValues(ORegKey* pKey, - RESOLVE eResolve=RESOLVE_FULL); +private: + RegError eraseKey(ORegKey* pKey, const OUString& keyName); + + RegError deleteSubkeysAndValues(ORegKey* pKey); RegError loadAndSaveValue(ORegKey* pTargetKey, ORegKey* pSourceKey, @@ -189,17 +168,7 @@ protected: const OUString& sName, sal_Int16 nSpace) const; - RegError openKeyWithoutLink(RegKeyHandle hKey, - const OUString& keyName, - RegKeyHandle* phOpenKey); - - OUString resolveLinks(ORegKey* pKey, const OUString& path); - ORegKey* resolveLink(ORegKey* pKey, OUString& resolvedPath, const OUString& name); - - sal_Bool insertRecursionLink(ORegKey* pLink); - sal_Bool resetRecursionLinks(); - -protected: + typedef std::hash_map< OUString, ORegKey*, OUStringHash > KeyMap; sal_uInt32 m_refCount; Mutex m_mutex; @@ -208,7 +177,6 @@ protected: OUString m_name; OStoreFile m_file; KeyMap m_openKeyTable; - LinkList m_recursionList; const OUString ROOT; }; diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx index 5c63c9cde09f..1d828a862a96 100644 --- a/registry/source/regkey.cxx +++ b/registry/source/regkey.cxx @@ -813,48 +813,17 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, //********************************************************************* // createLink // -RegError REGISTRY_CALLTYPE createLink(RegKeyHandle hKey, - rtl_uString* linkName, - rtl_uString* linkTarget) +RegError REGISTRY_CALLTYPE createLink(RegKeyHandle, rtl_uString*, rtl_uString*) { - ORegKey* pKey; - - if (hKey) - { - pKey = (ORegKey*)hKey; - - if (pKey->isDeleted()) - return REG_INVALID_KEY; - } else - return REG_INVALID_KEY; - - if (pKey->isReadOnly()) - return REG_REGISTRY_READONLY; - - return pKey->createLink(linkName, linkTarget); + return REG_INVALID_LINK; // links are no longer supported } //********************************************************************* // deleteLink // -RegError REGISTRY_CALLTYPE deleteLink(RegKeyHandle hKey, - rtl_uString* linkName) +RegError REGISTRY_CALLTYPE deleteLink(RegKeyHandle, rtl_uString*) { - ORegKey* pKey; - - if (hKey) - { - pKey = (ORegKey*)hKey; - - if (pKey->isDeleted()) - return REG_INVALID_KEY; - } else - return REG_INVALID_KEY; - - if (pKey->isReadOnly()) - return REG_REGISTRY_READONLY; - - return pKey->deleteLink(linkName); + return REG_INVALID_LINK; // links are no longer supported } //********************************************************************* @@ -881,29 +850,12 @@ RegError REGISTRY_CALLTYPE getKeyType(RegKeyHandle hKey, //********************************************************************* // getLinkTarget // -RegError REGISTRY_CALLTYPE getLinkTarget(RegKeyHandle hKey, - rtl_uString* linkName, - rtl_uString** pLinkTarget) +RegError REGISTRY_CALLTYPE getLinkTarget( + RegKeyHandle, rtl_uString*, rtl_uString**) { - ORegKey* pKey; - - if (hKey) - { - pKey = (ORegKey*)hKey; - - if (pKey->isDeleted()) - return REG_INVALID_KEY; - } else - return REG_INVALID_KEY; - - OUString linkTarget; - RegError ret = pKey->getLinkTarget(linkName, linkTarget); - if (!ret) - rtl_uString_assign(pLinkTarget, linkTarget.pData); - return ret; + return REG_INVALID_LINK; // links are no longer supported } - //********************************************************************* // getName // diff --git a/registry/source/regmap.hxx b/registry/source/regmap.hxx deleted file mode 100644 index c16d99babcc0..000000000000 --- a/registry/source/regmap.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: regmap.hxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _REGMAP_HXX_ -#define _REGMAP_HXX_ - -#include <hash_map> -#include <list> -#include <set> -#include <rtl/ustring.hxx> - -using namespace rtl; - -class ORegKey; - -struct EqualString -{ - sal_Bool operator()(const OUString& str1, const OUString& str2) const - { - return (str1 == str2); - } -}; - -struct HashString -{ - size_t operator()(const OUString& str) const - { - return str.hashCode(); - } -}; - -struct LessString -{ - sal_Bool operator()(const OUString& str1, const OUString& str2) const - { - return (str1 < str2); - } -}; - -typedef ::std::hash_map< OUString, ORegKey*, HashString, EqualString > KeyMap; - -typedef ::std::list< ORegKey* > LinkList; - -typedef ::std::set< OUString, LessString > StringSet; - -#endif diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx index 9950087a8e7a..7900b1db7a62 100644 --- a/registry/tools/checksingleton.cxx +++ b/registry/tools/checksingleton.cxx @@ -33,7 +33,6 @@ #include <stdio.h> #include <string.h> -#include <set> #include "registry/registry.hxx" #include "registry/reflread.hxx" #include <rtl/ustring.hxx> @@ -105,8 +104,6 @@ struct LessString } }; -typedef ::std::set< OUString, LessString > StringSet; - class Options { public: diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index d7c9c03b5d8b..f41103afb826 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -112,7 +112,7 @@ struct LessString } }; -typedef ::std::set< OUString, LessString > StringSet; +typedef ::std::set< OUString > StringSet; class Options { @@ -1270,7 +1270,7 @@ static sal_uInt32 checkFieldsWithoutOrder(const OUString& keyName, } sal_Bool bFound = sal_False; - ::std::set< sal_uInt16, ::std::less< sal_uInt16 > > moreProps; + ::std::set< sal_uInt16 > moreProps; for (i=0; i < nFields1; i++) { @@ -1533,7 +1533,7 @@ static sal_uInt32 checkBlob(const OUString& keyName, typereg::Reader& reader1, s } sal_Bool bFound = sal_False; - ::std::set< sal_uInt16, ::std::less< sal_uInt16 > > moreReferences; + ::std::set< sal_uInt16 > moreReferences; for (i=0; i < nReference1; i++) { |