21#include <com/sun/star/beans/XPropertySet.hpp>
22#include <com/sun/star/lang/XComponent.hpp>
23#include <com/sun/star/sdbc/XRowSet.hpp>
24#include <com/sun/star/sdbc/XConnection.hpp>
25#include <osl/diagnose.h>
33 using namespace css::uno;
34 using namespace css::beans;
35 using namespace css::sdbc;
36 using namespace css::lang;
41 :m_xRowSet( _rxRowSet )
42 ,m_bRSListening( false )
43 ,m_bPropertyListening( false )
45 Reference< XPropertySet > xProps(_rxRowSet, UNO_QUERY);
46 OSL_ENSURE(xProps.is(),
"OAutoConnectionDisposer::OAutoConnectionDisposer: invalid rowset (no XPropertySet)!");
59 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"OAutoConnectionDisposer::OAutoConnectionDisposer" );
73 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"OAutoConnectionDisposer::startPropertyListening" );
81 Reference< XInterface > xKeepAlive(getXWeak());
85 OSL_ENSURE( _rxEventSource.is(),
"OAutoConnectionDisposer::stopPropertyListening: invalid event source (no XPropertySet)!" );
86 if ( _rxEventSource.is() )
94 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"OAutoConnectionDisposer::stopPropertyListening" );
101 OSL_ENSURE( !
m_bRSListening,
"OAutoConnectionDisposer::startRowSetListening: already listening!" );
109 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"OAutoConnectionDisposer::startRowSetListening" );
117 OSL_ENSURE(
m_bRSListening,
"OAutoConnectionDisposer::stopRowSetListening: not listening!" );
124 TOOLS_WARN_EXCEPTION(
"connectivity.commontools",
"OAutoConnectionDisposer::stopRowSetListening" );
137 Reference< XConnection > xNewConnection;
138 _rEvent.NewValue >>= xNewConnection;
172#if OSL_DEBUG_LEVEL > 0
173 Reference< XConnection > xOldConnection;
174 _rEvent.OldValue >>= xOldConnection;
175 OSL_ENSURE( xOldConnection.get() ==
m_xOriginalConnection.get(),
"OAutoConnectionDisposer::propertyChange: unexpected (original) property value!" );
#define TOOLS_WARN_EXCEPTION(area, stream)