User: hr      
Date: 05/09/23 05:05:41

Modified:
 /dba/dbaccess/source/core/dataaccess/
  datasource.hxx

Log:
 INTEGRATION: CWS dba201b (1.30.2); FILE MERGED
 2005/09/21 07:01:54 oj 1.30.2.2: RESYNC: (1.30-1.31); FILE MERGED
 2005/07/20 10:17:22 fs 1.30.2.1: #i52171# better control over model ownership

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: datasource.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.hxx?r1=1.31&r2=1.32
Delta lines:  +21 -6
--------------------
--- datasource.hxx      8 Sep 2005 13:29:08 -0000       1.31
+++ datasource.hxx      23 Sep 2005 12:05:38 -0000      1.32
@@ -145,6 +145,9 @@
 #ifndef _DBA_COREDATAACCESS_MODELIMPL_HXX_
 #include "ModelImpl.hxx"
 #endif
+#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+#include <unotools/sharedunocomponent.hxx>
+#endif
 
 //........................................................................
 namespace dbaccess
@@ -185,15 +188,19 @@
        friend ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XInterface >
                ODatabaseSource_CreateInstance(const 
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory 
>&);
 
-protected:
+private:
+    typedef ::utl::SharedUNOComponent< ::com::sun::star::frame::XModel, 
::utl::CloseableComponent >
+                                                SharedModel;
+
     ::rtl::Reference<ODatabaseModelImpl>       m_pImpl;
     OBookmarkContainer                                 m_aBookmarks;    
     ::cppu::OInterfaceContainerHelper          m_aFlushListeners;
 
        void setMeAsParent(const ::com::sun::star::uno::Reference< 
::com::sun::star::container::XNameAccess >& _xName);
 
-protected:
+private:
        virtual ~ODatabaseSource();
+
 public:
        ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl);
        
@@ -277,7 +284,7 @@
     // XDocumentDataSource
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::XOfficeDatabaseDocument > SAL_CALL getDatabaseDocument() 
throw (::com::sun::star::uno::RuntimeException);
 
-protected:
+private:
 // helper
        /** open a connection for the current settings. this is the simple 
connection we get from the driver
                manager, so it can be used as a master for a "high level" sdb 
connection.
@@ -290,9 +297,17 @@
                const rtl::OUString& user, const rtl::OUString& password
                );
 
-    /// see the implementation for an explanation for the method's name ...
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
-        getModelWithPossibleLeak();
+    /** retrieves the model we belong to
+
+        If the model does not yet exist, it is created 
(->OModelImpl::createNewModel_deliverOwnership).
+        Using the SharedModel implies that when 
<arg>_bTakeOwnershipIfNewlyCreated</arg> is <TRUE/>, then when the
+        returned SharedModel dies (and has not been shared with other 
SharedModels in the meantime),
+        then a close attempt for the XModel is made.
+
+        If there already exists a model, 
<arg>_bTakeOwnershipIfNewlyCreated</arg> is ignored,
+        and ownership of the model is not taken.
+    */
+    SharedModel impl_getModel( bool _bTakeOwnershipIfNewlyCreated );
 
 // other stuff
        void    flushTables();




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to