User: kz      
Date: 2008-03-05 16:31:53+0000
Modified:
   dba/connectivity/source/inc/calc/CConnection.hxx

Log:
 INTEGRATION: CWS dba30a (1.2.352); FILE MERGED
 2008/02/14 09:51:47 oj 1.2.352.1: #i9899# refcount of doc inside the 
connection, will be released when the last table has gone

File Changes:

Directory: /dba/connectivity/source/inc/calc/
=============================================

File [changed]: CConnection.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/calc/CConnection.hxx?r1=1.2&r2=1.3
Delta lines:  +22 -2
--------------------
--- CConnection.hxx     2005-09-08 06:59:05+0000        1.2
+++ CConnection.hxx     2008-03-05 16:31:51+0000        1.3
@@ -54,6 +54,9 @@
                {
                        // the spreadsheet document:
                        ::com::sun::star::uno::Reference< 
::com::sun::star::sheet::XSpreadsheetDocument > m_xDoc;
+            ::rtl::OUString     m_sPassword;
+            String              m_aFileName;
+            oslInterlockedCount m_nDocCount;
 
                public:
                        OCalcConnection(ODriver* _pDriver);
@@ -77,8 +80,25 @@
                        virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const 
::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
 
                        // no interface methods
-                       ::com::sun::star::uno::Reference< 
::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const
-                               { return m_xDoc; }
+                       ::com::sun::star::uno::Reference< 
::com::sun::star::sheet::XSpreadsheetDocument> acquireDoc();
+            void releaseDoc();
+
+            class ODocHolder
+            {
+                OCalcConnection* m_pConnection;
+                ::com::sun::star::uno::Reference< 
::com::sun::star::sheet::XSpreadsheetDocument> m_xDoc;
+            public:
+                ODocHolder(OCalcConnection* _pConnection) : 
m_pConnection(_pConnection)
+                {
+                    m_xDoc = m_pConnection->acquireDoc();
+                }
+                ~ODocHolder()
+                {
+                    m_xDoc = NULL;
+                    m_pConnection->releaseDoc();
+                }
+                ::com::sun::star::uno::Reference< 
::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const { return m_xDoc; }
+            };
                };
        }
 }




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

Reply via email to