summaryrefslogtreecommitdiff
path: root/connectivity/source/inc/calc
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-05 15:31:51 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-05 15:31:51 +0000
commit31c8b868a3a9ea1b8ddefaa88986b48ade85c84f (patch)
tree6301074ec4c9880165836331f44699c610be9804 /connectivity/source/inc/calc
parent98ad3b47fb65d313bd5038fab08b38e9b5bee4b8 (diff)
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
Diffstat (limited to 'connectivity/source/inc/calc')
-rw-r--r--connectivity/source/inc/calc/CConnection.hxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/connectivity/source/inc/calc/CConnection.hxx b/connectivity/source/inc/calc/CConnection.hxx
index 2d3c462b2e..ad13525888 100644
--- a/connectivity/source/inc/calc/CConnection.hxx
+++ b/connectivity/source/inc/calc/CConnection.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: CConnection.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 06:59:05 $
+ * last change: $Author: kz $ $Date: 2008-03-05 16:31:51 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -54,6 +54,9 @@ namespace connectivity
{
// 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 @@ namespace connectivity
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; }
+ };
};
}
}