24#include <com/sun/star/frame/XDesktop2.hpp>
25#include <com/sun/star/frame/XTerminateListener.hpp>
30 namespace sheet {
class XSpreadsheetDocument; }
33namespace utl {
class CloseVeto; }
42 css::uno::Reference< css::sheet::XSpreadsheetDocument >
m_xDoc;
62 void start(
const css::uno::Reference<css::uno::XInterface>& rCloseable,
63 const css::uno::Reference<css::frame::XDesktop2>& rDesktop)
92 cppu::WeakComponentImplHelperBase::disposing();
95 virtual void SAL_CALL
disposing(
const css::lang::EventObject& rEvent)
override
97 const bool bShutDown = (rEvent.Source ==
m_xDesktop);
109 virtual void construct(
const OUString& _rUrl,
110 const css::uno::Sequence< css::beans::PropertyValue >& _rInfo )
override;
116 virtual void SAL_CALL
disposing()
override;
119 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL
getMetaData( )
override;
120 virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
createCatalog()
override;
121 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL
createStatement( )
override;
122 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL
prepareStatement(
const OUString&
sql )
override;
123 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL
prepareCall(
const OUString&
sql )
override;
126 css::uno::Reference< css::sheet::XSpreadsheetDocument>
const &
acquireDoc();
132 css::uno::Reference< css::sheet::XSpreadsheetDocument>
m_xDoc;
143 const css::uno::Reference< css::sheet::XSpreadsheetDocument>&
getDoc()
const {
return m_xDoc; }
virtual void SAL_CALL disposing() override
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
css::uno::Reference< css::frame::XDesktop2 > m_xDesktop
but also listen to XDesktop and if app is terminating anyway, dispose m_xDoc while its still possible...
std::unique_ptr< utl::CloseVeto > m_pCloseListener
close listener that vetoes so nobody else disposes m_xDoc
void start(const css::uno::Reference< css::uno::XInterface > &rCloseable, const css::uno::Reference< css::frame::XDesktop2 > &rDesktop)
virtual void SAL_CALL notifyTermination(const css::lang::EventObject &) override
CloseVetoButTerminateListener()
virtual void SAL_CALL queryTermination(const css::lang::EventObject &) override
OCalcConnection * m_pConnection
css::uno::Reference< css::sheet::XSpreadsheetDocument > m_xDoc
const css::uno::Reference< css::sheet::XSpreadsheetDocument > & getDoc() const
ODocHolder(OCalcConnection *_pConnection)
css::uno::Reference< css::sheet::XSpreadsheetDocument > const & acquireDoc()
css::uno::Reference< css::sheet::XSpreadsheetDocument > m_xDoc
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
virtual void construct(const OUString &_rUrl, const css::uno::Sequence< css::beans::PropertyValue > &_rInfo) override
OCalcConnection(ODriver *_pDriver)
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual ~OCalcConnection() override
rtl::Reference< CloseVetoButTerminateListener > m_xCloseVetoButTerminateListener
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
virtual void SAL_CALL disposing() override
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
oslInterlockedCount m_nDocCount