Tag: cws_src680_dba24 User: oj Date: 05/02/23 05:23:12 Modified: /dba/dbaccess/source/core/dataaccess/ ModelImpl.cxx, ModelImpl.hxx, databasedocument.cxx, databasedocument.hxx, datasource.cxx
Log: #i42461# change model data source concept File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: ModelImpl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.cxx?r1=1.1.2.6&r2=1.1.2.7 Delta lines: +7 -92 -------------------- --- ModelImpl.cxx 23 Feb 2005 10:18:41 -0000 1.1.2.6 +++ ModelImpl.cxx 23 Feb 2005 13:23:09 -0000 1.1.2.7 @@ -2,9 +2,9 @@ * * $RCSfile: ModelImpl.cxx,v $ * - * $Revision: 1.1.2.6 $ + * $Revision: 1.1.2.7 $ * - * last change: $Author: oj $ $Date: 2005/02/23 10:18:41 $ + * last change: $Author: oj $ $Date: 2005/02/23 13:23:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -280,6 +280,11 @@ m_aContainer.resize(4); } // ----------------------------------------------------------------------------- +::rtl::OUString ODatabaseModelImpl::getURL( ) +{ + return m_sFileURL; +} +// ----------------------------------------------------------------------------- void SAL_CALL ODatabaseModelImpl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException) { Reference<XConnection> xCon(Source.Source,UNO_QUERY); @@ -348,8 +353,6 @@ //------------------------------------------------------------------------------ void ODatabaseModelImpl::dispose() { - MutexGuard aGuard(m_aMutex); - ::std::vector<TContentPtr>::iterator aIter = m_aContainer.begin(); ::std::vector<TContentPtr>::iterator aEnd = m_aContainer.end(); for (;aIter != aEnd ; ++aIter) @@ -433,94 +436,6 @@ m_aStorages.clear(); m_bDisposingSubStorages = sal_False; -} -// ----------------------------------------------------------------------------- -::rtl::OUString SAL_CALL ODatabaseModelImpl::getURL( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_sFileURL; -} -// ----------------------------------------------------------------------------- -Sequence< PropertyValue > SAL_CALL ODatabaseModelImpl::getArgs( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_aArgs; -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODatabaseModelImpl::connectController( const Reference< XController >& _xController ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - m_aControllers.push_back(_xController); -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODatabaseModelImpl::disconnectController( const Reference< XController >& _xController ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - m_aControllers.erase(::std::find(m_aControllers.begin(),m_aControllers.end(),_xController)); - if ( m_xCurrentController == _xController ) - m_xCurrentController = NULL; -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODatabaseModelImpl::lockControllers( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - ++m_nControllerLockCount; -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODatabaseModelImpl::unlockControllers( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - --m_nControllerLockCount; -} -// ----------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseModelImpl::hasControllersLocked( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_nControllerLockCount != 0; -} -// ----------------------------------------------------------------------------- -Reference< XController > SAL_CALL ODatabaseModelImpl::getCurrentController() throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_xCurrentController.is() ? m_xCurrentController : ( m_aControllers.empty() ? Reference< XController >() : *m_aControllers.begin() ); -} -// ----------------------------------------------------------------------------- -void SAL_CALL ODatabaseModelImpl::setCurrentController( const Reference< XController >& _xController ) throw (NoSuchElementException, RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - m_xCurrentController = _xController; -} -// ----------------------------------------------------------------------------- -Reference< XInterface > SAL_CALL ODatabaseModelImpl::getCurrentSelection( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - - Reference< XInterface > xRet; - Reference< XSelectionSupplier > xDocView( getCurrentController(), UNO_QUERY ); - if ( xDocView.is() ) - xRet.set(xDocView->getSelection(),UNO_QUERY); - - return xRet; -} -// ----------------------------------------------------------------------------- - -// XStorable -sal_Bool SAL_CALL ODatabaseModelImpl::hasLocation( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_sFileURL.getLength() != 0; -} -// ----------------------------------------------------------------------------- -::rtl::OUString SAL_CALL ODatabaseModelImpl::getLocation( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_sFileURL; -} -// ----------------------------------------------------------------------------- -sal_Bool SAL_CALL ODatabaseModelImpl::isReadonly( ) throw (RuntimeException) -{ - MutexGuard aGuard(m_aMutex); - return m_bDocumentReadOnly; } // ----------------------------------------------------------------------------- Reference<XStorage> ODatabaseModelImpl::getStorage() File [changed]: ModelImpl.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.hxx?r1=1.1.2.3&r2=1.1.2.4 Delta lines: +7 -29 -------------------- --- ModelImpl.hxx 22 Feb 2005 10:07:20 -0000 1.1.2.3 +++ ModelImpl.hxx 23 Feb 2005 13:23:09 -0000 1.1.2.4 @@ -2,9 +2,9 @@ * * $RCSfile: ModelImpl.hxx,v $ * - * $Revision: 1.1.2.3 $ + * $Revision: 1.1.2.4 $ * - * last change: $Author: oj $ $Date: 2005/02/22 10:07:20 $ + * last change: $Author: oj $ $Date: 2005/02/23 13:23:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,12 +107,6 @@ #ifndef _CPPUHELPER_WEAKREF_HXX_ #include <cppuhelper/weakref.hxx> #endif -#ifndef _CPPUHELPER_IMPLBASE9_HXX_ -#include <cppuhelper/implbase9.hxx> -#endif -#ifndef _CPPUHELPER_IMPLBASE11_HXX_ -#include <cppuhelper/implbase11.hxx> -#endif #ifndef _DBASHARED_APITOOLS_HXX_ #include "apitools.hxx" #endif @@ -179,7 +173,9 @@ #ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_ #include <com/sun/star/embed/ElementModes.hpp> #endif +#ifndef _COM_SUN_STAR_EMBED_XTRANSACTIONLISTENER_HPP_ #include <com/sun/star/embed/XTransactionListener.hpp> +#endif #ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_ #include <com/sun/star/util/XRefreshable.hpp> #endif @@ -189,7 +185,6 @@ { //........................................................................ -class OSharedConnectionManager; typedef ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection > OWeakConnection; typedef std::vector< OWeakConnection > OWeakConnectionArray; @@ -197,10 +192,9 @@ //= ODatabaseModelImpl //============================================================ DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >,TStorages); -typedef ::cppu::WeakComponentImplHelperBase ODatabaseModelImpl_Base; -class ODatabaseModelImpl : public ::comphelper::OBaseMutex - , public ::rtl::IReference + +class ODatabaseModelImpl : public ::rtl::IReference { friend class ODatabaseContext; friend class OConnection; @@ -337,23 +331,7 @@ void dispose( ); -// ::com::sun::star::frame::XModel - sal_Bool SAL_CALL attachResource( const ::rtl::OUString& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::uno::RuntimeException) ; - ::rtl::OUString SAL_CALL getURL( ) throw (::com::sun::star::uno::RuntimeException) ; - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw (::com::sun::star::uno::RuntimeException) ; - void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException) ; - void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException) ; - void SAL_CALL lockControllers( ) throw (::com::sun::star::uno::RuntimeException) ; - void SAL_CALL unlockControllers( ) throw (::com::sun::star::uno::RuntimeException) ; - sal_Bool SAL_CALL hasControllersLocked( ) throw (::com::sun::star::uno::RuntimeException) ; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw (::com::sun::star::uno::RuntimeException) ; - void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException) ; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw (::com::sun::star::uno::RuntimeException) ; - -// ::com::sun::star::frame::XStorable - sal_Bool SAL_CALL hasLocation( ) throw (::com::sun::star::uno::RuntimeException) ; - ::rtl::OUString SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException) ; - sal_Bool SAL_CALL isReadonly( ) throw (::com::sun::star::uno::RuntimeException) ; + ::rtl::OUString getURL(); // ::com::sun::star::util::XModifyBroadcaster void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.8.2.7&r2=1.8.2.8 Delta lines: +88 -60 --------------------- --- databasedocument.cxx 23 Feb 2005 10:17:47 -0000 1.8.2.7 +++ databasedocument.cxx 23 Feb 2005 13:23:09 -0000 1.8.2.8 @@ -2,9 +2,9 @@ * * $RCSfile: databasedocument.cxx,v $ * - * $Revision: 1.8.2.7 $ + * $Revision: 1.8.2.8 $ * - * last change: $Author: oj $ $Date: 2005/02/23 10:17:47 $ + * last change: $Author: oj $ $Date: 2005/02/23 13:23:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -190,11 +190,11 @@ } //-------------------------------------------------------------------------- ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl ) - :ODatabaseDocument_OfficeDocument(_pImpl->m_aMutex) + :ODatabaseDocument_OfficeDocument(m_aMutex) ,m_pImpl(_pImpl) - ,m_aModifyListeners(_pImpl->m_aMutex) - ,m_aCloseListener(_pImpl->m_aMutex) - ,m_aDocEventListeners(_pImpl->m_aMutex) + ,m_aModifyListeners(m_aMutex) + ,m_aCloseListener(m_aMutex) + ,m_aDocEventListeners(m_aMutex) { DBG_CTOR(ODatabaseDocument,NULL); @@ -250,7 +250,9 @@ // ATTENTION: The Application controller attaches the same resource to force a reload. sal_Bool SAL_CALL ODatabaseDocument::attachResource( const ::rtl::OUString& _sURL, const Sequence< PropertyValue >& _aArguments ) throw (RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); try { m_pImpl->clearConnections(); @@ -351,31 +353,37 @@ ::rtl::OUString SAL_CALL ODatabaseDocument::getURL( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_sFileURL; } // ----------------------------------------------------------------------------- Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getArgs( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_aArgs; } // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::connectController( const Reference< XController >& _xController ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); m_pImpl->m_aControllers.push_back(_xController); } // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XController >& _xController ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + { + MutexGuard aGuard(m_aMutex); m_pImpl->m_aControllers.erase(::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController)); if ( m_pImpl->m_xCurrentController == _xController ) m_pImpl->m_xCurrentController = NULL; + } if ( m_pImpl->m_aControllers.empty() ) dispose(); } @@ -383,14 +391,16 @@ void SAL_CALL ODatabaseDocument::lockControllers( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); ++m_pImpl->m_nControllerLockCount; } // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::unlockControllers( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); --m_pImpl->m_nControllerLockCount; } @@ -398,7 +408,8 @@ sal_Bool SAL_CALL ODatabaseDocument::hasControllersLocked( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_nControllerLockCount != 0; } @@ -406,7 +417,8 @@ Reference< XController > SAL_CALL ODatabaseDocument::getCurrentController() throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_xCurrentController.is() ? m_pImpl->m_xCurrentController : ( m_pImpl->m_aControllers.empty() ? Reference< XController >() : *m_pImpl->m_aControllers.begin() ); } @@ -414,7 +426,8 @@ void SAL_CALL ODatabaseDocument::setCurrentController( const Reference< XController >& _xController ) throw (NoSuchElementException, RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); m_pImpl->m_xCurrentController = _xController; } @@ -422,7 +435,8 @@ Reference< XInterface > SAL_CALL ODatabaseDocument::getCurrentSelection( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); Reference< XInterface > xRet; @@ -438,7 +452,8 @@ sal_Bool SAL_CALL ODatabaseDocument::hasLocation( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_sFileURL.getLength() != 0; } @@ -446,7 +461,8 @@ ::rtl::OUString SAL_CALL ODatabaseDocument::getLocation( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_sFileURL; } @@ -454,7 +470,8 @@ sal_Bool SAL_CALL ODatabaseDocument::isReadonly( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_bDocumentReadOnly; } @@ -462,7 +479,8 @@ void SAL_CALL ODatabaseDocument::store( ) throw (IOException, RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); store(m_pImpl->m_sFileURL,m_pImpl->m_aArgs); @@ -472,6 +490,7 @@ // ----------------------------------------------------------------------------- void ODatabaseDocument::store(const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) { + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); if ( m_pImpl->m_bDocumentReadOnly ) throw IOException(); @@ -494,7 +513,8 @@ void SAL_CALL ODatabaseDocument::storeAsURL( const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) throw (IOException, RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - ClearableMutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + ClearableMutexGuard aGuard(m_aMutex); Reference<XSingleServiceFactory> xStorageFactory(m_pImpl->m_xServiceFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ),UNO_QUERY); @@ -563,7 +583,8 @@ void SAL_CALL ODatabaseDocument::storeToURL( const ::rtl::OUString& sURL, const Sequence< PropertyValue >& lArguments ) throw (IOException, RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); Reference<XSingleServiceFactory> xStorageFactory(m_pImpl->m_xServiceFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")) ),UNO_QUERY); if ( xStorageFactory.is() ) @@ -604,7 +625,8 @@ sal_Bool SAL_CALL ODatabaseDocument::isModified( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); return m_pImpl->m_bModified; } @@ -612,7 +634,7 @@ void SAL_CALL ODatabaseDocument::setModified( sal_Bool _bModified ) throw (PropertyVetoException, RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - ResettableMutexGuard _rGuard(m_pImpl->m_aMutex); + ResettableMutexGuard _rGuard(m_aMutex); if ( m_pImpl->m_bModified != _bModified ) { @@ -661,7 +683,7 @@ { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - ResettableMutexGuard _rGuard(m_pImpl->m_aMutex); + ResettableMutexGuard _rGuard(m_aMutex); lang::EventObject aEvt( static_cast< ::cppu::OWeakObject* >( this ) ); NOTIFY_LISTERNERS1(m_aCloseListener,com::sun::star::util::XCloseListener,queryClosing,bDeliverOwnership); @@ -699,7 +721,8 @@ Reference< XNameAccess > SAL_CALL ODatabaseDocument::getFormDocuments( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); Reference< XNameAccess > xContainer = m_pImpl->m_xForms; @@ -721,7 +744,8 @@ Reference< XNameAccess > SAL_CALL ODatabaseDocument::getReportDocuments( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); Reference< XNameAccess > xContainer = m_pImpl->m_xReports; @@ -955,7 +979,8 @@ Reference< ::drafts::com::sun::star::ui::XUIConfigurationManager > SAL_CALL ODatabaseDocument::getUIConfigurationManager( ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); if ( !m_xUIConfigurationManager.is() ) { @@ -999,7 +1024,8 @@ Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (RuntimeException) { ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); - MutexGuard aGuard(m_pImpl->m_aMutex); + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); + MutexGuard aGuard(m_aMutex); Reference< XStorage > xResult = m_pImpl->getStorage(aStorageName,this,nMode); @@ -1031,7 +1057,7 @@ // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::loadFromStorage( const Reference< XStorage >& xStorage, const Sequence< PropertyValue >& aMediaDescriptor ) throw (IllegalArgumentException, DoubleInitializationException, ::com::sun::star::io::IOException, Exception, RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); if ( m_pImpl->m_xStorage.is() ) throw DoubleInitializationException(); @@ -1039,7 +1065,7 @@ // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::storeToStorage( const Reference< XStorage >& xStorage, const Sequence< PropertyValue >& lArguments ) throw (IllegalArgumentException, ::com::sun::star::io::IOException, Exception, RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); Reference<XStorage> xMyStorage = getStorage(); if ( xMyStorage.is() ) @@ -1053,7 +1079,7 @@ // ----------------------------------------------------------------------------- void SAL_CALL ODatabaseDocument::switchToStorage( const Reference< XStorage >& xStorage ) throw (IllegalArgumentException, ::com::sun::star::io::IOException, Exception, RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); sal_Bool bResult = sal_False; Reference<XStorage> xMyStorage = getStorage(); @@ -1098,7 +1124,7 @@ // ----------------------------------------------------------------------------- Reference< XStorage > SAL_CALL ODatabaseDocument::getDocumentStorage( ) throw (::com::sun::star::io::IOException, Exception, RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ODatabaseDocument_OfficeDocument::rBHelper.bDisposed); return getStorage(); } @@ -1118,7 +1144,7 @@ { try { - ResettableMutexGuard _rGuard(m_pImpl->m_aMutex); + ResettableMutexGuard _rGuard(m_aMutex); if (ODatabaseDocument_OfficeDocument::rBHelper.bDisposed) throw DisposedException(); @@ -1132,6 +1158,7 @@ //------------------------------------------------------------------------------ void ODatabaseDocument::disposing() { + { notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload"))); if ( m_pChildCommitListen ) { @@ -1152,8 +1179,8 @@ xComp->removeEventListener(this); } - m_pImpl->dispose(); m_pImpl->m_xModel.clear(); + } m_pImpl.clear(); } // ----------------------------------------------------------------------------- @@ -1214,6 +1241,7 @@ // ----------------------------------------------------------------------------- Reference< XDataSource > SAL_CALL ODatabaseDocument::getDataSource() throw (RuntimeException) { + OSL_ENSURE(m_pImpl.is(),"Impl is NULL"); return m_pImpl->getDataSource(); } // ----------------------------------------------------------------------------- @@ -1231,7 +1259,7 @@ { if ( m_pImpl.is() ) { - ::osl::MutexGuard aGuard(m_pImpl->m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); TStorages::iterator aFind = m_pImpl->m_aStorages.find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database"))); Reference<XStorage> xStorage(aEvent.Source,UNO_QUERY); if ( aFind != m_pImpl->m_aStorages.end() && aFind->second == xStorage ) File [changed]: databasedocument.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.hxx?r1=1.1.2.3&r2=1.1.2.4 Delta lines: +4 -3 ------------------- --- databasedocument.hxx 22 Feb 2005 10:07:20 -0000 1.1.2.3 +++ databasedocument.hxx 23 Feb 2005 13:23:10 -0000 1.1.2.4 @@ -2,9 +2,9 @@ * * $RCSfile: databasedocument.hxx,v $ * - * $Revision: 1.1.2.3 $ + * $Revision: 1.1.2.4 $ * - * last change: $Author: oj $ $Date: 2005/02/22 10:07:20 $ + * last change: $Author: oj $ $Date: 2005/02/23 13:23:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -134,7 +134,8 @@ //, ::com::sun::star::document::XStorageBasedDocument > ODatabaseDocument_OfficeDocument; -class ODatabaseDocument : public ODatabaseDocument_OfficeDocument +class ODatabaseDocument : public ::comphelper::OBaseMutex + ,public ODatabaseDocument_OfficeDocument { friend class ODatabaseContext; friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > File [changed]: datasource.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.53.2.6&r2=1.53.2.7 Delta lines: +14 -14 --------------------- --- datasource.cxx 23 Feb 2005 07:41:47 -0000 1.53.2.6 +++ datasource.cxx 23 Feb 2005 13:23:10 -0000 1.53.2.7 @@ -2,9 +2,9 @@ * * $RCSfile: datasource.cxx,v $ * - * $Revision: 1.53.2.6 $ + * $Revision: 1.53.2.7 $ * - * last change: $Author: oj $ $Date: 2005/02/23 07:41:47 $ + * last change: $Author: oj $ $Date: 2005/02/23 13:23:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -517,11 +517,11 @@ DBG_NAME(ODatabaseSource) //-------------------------------------------------------------------------- ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl) - :OSubComponent(_pImpl->m_aMutex, Reference< XInterface >()) + :OSubComponent(m_aMutex, Reference< XInterface >()) ,OPropertySetHelper(OComponentHelper::rBHelper) - ,m_aBookmarks(*this, _pImpl->m_aMutex) + ,m_aBookmarks(*this, m_aMutex) ,m_pImpl(_pImpl) - ,m_aFlushListeners(_pImpl->m_aMutex) + ,m_aFlushListeners(m_aMutex) { // some kind of default DBG_CTOR(ODatabaseSource,NULL); @@ -652,7 +652,7 @@ OSubComponent::disposing(); OPropertySetHelper::disposing(); - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); EventObject aDisposeEvent(static_cast<XWeak*>(this)); m_aFlushListeners.disposeAndClear( aDisposeEvent ); @@ -940,7 +940,7 @@ //------------------------------------------------------------------------------ void ODatabaseSource::setLoginTimeout(sal_Int32 seconds) throw( SQLException, RuntimeException ) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); m_pImpl->m_nLoginTimeout = seconds; } @@ -975,7 +975,7 @@ // ----------------------------------------------------------------------------- Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const Reference< XInteractionHandler >& _rxHandler,sal_Bool _bIsolated ) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); if (!_rxHandler.is()) @@ -1012,7 +1012,7 @@ // handle the request try { - MutexRelease aRelease(m_pImpl->m_aMutex); + MutexRelease aRelease(m_aMutex); // release the mutex when calling the handler, it may need to lock the SolarMutex _rxHandler->handle(xRequest); } @@ -1069,7 +1069,7 @@ //------------------------------------------------------------------------------ Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& user, const rtl::OUString& password,sal_Bool _bIsolated) throw( SQLException, RuntimeException ) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); Reference< XConnection > xConn; @@ -1101,14 +1101,14 @@ //------------------------------------------------------------------------------ Reference< XNameAccess > SAL_CALL ODatabaseSource::getBookmarks( ) throw (RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); return static_cast< XNameContainer* >(&m_aBookmarks); } //------------------------------------------------------------------------------ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw(RuntimeException) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); Reference< XNameAccess > xContainer = m_pImpl->m_xCommandDefinitions; if ( !xContainer.is() ) { @@ -1144,7 +1144,7 @@ //------------------------------------------------------------------------------ Reference< XNameAccess > ODatabaseSource::getTables() throw( RuntimeException ) { - MutexGuard aGuard(m_pImpl->m_aMutex); + MutexGuard aGuard(m_aMutex); Reference< XNameAccess > xContainer = m_pImpl->m_xTableDefinitions; if ( !xContainer.is() ) { @@ -1162,7 +1162,7 @@ { try { - ResettableMutexGuard _rGuard(m_pImpl->m_aMutex); + ResettableMutexGuard _rGuard(m_aMutex); ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); Reference< css::frame::XStorable> xStorable(m_pImpl->getModel(),UNO_QUERY); if ( xStorable.is() ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
