diff options
Diffstat (limited to 'stoc/source/implementationregistration/implreg.cxx')
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 109 |
1 files changed, 52 insertions, 57 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 94be3f1670e7..7ae7b28918cb 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -606,9 +606,9 @@ static void deleteUserLink(const Reference < XRegistryKey >& xRootKey, } else { oldImpl = implEntries.getConstArray()[0]; - + rtl::OUString path(xOldKey->getKeyName()); xOldKey->closeKey(); - xRootKey->deleteKey(xOldKey->getKeyName()); + xRootKey->deleteKey(path); } OUString oldTarget = searchLinkTargetForImpl(xRootKey, linkName, oldImpl); @@ -622,8 +622,9 @@ static void deleteUserLink(const Reference < XRegistryKey >& xRootKey, { bClean = sal_True; hasNoImplementations = sal_False; + rtl::OUString path(xOldKey->getKeyName()); xOldKey->closeKey(); - xRootKey->deleteKey(xOldKey->getKeyName()); + xRootKey->deleteKey(path); } } } else @@ -784,21 +785,24 @@ static void deleteAllImplementations( const Reference < XSimpleRegistry >& xRe if (hasLocationUrl) { hasLocationUrl = sal_False; + rtl::OUString path(xImplKey->getKeyName()); xImplKey->closeKey(); - xReg->getRootKey()->deleteKey(xImplKey->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } subKeys = xSource->openKeys(); if (subKeys.getLength() == 0) { + rtl::OUString path(xSource->getKeyName()); xSource->closeKey(); - xReg->getRootKey()->deleteKey(xSource->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } else { + rtl::OUString path(xSource->getKeyName()); xSource->closeKey(); - xReg->getRootKey()->deleteKey(xSource->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } @@ -923,21 +927,24 @@ static void deleteAllServiceEntries( const Reference < XSimpleRegistry >& xRe if (hasNoImplementations) { hasNoImplementations = sal_False; + rtl::OUString path(xServiceKey->getKeyName()); xServiceKey->closeKey(); - xReg->getRootKey()->deleteKey(xServiceKey->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } subKeys = xSource->openKeys(); if (subKeys.getLength() == 0) { + rtl::OUString path(xSource->getKeyName()); xSource->closeKey(); - xReg->getRootKey()->deleteKey(xSource->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } else { + rtl::OUString path(xSource->getKeyName()); xSource->closeKey(); - xReg->getRootKey()->deleteKey(xSource->getKeyName()); + xReg->getRootKey()->deleteKey(path); } } @@ -1122,36 +1129,24 @@ static void prepareRegistry( { // update entries in SERVICES section Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys(); - OUString implName; - - if (serviceKeys.getLength()) - { - const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - - implName = OUString(xImplKey->getKeyName().getStr() + 1); - sal_Int32 firstDot = implName.indexOf('/'); + const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - if (firstDot >= 0) - implName = implName.copy(firstDot + 1); + OUString implName = OUString(xImplKey->getKeyName().getStr() + 1); + sal_Int32 firstDot = implName.indexOf('/'); - sal_Int32 offset = xKey->getKeyName().getLength() + 1; - - for (sal_Int32 j = 0; j < serviceKeys.getLength(); j++) - { - OUString serviceName = pServiceKeys[j]->getKeyName().copy(offset); + if (firstDot >= 0) + implName = implName.copy(firstDot + 1); - createUniqueSubEntry( - xDest->getRootKey()->createKey( - pool.slash_SERVICES + serviceName ), - implName); - } + sal_Int32 offset = xKey->getKeyName().getLength() + 1; - } - else + for (sal_Int32 j = 0; j < serviceKeys.getLength(); j++) { - throw InvalidRegistryException( - OUString( RTL_CONSTASCII_USTRINGPARAM( "prepareRegistry(): no service names given by component" ) ), - Reference< XInterface > () ); + OUString serviceName = pServiceKeys[j]->getKeyName().copy(offset); + + createUniqueSubEntry( + xDest->getRootKey()->createKey( + pool.slash_SERVICES + serviceName ), + implName); } xKey = xImplKey->openKey( pool.slash_UNO ); @@ -1174,38 +1169,38 @@ static void prepareRegistry( } } } + } - // update LOCATION entry - xKey = xImplKey->createKey( pool.slash_UNO_slash_LOCATION ); + // update LOCATION entry + xKey = xImplKey->createKey( pool.slash_UNO_slash_LOCATION ); - if (xKey.is()) - { - xKey->setAsciiValue(locationUrl); - } + if (xKey.is()) + { + xKey->setAsciiValue(locationUrl); + } - // update ACTIVATOR entry - xKey = xImplKey->createKey( pool.slash_UNO_slash_ACTIVATOR ); + // update ACTIVATOR entry + xKey = xImplKey->createKey( pool.slash_UNO_slash_ACTIVATOR ); - if (xKey.is()) - { - xKey->setAsciiValue(implementationLoaderUrl); - } + if (xKey.is()) + { + xKey->setAsciiValue(implementationLoaderUrl); + } - xKey = xImplKey->openKey( pool.slash_UNO_slash_SERVICES ); + xKey = xImplKey->openKey( pool.slash_UNO_slash_SERVICES ); + + if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) + { + // update link entries in REGISTRY_LINKS section + Sequence<OUString> linkNames = xKey->getAsciiListValue(); - if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) + if (linkNames.getLength()) { - // update link entries in REGISTRY_LINKS section - Sequence<OUString> linkNames = xKey->getAsciiListValue(); + const OUString* pLinkNames = linkNames.getConstArray(); - if (linkNames.getLength()) + for (sal_Int32 j = 0; j < linkNames.getLength(); j++) { - const OUString* pLinkNames = linkNames.getConstArray(); - - for (sal_Int32 j = 0; j < linkNames.getLength(); j++) - { - prepareLink(xDest, xImplKey, pLinkNames[j]); - } + prepareLink(xDest, xImplKey, pLinkNames[j]); } } } |