Tag: cws_src680_dba24 User: oj Date: 05/02/02 04:52:55 Modified: /dba/dbaccess/source/core/dataaccess/ databasecontext.cxx
Log: #i41887# throw NoSuchElementException File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: databasecontext.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.cxx?r1=1.26&r2=1.26.2.1 Delta lines: +17 -20 --------------------- --- databasecontext.cxx 21 Jan 2005 17:02:59 -0000 1.26 +++ databasecontext.cxx 2 Feb 2005 12:52:52 -0000 1.26.2.1 @@ -346,12 +346,11 @@ Reference< XInterface > ODatabaseContext::getRegisteredObject(const rtl::OUString& _rName) throw( Exception, RuntimeException ) { MutexGuard aGuard(m_aMutex); - if (DatabaseAccessContext_Base::rBHelper.bDisposed) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); ::rtl::OUString sURL; if ( !getURLForRegisteredObject( _rName, sURL ) ) - NoSuchElementException(); + throw NoSuchElementException(_rName, *this); if ( !sURL.getLength() ) // there is a registration for this name, but no URL @@ -367,6 +366,10 @@ // ----------------------------------------------------------------------------- Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUString& _rName,const ::rtl::OUString& _sURL) { + INetURLObject aURL( _sURL ); + if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + throw NoSuchElementException(_rName, *this); + try { ::ucb::Content aContent(_sURL,Reference< ::com::sun::star::ucb::XCommandEnvironment >()); @@ -424,8 +427,7 @@ void ODatabaseContext::registerObject(const rtl::OUString& _rName, const Reference< XInterface > & _rxObject) throw( Exception, RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed ) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); Reference< XComponent > xComponent(_rxObject,UNO_QUERY); Reference<XModel> xModel(_rxObject,UNO_QUERY); @@ -537,8 +539,7 @@ void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exception, RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed ) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); Reference< XInterface > xExistent; @@ -572,7 +573,7 @@ aDbRegisteredNamesRoot.commit(); } else - throw NoSuchElementException(); + throw NoSuchElementException(_rName,*this); // notify our container listeners ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rName), Any(), makeAny(xExistent)); @@ -593,8 +594,7 @@ sal_Bool ODatabaseContext::hasElements(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); return 0 != getElementNames().getLength(); } @@ -613,8 +613,7 @@ WrappedTargetException, RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed ) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); if ( !_rName.getLength() ) throw NoSuchElementException(_rName, *this); @@ -662,8 +661,7 @@ Sequence< rtl::OUString > ODatabaseContext::getElementNames(void) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); DECLARE_STL_USTRINGACCESS_MAP( bool , TNameMap); TNameMap aRet; @@ -684,8 +682,7 @@ sal_Bool ODatabaseContext::hasByName(const rtl::OUString& _rName) throw( RuntimeException ) { MutexGuard aGuard(m_aMutex); - if ( DatabaseAccessContext_Base::rBHelper.bDisposed) - throw DisposedException(); + ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( m_xServiceManager, getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_READONLY); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
