From ba762c8c7fe208227b2be0f4b15d54f5749d1a2b Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 15 Sep 2010 10:30:26 +0200 Subject: mib19: #163566# do not fire exceptions when calling 'hasByHierarchicalName' --- stoc/source/registry_tdprovider/tdprovider.cxx | 33 ++++++++++++-------------- 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'stoc') diff --git a/stoc/source/registry_tdprovider/tdprovider.cxx b/stoc/source/registry_tdprovider/tdprovider.cxx index 1d62657beba9..2cf26706993c 100644 --- a/stoc/source/registry_tdprovider/tdprovider.cxx +++ b/stoc/source/registry_tdprovider/tdprovider.cxx @@ -172,6 +172,8 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XHierarchicalNameAccess + Any getByHierarchicalNameImpl( const OUString & rName ); + virtual Any SAL_CALL getByHierarchicalName( const OUString & rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException); @@ -223,14 +225,7 @@ Any ProviderImpl::TypeDescriptionManagerWrapper::getByHierarchicalName( sal_Bool ProviderImpl::TypeDescriptionManagerWrapper::hasByHierarchicalName( OUString const & name ) throw (RuntimeException) { - try - { - return getByHierarchicalName( name ).hasValue(); - } - catch (container::NoSuchElementException &) - { - return false; - } + return m_xTDMgr->hasByHierarchicalName( name ) || m_xThisProvider->hasByHierarchicalName( name ); } //______________________________________________________________________________ @@ -344,8 +339,7 @@ Sequence< OUString > ProviderImpl::getSupportedServiceNames() // XHierarchicalNameAccess //__________________________________________________________________________________________________ -Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) - throw(::com::sun::star::uno::RuntimeException, com::sun::star::container::NoSuchElementException) +Any ProviderImpl::getByHierarchicalNameImpl( const OUString & rName ) { Any aRet; @@ -432,7 +426,17 @@ Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) // Don't stop iteration in this case. } + catch ( NoSuchElementException const & ) + { + } } + return aRet; +} + +Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) + throw(::com::sun::star::uno::RuntimeException, com::sun::star::container::NoSuchElementException) +{ + Any aRet( getByHierarchicalNameImpl( rName ) ); if ( !aRet.hasValue() ) throw NoSuchElementException( @@ -445,14 +449,7 @@ Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) sal_Bool ProviderImpl::hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException) { - try - { - return getByHierarchicalName( rName ).hasValue(); - } - catch (NoSuchElementException &) - { - } - return sal_False; + return getByHierarchicalNameImpl( rName ).hasValue(); } // XTypeDescriptionEnumerationAccess -- cgit From 1221920d8979270644cf55c02e9202c534adb20f Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 6 Oct 2010 17:43:02 +0200 Subject: sb131: #i114962# first step of passive extension component registration (no live deployment yet) --- stoc/source/simpleregistry/textualservices.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'stoc') diff --git a/stoc/source/simpleregistry/textualservices.cxx b/stoc/source/simpleregistry/textualservices.cxx index 932c639124d0..5a50a5aa62c6 100755 --- a/stoc/source/simpleregistry/textualservices.cxx +++ b/stoc/source/simpleregistry/textualservices.cxx @@ -41,8 +41,10 @@ #include "com/sun/star/uno/XInterface.hpp" #include "cppuhelper/implbase1.hxx" #include "osl/diagnose.h" +#include "rtl/malformeduriexception.hxx" #include "rtl/ref.hxx" #include "rtl/string.h" +#include "rtl/uri.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -306,6 +308,16 @@ void Parser::handleComponent() { ": is missing \"loader\" attribute"))), css::uno::Reference< css::uno::XInterface >()); } + try { + attrUri_ = rtl::Uri::convertRelToAbs(reader_.getUrl(), attrUri_); + } catch (rtl::MalformedUriException & e) { + throw css::registry::InvalidRegistryException( + (reader_.getUrl() + + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM(": bad \"uri\" attribute: ")) + + e.getMessage()), + css::uno::Reference< css::uno::XInterface >()); + } } void Parser::handleImplementation() { -- cgit From e3d08367e9c907b94f3576f266dc8a2154414d2c Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 21 Oct 2010 15:41:41 +0200 Subject: sb131: #i114962# singleton implementations need not have a .../UNO/SERVICES rdb key --- stoc/source/implementationregistration/implreg.cxx | 84 ++++++++++------------ 1 file changed, 36 insertions(+), 48 deletions(-) (limited to 'stoc') diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 2faf13fd159c..cbb49c162fe1 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -1153,36 +1153,24 @@ static void prepareRegistry( { // update entries in SERVICES section Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys(); - OUString implName; + const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - if (serviceKeys.getLength()) - { - const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - - implName = OUString(xImplKey->getKeyName().getStr() + 1); - sal_Int32 firstDot = implName.indexOf('/'); - - if (firstDot >= 0) - implName = implName.copy(firstDot + 1); - - sal_Int32 offset = xKey->getKeyName().getLength() + 1; + OUString implName = OUString(xImplKey->getKeyName().getStr() + 1); + sal_Int32 firstDot = implName.indexOf('/'); - 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 ); @@ -1205,38 +1193,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 linkNames = xKey->getAsciiListValue(); - if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) + if (linkNames.getLength()) { - // update link entries in REGISTRY_LINKS section - Sequence 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]); } } } -- cgit