summaryrefslogtreecommitdiffstats
path: root/stoc
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2010-09-15 10:30:26 +0200
committerChristian Lippka <cl@openoffice.org>2010-09-15 10:30:26 +0200
commitba762c8c7fe208227b2be0f4b15d54f5749d1a2b (patch)
tree8ca0da18755e848682dc52bdd2007db8b0c3c625 /stoc
parentmib19: #163573# NativeObjectWrapper implementation (deactivated) (diff)
downloadcore-ba762c8c7fe208227b2be0f4b15d54f5749d1a2b.tar.gz
core-ba762c8c7fe208227b2be0f4b15d54f5749d1a2b.zip
mib19: #163566# do not fire exceptions when calling 'hasByHierarchicalName'
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/registry_tdprovider/tdprovider.cxx33
1 files changed, 15 insertions, 18 deletions
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