12f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
32f86921cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
42f86921cSAndrew Rist * or more contributor license agreements. See the NOTICE file
52f86921cSAndrew Rist * distributed with this work for additional information
62f86921cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
72f86921cSAndrew Rist * to you under the Apache License, Version 2.0 (the
82f86921cSAndrew Rist * "License"); you may not use this file except in compliance
92f86921cSAndrew Rist * with the License. You may obtain a copy of the License at
102f86921cSAndrew Rist *
112f86921cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
122f86921cSAndrew Rist *
132f86921cSAndrew Rist * Unless required by applicable law or agreed to in writing,
142f86921cSAndrew Rist * software distributed under the License is distributed on an
152f86921cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162f86921cSAndrew Rist * KIND, either express or implied. See the License for the
172f86921cSAndrew Rist * specific language governing permissions and limitations
182f86921cSAndrew Rist * under the License.
192f86921cSAndrew Rist *
202f86921cSAndrew Rist *************************************************************/
212f86921cSAndrew Rist
222f86921cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25*421ed02eSdamjan #include "precompiled_cacher.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <contentresultsetwrapper.hxx>
28cdf0e10cSrcweir #include <com/sun/star/sdbc/FetchDirection.hpp>
29cdf0e10cSrcweir #include <com/sun/star/ucb/FetchError.hpp>
30cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
31cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetType.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/DisposedException.hpp>
33cdf0e10cSrcweir #include <rtl/ustring.hxx>
34cdf0e10cSrcweir #include <osl/diagnose.h>
35cdf0e10cSrcweir
36cdf0e10cSrcweir using namespace com::sun::star::beans;
37cdf0e10cSrcweir using namespace com::sun::star::lang;
38cdf0e10cSrcweir using namespace com::sun::star::sdbc;
39cdf0e10cSrcweir using namespace com::sun::star::ucb;
40cdf0e10cSrcweir using namespace com::sun::star::uno;
41cdf0e10cSrcweir using namespace com::sun::star::util;
42cdf0e10cSrcweir using namespace cppu;
43cdf0e10cSrcweir using namespace rtl;
44cdf0e10cSrcweir
45cdf0e10cSrcweir //--------------------------------------------------------------------------
46cdf0e10cSrcweir //--------------------------------------------------------------------------
47cdf0e10cSrcweir // class ContentResultSetWrapper
48cdf0e10cSrcweir //--------------------------------------------------------------------------
49cdf0e10cSrcweir //--------------------------------------------------------------------------
50cdf0e10cSrcweir
ContentResultSetWrapper(Reference<XResultSet> xOrigin)51cdf0e10cSrcweir ContentResultSetWrapper::ContentResultSetWrapper(
52cdf0e10cSrcweir Reference< XResultSet > xOrigin )
53cdf0e10cSrcweir : m_xResultSetOrigin( xOrigin )
54cdf0e10cSrcweir , m_xRowOrigin( NULL )
55cdf0e10cSrcweir , m_xContentAccessOrigin( NULL )
56cdf0e10cSrcweir , m_xPropertySetOrigin( NULL )
57cdf0e10cSrcweir , m_xPropertySetInfo( NULL )
58cdf0e10cSrcweir , m_nForwardOnly( 2 )
59cdf0e10cSrcweir , m_xMetaDataFromOrigin( NULL )
60cdf0e10cSrcweir , m_bDisposed( sal_False )
61cdf0e10cSrcweir , m_bInDispose( sal_False )
62cdf0e10cSrcweir , m_pDisposeEventListeners( NULL )
63cdf0e10cSrcweir , m_pPropertyChangeListeners( NULL )
64cdf0e10cSrcweir , m_pVetoableChangeListeners( NULL )
65cdf0e10cSrcweir {
66cdf0e10cSrcweir m_pMyListenerImpl = new ContentResultSetWrapperListener( this );
67cdf0e10cSrcweir m_xMyListenerImpl = Reference< XPropertyChangeListener >( m_pMyListenerImpl );
68cdf0e10cSrcweir
69cdf0e10cSrcweir OSL_ENSURE( m_xResultSetOrigin.is(), "XResultSet is required" );
70cdf0e10cSrcweir
71cdf0e10cSrcweir //!! call impl_init() at the end of constructor of derived class
72cdf0e10cSrcweir };
73cdf0e10cSrcweir
74cdf0e10cSrcweir
impl_init_xRowOrigin()75cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper::impl_init_xRowOrigin()
76cdf0e10cSrcweir {
77cdf0e10cSrcweir {
78cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
79cdf0e10cSrcweir if(m_xRowOrigin.is())
80cdf0e10cSrcweir return;
81cdf0e10cSrcweir }
82cdf0e10cSrcweir
83cdf0e10cSrcweir Reference< XRow > xOrgig =
84cdf0e10cSrcweir Reference< XRow >( m_xResultSetOrigin, UNO_QUERY );
85cdf0e10cSrcweir
86cdf0e10cSrcweir {
87cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
88cdf0e10cSrcweir m_xRowOrigin = xOrgig;
89cdf0e10cSrcweir OSL_ENSURE( m_xRowOrigin.is(), "interface XRow is required" );
90cdf0e10cSrcweir }
91cdf0e10cSrcweir }
92cdf0e10cSrcweir
impl_init_xContentAccessOrigin()93cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper::impl_init_xContentAccessOrigin()
94cdf0e10cSrcweir {
95cdf0e10cSrcweir {
96cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
97cdf0e10cSrcweir if(m_xContentAccessOrigin.is())
98cdf0e10cSrcweir return;
99cdf0e10cSrcweir }
100cdf0e10cSrcweir
101cdf0e10cSrcweir Reference< XContentAccess > xOrgig =
102cdf0e10cSrcweir Reference< XContentAccess >( m_xResultSetOrigin, UNO_QUERY );
103cdf0e10cSrcweir
104cdf0e10cSrcweir {
105cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
106cdf0e10cSrcweir m_xContentAccessOrigin = xOrgig;
107cdf0e10cSrcweir OSL_ENSURE( m_xContentAccessOrigin.is(), "interface XContentAccess is required" );
108cdf0e10cSrcweir }
109cdf0e10cSrcweir }
110cdf0e10cSrcweir
111cdf0e10cSrcweir
impl_init_xPropertySetOrigin()112cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper::impl_init_xPropertySetOrigin()
113cdf0e10cSrcweir {
114cdf0e10cSrcweir {
115cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
116cdf0e10cSrcweir if( m_xPropertySetOrigin.is() )
117cdf0e10cSrcweir return;
118cdf0e10cSrcweir }
119cdf0e10cSrcweir
120cdf0e10cSrcweir Reference< XPropertySet > xOrig =
121cdf0e10cSrcweir Reference< XPropertySet >( m_xResultSetOrigin, UNO_QUERY );
122cdf0e10cSrcweir
123cdf0e10cSrcweir {
124cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
125cdf0e10cSrcweir m_xPropertySetOrigin = xOrig;
126cdf0e10cSrcweir OSL_ENSURE( m_xPropertySetOrigin.is(), "interface XPropertySet is required" );
127cdf0e10cSrcweir }
128cdf0e10cSrcweir }
129cdf0e10cSrcweir
impl_init()130cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper::impl_init()
131cdf0e10cSrcweir {
132cdf0e10cSrcweir //call this at the end of constructor of derived class
133cdf0e10cSrcweir //
134cdf0e10cSrcweir
135cdf0e10cSrcweir //listen to disposing from Origin:
136cdf0e10cSrcweir Reference< XComponent > xComponentOrigin( m_xResultSetOrigin, UNO_QUERY );
137cdf0e10cSrcweir OSL_ENSURE( xComponentOrigin.is(), "interface XComponent is required" );
138cdf0e10cSrcweir xComponentOrigin->addEventListener( static_cast< XPropertyChangeListener * >( m_pMyListenerImpl ) );
139cdf0e10cSrcweir }
140cdf0e10cSrcweir
~ContentResultSetWrapper()141cdf0e10cSrcweir ContentResultSetWrapper::~ContentResultSetWrapper()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir //call impl_deinit() at start of destructor of derived class
144cdf0e10cSrcweir
145cdf0e10cSrcweir delete m_pDisposeEventListeners;
146cdf0e10cSrcweir delete m_pPropertyChangeListeners;
147cdf0e10cSrcweir delete m_pVetoableChangeListeners;
148cdf0e10cSrcweir };
149cdf0e10cSrcweir
impl_deinit()150cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper::impl_deinit()
151cdf0e10cSrcweir {
152cdf0e10cSrcweir //call this at start of destructor of derived class
153cdf0e10cSrcweir //
154cdf0e10cSrcweir m_pMyListenerImpl->impl_OwnerDies();
155cdf0e10cSrcweir }
156cdf0e10cSrcweir
157cdf0e10cSrcweir //virtual
158cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_initPropertySetInfo()159cdf0e10cSrcweir ::impl_initPropertySetInfo()
160cdf0e10cSrcweir {
161cdf0e10cSrcweir {
162cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
163cdf0e10cSrcweir if( m_xPropertySetInfo.is() )
164cdf0e10cSrcweir return;
165cdf0e10cSrcweir
166cdf0e10cSrcweir impl_init_xPropertySetOrigin();
167cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
168cdf0e10cSrcweir return;
169cdf0e10cSrcweir }
170cdf0e10cSrcweir
171cdf0e10cSrcweir Reference< XPropertySetInfo > xOrig =
172cdf0e10cSrcweir m_xPropertySetOrigin->getPropertySetInfo();
173cdf0e10cSrcweir
174cdf0e10cSrcweir {
175cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
176cdf0e10cSrcweir m_xPropertySetInfo = xOrig;
177cdf0e10cSrcweir }
178cdf0e10cSrcweir }
179cdf0e10cSrcweir
180cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_EnsureNotDisposed()181cdf0e10cSrcweir ::impl_EnsureNotDisposed()
182cdf0e10cSrcweir throw( DisposedException, RuntimeException )
183cdf0e10cSrcweir {
184cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
185cdf0e10cSrcweir if( m_bDisposed )
186cdf0e10cSrcweir throw DisposedException();
187cdf0e10cSrcweir }
188cdf0e10cSrcweir
189cdf0e10cSrcweir ContentResultSetWrapper::PropertyChangeListenerContainer_Impl* SAL_CALL
190cdf0e10cSrcweir ContentResultSetWrapper
impl_getPropertyChangeListenerContainer()191cdf0e10cSrcweir ::impl_getPropertyChangeListenerContainer()
192cdf0e10cSrcweir {
193cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
194cdf0e10cSrcweir if ( !m_pPropertyChangeListeners )
195cdf0e10cSrcweir m_pPropertyChangeListeners =
196cdf0e10cSrcweir new PropertyChangeListenerContainer_Impl( m_aContainerMutex );
197cdf0e10cSrcweir return m_pPropertyChangeListeners;
198cdf0e10cSrcweir }
199cdf0e10cSrcweir
200cdf0e10cSrcweir ContentResultSetWrapper::PropertyChangeListenerContainer_Impl* SAL_CALL
201cdf0e10cSrcweir ContentResultSetWrapper
impl_getVetoableChangeListenerContainer()202cdf0e10cSrcweir ::impl_getVetoableChangeListenerContainer()
203cdf0e10cSrcweir {
204cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
205cdf0e10cSrcweir if ( !m_pVetoableChangeListeners )
206cdf0e10cSrcweir m_pVetoableChangeListeners =
207cdf0e10cSrcweir new PropertyChangeListenerContainer_Impl( m_aContainerMutex );
208cdf0e10cSrcweir return m_pVetoableChangeListeners;
209cdf0e10cSrcweir }
210cdf0e10cSrcweir
211cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_notifyPropertyChangeListeners(const PropertyChangeEvent & rEvt)212cdf0e10cSrcweir ::impl_notifyPropertyChangeListeners(
213cdf0e10cSrcweir const PropertyChangeEvent& rEvt )
214cdf0e10cSrcweir {
215cdf0e10cSrcweir {
216cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
217cdf0e10cSrcweir if( !m_pPropertyChangeListeners )
218cdf0e10cSrcweir return;
219cdf0e10cSrcweir }
220cdf0e10cSrcweir
221cdf0e10cSrcweir // Notify listeners interested especially in the changed property.
222cdf0e10cSrcweir OInterfaceContainerHelper* pContainer =
223cdf0e10cSrcweir m_pPropertyChangeListeners->getContainer( rEvt.PropertyName );
224cdf0e10cSrcweir if( pContainer )
225cdf0e10cSrcweir {
226cdf0e10cSrcweir OInterfaceIteratorHelper aIter( *pContainer );
227cdf0e10cSrcweir while( aIter.hasMoreElements() )
228cdf0e10cSrcweir {
229cdf0e10cSrcweir Reference< XPropertyChangeListener > xListener(
230cdf0e10cSrcweir aIter.next(), UNO_QUERY );
231cdf0e10cSrcweir if( xListener.is() )
232cdf0e10cSrcweir xListener->propertyChange( rEvt );
233cdf0e10cSrcweir }
234cdf0e10cSrcweir }
235cdf0e10cSrcweir
236cdf0e10cSrcweir // Notify listeners interested in all properties.
237cdf0e10cSrcweir pContainer = m_pPropertyChangeListeners->getContainer( OUString() );
238cdf0e10cSrcweir if( pContainer )
239cdf0e10cSrcweir {
240cdf0e10cSrcweir OInterfaceIteratorHelper aIter( *pContainer );
241cdf0e10cSrcweir while( aIter.hasMoreElements() )
242cdf0e10cSrcweir {
243cdf0e10cSrcweir Reference< XPropertyChangeListener > xListener(
244cdf0e10cSrcweir aIter.next(), UNO_QUERY );
245cdf0e10cSrcweir if( xListener.is() )
246cdf0e10cSrcweir xListener->propertyChange( rEvt );
247cdf0e10cSrcweir }
248cdf0e10cSrcweir }
249cdf0e10cSrcweir }
250cdf0e10cSrcweir
251cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_notifyVetoableChangeListeners(const PropertyChangeEvent & rEvt)252cdf0e10cSrcweir ::impl_notifyVetoableChangeListeners( const PropertyChangeEvent& rEvt )
253cdf0e10cSrcweir throw( PropertyVetoException,
254cdf0e10cSrcweir RuntimeException )
255cdf0e10cSrcweir {
256cdf0e10cSrcweir {
257cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
258cdf0e10cSrcweir if( !m_pVetoableChangeListeners )
259cdf0e10cSrcweir return;
260cdf0e10cSrcweir }
261cdf0e10cSrcweir
262cdf0e10cSrcweir // Notify listeners interested especially in the changed property.
263cdf0e10cSrcweir OInterfaceContainerHelper* pContainer =
264cdf0e10cSrcweir m_pVetoableChangeListeners->getContainer( rEvt.PropertyName );
265cdf0e10cSrcweir if( pContainer )
266cdf0e10cSrcweir {
267cdf0e10cSrcweir OInterfaceIteratorHelper aIter( *pContainer );
268cdf0e10cSrcweir while( aIter.hasMoreElements() )
269cdf0e10cSrcweir {
270cdf0e10cSrcweir Reference< XVetoableChangeListener > xListener(
271cdf0e10cSrcweir aIter.next(), UNO_QUERY );
272cdf0e10cSrcweir if( xListener.is() )
273cdf0e10cSrcweir xListener->vetoableChange( rEvt );
274cdf0e10cSrcweir }
275cdf0e10cSrcweir }
276cdf0e10cSrcweir
277cdf0e10cSrcweir // Notify listeners interested in all properties.
278cdf0e10cSrcweir pContainer = m_pVetoableChangeListeners->getContainer( OUString() );
279cdf0e10cSrcweir if( pContainer )
280cdf0e10cSrcweir {
281cdf0e10cSrcweir OInterfaceIteratorHelper aIter( *pContainer );
282cdf0e10cSrcweir while( aIter.hasMoreElements() )
283cdf0e10cSrcweir {
284cdf0e10cSrcweir Reference< XVetoableChangeListener > xListener(
285cdf0e10cSrcweir aIter.next(), UNO_QUERY );
286cdf0e10cSrcweir if( xListener.is() )
287cdf0e10cSrcweir xListener->vetoableChange( rEvt );
288cdf0e10cSrcweir }
289cdf0e10cSrcweir }
290cdf0e10cSrcweir }
291cdf0e10cSrcweir
292cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
impl_isForwardOnly()293cdf0e10cSrcweir ::impl_isForwardOnly()
294cdf0e10cSrcweir {
295cdf0e10cSrcweir //m_nForwardOnly == 2 -> don't know
296cdf0e10cSrcweir //m_nForwardOnly == 1 -> YES
297cdf0e10cSrcweir //m_nForwardOnly == 0 -> NO
298cdf0e10cSrcweir
299cdf0e10cSrcweir //@todo replace this with lines in comment
300cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
301cdf0e10cSrcweir m_nForwardOnly = 0;
302cdf0e10cSrcweir return false;
303cdf0e10cSrcweir
304cdf0e10cSrcweir
305cdf0e10cSrcweir /*
306cdf0e10cSrcweir ReacquireableGuard aGuard( m_aMutex );
307cdf0e10cSrcweir if( m_nForwardOnly == 2 )
308cdf0e10cSrcweir {
309cdf0e10cSrcweir aGuard.clear();
310cdf0e10cSrcweir if( !getPropertySetInfo().is() )
311cdf0e10cSrcweir {
312cdf0e10cSrcweir aGuard.reacquire();
313cdf0e10cSrcweir m_nForwardOnly = 0;
314cdf0e10cSrcweir return m_nForwardOnly;
315cdf0e10cSrcweir }
316cdf0e10cSrcweir aGuard.reacquire();
317cdf0e10cSrcweir
318cdf0e10cSrcweir rtl::OUString aName = OUString::createFromAscii( "ResultSetType" );
319cdf0e10cSrcweir //find out, if we are ForwardOnly and cache the value:
320cdf0e10cSrcweir
321cdf0e10cSrcweir impl_init_xPropertySetOrigin();
322cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
323cdf0e10cSrcweir {
324cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
325cdf0e10cSrcweir m_nForwardOnly = 0;
326cdf0e10cSrcweir return m_nForwardOnly;
327cdf0e10cSrcweir }
328cdf0e10cSrcweir
329cdf0e10cSrcweir aGuard.clear();
330cdf0e10cSrcweir Any aAny = m_xPropertySetOrigin->getPropertyValue( aName );
331cdf0e10cSrcweir
332cdf0e10cSrcweir aGuard.reacquire();
333cdf0e10cSrcweir long nResultSetType;
334cdf0e10cSrcweir if( ( aAny >>= nResultSetType ) &&
335cdf0e10cSrcweir ( nResultSetType == ResultSetType::FORWARD_ONLY ) )
336cdf0e10cSrcweir m_nForwardOnly = 1;
337cdf0e10cSrcweir else
338cdf0e10cSrcweir m_nForwardOnly = 0;
339cdf0e10cSrcweir }
340cdf0e10cSrcweir return m_nForwardOnly;
341cdf0e10cSrcweir */
342cdf0e10cSrcweir }
343cdf0e10cSrcweir
344cdf0e10cSrcweir //--------------------------------------------------------------------------
345cdf0e10cSrcweir // XInterface methods.
346cdf0e10cSrcweir //--------------------------------------------------------------------------
347cdf0e10cSrcweir //list all interfaces inclusive baseclasses of interfaces
348cdf0e10cSrcweir QUERYINTERFACE_IMPL_START( ContentResultSetWrapper )
349cdf0e10cSrcweir
SAL_STATIC_CAST(XComponent *,this)350cdf0e10cSrcweir SAL_STATIC_CAST( XComponent*, this ),
351cdf0e10cSrcweir SAL_STATIC_CAST( XCloseable*, this ),
352cdf0e10cSrcweir SAL_STATIC_CAST( XResultSetMetaDataSupplier*, this ),
353cdf0e10cSrcweir SAL_STATIC_CAST( XPropertySet*, this ),
354cdf0e10cSrcweir
355cdf0e10cSrcweir SAL_STATIC_CAST( XContentAccess*, this ),
356cdf0e10cSrcweir SAL_STATIC_CAST( XResultSet*, this ),
357cdf0e10cSrcweir SAL_STATIC_CAST( XRow*, this )
358cdf0e10cSrcweir
359cdf0e10cSrcweir QUERYINTERFACE_IMPL_END
360cdf0e10cSrcweir
361cdf0e10cSrcweir //--------------------------------------------------------------------------
362cdf0e10cSrcweir // XComponent methods.
363cdf0e10cSrcweir //--------------------------------------------------------------------------
364cdf0e10cSrcweir // virtual
365cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
366cdf0e10cSrcweir ::dispose() throw( RuntimeException )
367cdf0e10cSrcweir {
368cdf0e10cSrcweir impl_EnsureNotDisposed();
369cdf0e10cSrcweir
370cdf0e10cSrcweir ReacquireableGuard aGuard( m_aMutex );
371cdf0e10cSrcweir if( m_bInDispose || m_bDisposed )
372cdf0e10cSrcweir return;
373cdf0e10cSrcweir m_bInDispose = sal_True;
374cdf0e10cSrcweir
375cdf0e10cSrcweir if( m_xPropertySetOrigin.is() )
376cdf0e10cSrcweir {
377cdf0e10cSrcweir aGuard.clear();
378cdf0e10cSrcweir try
379cdf0e10cSrcweir {
380cdf0e10cSrcweir m_xPropertySetOrigin->removePropertyChangeListener(
381cdf0e10cSrcweir OUString(), static_cast< XPropertyChangeListener * >( m_pMyListenerImpl ) );
382cdf0e10cSrcweir }
383cdf0e10cSrcweir catch( Exception& )
384cdf0e10cSrcweir {
385cdf0e10cSrcweir OSL_ENSURE( sal_False, "could not remove PropertyChangeListener" );
386cdf0e10cSrcweir }
387cdf0e10cSrcweir try
388cdf0e10cSrcweir {
389cdf0e10cSrcweir m_xPropertySetOrigin->removeVetoableChangeListener(
390cdf0e10cSrcweir OUString(), static_cast< XVetoableChangeListener * >( m_pMyListenerImpl ) );
391cdf0e10cSrcweir }
392cdf0e10cSrcweir catch( Exception& )
393cdf0e10cSrcweir {
394cdf0e10cSrcweir OSL_ENSURE( sal_False, "could not remove VetoableChangeListener" );
395cdf0e10cSrcweir }
396cdf0e10cSrcweir
397cdf0e10cSrcweir Reference< XComponent > xComponentOrigin( m_xResultSetOrigin, UNO_QUERY );
398cdf0e10cSrcweir OSL_ENSURE( xComponentOrigin.is(), "interface XComponent is required" );
399cdf0e10cSrcweir xComponentOrigin->removeEventListener( static_cast< XPropertyChangeListener * >( m_pMyListenerImpl ) );
400cdf0e10cSrcweir }
401cdf0e10cSrcweir
402cdf0e10cSrcweir aGuard.reacquire();
403cdf0e10cSrcweir if( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() )
404cdf0e10cSrcweir {
405cdf0e10cSrcweir EventObject aEvt;
406cdf0e10cSrcweir aEvt.Source = static_cast< XComponent * >( this );
407cdf0e10cSrcweir
408cdf0e10cSrcweir aGuard.clear();
409cdf0e10cSrcweir m_pDisposeEventListeners->disposeAndClear( aEvt );
410cdf0e10cSrcweir }
411cdf0e10cSrcweir
412cdf0e10cSrcweir aGuard.reacquire();
413cdf0e10cSrcweir if( m_pPropertyChangeListeners )
414cdf0e10cSrcweir {
415cdf0e10cSrcweir EventObject aEvt;
416cdf0e10cSrcweir aEvt.Source = static_cast< XPropertySet * >( this );
417cdf0e10cSrcweir
418cdf0e10cSrcweir aGuard.clear();
419cdf0e10cSrcweir m_pPropertyChangeListeners->disposeAndClear( aEvt );
420cdf0e10cSrcweir }
421cdf0e10cSrcweir
422cdf0e10cSrcweir aGuard.reacquire();
423cdf0e10cSrcweir if( m_pVetoableChangeListeners )
424cdf0e10cSrcweir {
425cdf0e10cSrcweir EventObject aEvt;
426cdf0e10cSrcweir aEvt.Source = static_cast< XPropertySet * >( this );
427cdf0e10cSrcweir
428cdf0e10cSrcweir aGuard.clear();
429cdf0e10cSrcweir m_pVetoableChangeListeners->disposeAndClear( aEvt );
430cdf0e10cSrcweir }
431cdf0e10cSrcweir
432cdf0e10cSrcweir aGuard.reacquire();
433cdf0e10cSrcweir m_bDisposed = sal_True;
434cdf0e10cSrcweir m_bInDispose = sal_False;
435cdf0e10cSrcweir }
436cdf0e10cSrcweir
437cdf0e10cSrcweir //--------------------------------------------------------------------------
438cdf0e10cSrcweir // virtual
439cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
addEventListener(const Reference<XEventListener> & Listener)440cdf0e10cSrcweir ::addEventListener( const Reference< XEventListener >& Listener )
441cdf0e10cSrcweir throw( RuntimeException )
442cdf0e10cSrcweir {
443cdf0e10cSrcweir impl_EnsureNotDisposed();
444cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
445cdf0e10cSrcweir
446cdf0e10cSrcweir if ( !m_pDisposeEventListeners )
447cdf0e10cSrcweir m_pDisposeEventListeners =
448cdf0e10cSrcweir new OInterfaceContainerHelper( m_aContainerMutex );
449cdf0e10cSrcweir
450cdf0e10cSrcweir m_pDisposeEventListeners->addInterface( Listener );
451cdf0e10cSrcweir }
452cdf0e10cSrcweir
453cdf0e10cSrcweir //--------------------------------------------------------------------------
454cdf0e10cSrcweir // virtual
455cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
removeEventListener(const Reference<XEventListener> & Listener)456cdf0e10cSrcweir ::removeEventListener( const Reference< XEventListener >& Listener )
457cdf0e10cSrcweir throw( RuntimeException )
458cdf0e10cSrcweir {
459cdf0e10cSrcweir impl_EnsureNotDisposed();
460cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
461cdf0e10cSrcweir
462cdf0e10cSrcweir if ( m_pDisposeEventListeners )
463cdf0e10cSrcweir m_pDisposeEventListeners->removeInterface( Listener );
464cdf0e10cSrcweir }
465cdf0e10cSrcweir
466cdf0e10cSrcweir //--------------------------------------------------------------------------
467cdf0e10cSrcweir //XCloseable methods.
468cdf0e10cSrcweir //--------------------------------------------------------------------------
469cdf0e10cSrcweir //virtual
470cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
close()471cdf0e10cSrcweir ::close()
472cdf0e10cSrcweir throw( SQLException,
473cdf0e10cSrcweir RuntimeException )
474cdf0e10cSrcweir {
475cdf0e10cSrcweir impl_EnsureNotDisposed();
476cdf0e10cSrcweir dispose();
477cdf0e10cSrcweir }
478cdf0e10cSrcweir
479cdf0e10cSrcweir //--------------------------------------------------------------------------
480cdf0e10cSrcweir //XResultSetMetaDataSupplier methods.
481cdf0e10cSrcweir //--------------------------------------------------------------------------
482cdf0e10cSrcweir //virtual
483cdf0e10cSrcweir Reference< XResultSetMetaData > SAL_CALL ContentResultSetWrapper
getMetaData()484cdf0e10cSrcweir ::getMetaData()
485cdf0e10cSrcweir throw( SQLException,
486cdf0e10cSrcweir RuntimeException )
487cdf0e10cSrcweir {
488cdf0e10cSrcweir impl_EnsureNotDisposed();
489cdf0e10cSrcweir
490cdf0e10cSrcweir ReacquireableGuard aGuard( m_aMutex );
491cdf0e10cSrcweir if( !m_xMetaDataFromOrigin.is() && m_xResultSetOrigin.is() )
492cdf0e10cSrcweir {
493cdf0e10cSrcweir Reference< XResultSetMetaDataSupplier > xMetaDataSupplier
494cdf0e10cSrcweir = Reference< XResultSetMetaDataSupplier >(
495cdf0e10cSrcweir m_xResultSetOrigin, UNO_QUERY );
496cdf0e10cSrcweir
497cdf0e10cSrcweir if( xMetaDataSupplier.is() )
498cdf0e10cSrcweir {
499cdf0e10cSrcweir aGuard.clear();
500cdf0e10cSrcweir
501cdf0e10cSrcweir Reference< XResultSetMetaData > xMetaData
502cdf0e10cSrcweir = xMetaDataSupplier->getMetaData();
503cdf0e10cSrcweir
504cdf0e10cSrcweir aGuard.reacquire();
505cdf0e10cSrcweir m_xMetaDataFromOrigin = xMetaData;
506cdf0e10cSrcweir }
507cdf0e10cSrcweir }
508cdf0e10cSrcweir return m_xMetaDataFromOrigin;
509cdf0e10cSrcweir }
510cdf0e10cSrcweir
511cdf0e10cSrcweir
512cdf0e10cSrcweir //--------------------------------------------------------------------------
513cdf0e10cSrcweir // XPropertySet methods.
514cdf0e10cSrcweir //--------------------------------------------------------------------------
515cdf0e10cSrcweir // virtual
516cdf0e10cSrcweir Reference< XPropertySetInfo > SAL_CALL ContentResultSetWrapper
getPropertySetInfo()517cdf0e10cSrcweir ::getPropertySetInfo() throw( RuntimeException )
518cdf0e10cSrcweir {
519cdf0e10cSrcweir impl_EnsureNotDisposed();
520cdf0e10cSrcweir {
521cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
522cdf0e10cSrcweir if( m_xPropertySetInfo.is() )
523cdf0e10cSrcweir return m_xPropertySetInfo;
524cdf0e10cSrcweir }
525cdf0e10cSrcweir impl_initPropertySetInfo();
526cdf0e10cSrcweir return m_xPropertySetInfo;
527cdf0e10cSrcweir }
528cdf0e10cSrcweir //--------------------------------------------------------------------------
529cdf0e10cSrcweir // virtual
530cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
setPropertyValue(const OUString & rPropertyName,const Any & rValue)531cdf0e10cSrcweir ::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
532cdf0e10cSrcweir throw( UnknownPropertyException,
533cdf0e10cSrcweir PropertyVetoException,
534cdf0e10cSrcweir IllegalArgumentException,
535cdf0e10cSrcweir WrappedTargetException,
536cdf0e10cSrcweir RuntimeException )
537cdf0e10cSrcweir {
538cdf0e10cSrcweir impl_EnsureNotDisposed();
539cdf0e10cSrcweir impl_init_xPropertySetOrigin();
540cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
541cdf0e10cSrcweir {
542cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
543cdf0e10cSrcweir throw UnknownPropertyException();
544cdf0e10cSrcweir }
545cdf0e10cSrcweir m_xPropertySetOrigin->setPropertyValue( rPropertyName, rValue );
546cdf0e10cSrcweir }
547cdf0e10cSrcweir
548cdf0e10cSrcweir //--------------------------------------------------------------------------
549cdf0e10cSrcweir // virtual
550cdf0e10cSrcweir Any SAL_CALL ContentResultSetWrapper
getPropertyValue(const OUString & rPropertyName)551cdf0e10cSrcweir ::getPropertyValue( const OUString& rPropertyName )
552cdf0e10cSrcweir throw( UnknownPropertyException,
553cdf0e10cSrcweir WrappedTargetException,
554cdf0e10cSrcweir RuntimeException )
555cdf0e10cSrcweir {
556cdf0e10cSrcweir impl_EnsureNotDisposed();
557cdf0e10cSrcweir impl_init_xPropertySetOrigin();
558cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
559cdf0e10cSrcweir {
560cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
561cdf0e10cSrcweir throw UnknownPropertyException();
562cdf0e10cSrcweir }
563cdf0e10cSrcweir return m_xPropertySetOrigin->getPropertyValue( rPropertyName );
564cdf0e10cSrcweir }
565cdf0e10cSrcweir
566cdf0e10cSrcweir //--------------------------------------------------------------------------
567cdf0e10cSrcweir // virtual
568cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
addPropertyChangeListener(const OUString & aPropertyName,const Reference<XPropertyChangeListener> & xListener)569cdf0e10cSrcweir ::addPropertyChangeListener(
570cdf0e10cSrcweir const OUString& aPropertyName,
571cdf0e10cSrcweir const Reference< XPropertyChangeListener >& xListener )
572cdf0e10cSrcweir throw( UnknownPropertyException,
573cdf0e10cSrcweir WrappedTargetException,
574cdf0e10cSrcweir RuntimeException )
575cdf0e10cSrcweir {
576cdf0e10cSrcweir impl_EnsureNotDisposed();
577cdf0e10cSrcweir
578cdf0e10cSrcweir if( !getPropertySetInfo().is() )
579cdf0e10cSrcweir {
580cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
581cdf0e10cSrcweir throw UnknownPropertyException();
582cdf0e10cSrcweir }
583cdf0e10cSrcweir
584cdf0e10cSrcweir if( aPropertyName.getLength() )
585cdf0e10cSrcweir {
586cdf0e10cSrcweir m_xPropertySetInfo->getPropertyByName( aPropertyName );
587cdf0e10cSrcweir //throws UnknownPropertyException, if so
588cdf0e10cSrcweir }
589cdf0e10cSrcweir
590cdf0e10cSrcweir impl_getPropertyChangeListenerContainer();
591cdf0e10cSrcweir sal_Bool bNeedRegister = !m_pPropertyChangeListeners->
592cdf0e10cSrcweir getContainedTypes().getLength();
593cdf0e10cSrcweir m_pPropertyChangeListeners->addInterface( aPropertyName, xListener );
594cdf0e10cSrcweir if( bNeedRegister )
595cdf0e10cSrcweir {
596cdf0e10cSrcweir impl_init_xPropertySetOrigin();
597cdf0e10cSrcweir {
598cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
599cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
600cdf0e10cSrcweir {
601cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
602cdf0e10cSrcweir return;
603cdf0e10cSrcweir }
604cdf0e10cSrcweir }
605cdf0e10cSrcweir try
606cdf0e10cSrcweir {
607cdf0e10cSrcweir m_xPropertySetOrigin->addPropertyChangeListener(
608cdf0e10cSrcweir OUString(), static_cast< XPropertyChangeListener * >( m_pMyListenerImpl ) );
609cdf0e10cSrcweir }
610cdf0e10cSrcweir catch( Exception& rEx )
611cdf0e10cSrcweir {
612cdf0e10cSrcweir m_pPropertyChangeListeners->removeInterface( aPropertyName, xListener );
613cdf0e10cSrcweir throw rEx;
614cdf0e10cSrcweir }
615cdf0e10cSrcweir }
616cdf0e10cSrcweir }
617cdf0e10cSrcweir
618cdf0e10cSrcweir //--------------------------------------------------------------------------
619cdf0e10cSrcweir // virtual
620cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
addVetoableChangeListener(const OUString & rPropertyName,const Reference<XVetoableChangeListener> & xListener)621cdf0e10cSrcweir ::addVetoableChangeListener(
622cdf0e10cSrcweir const OUString& rPropertyName,
623cdf0e10cSrcweir const Reference< XVetoableChangeListener >& xListener )
624cdf0e10cSrcweir throw( UnknownPropertyException,
625cdf0e10cSrcweir WrappedTargetException,
626cdf0e10cSrcweir RuntimeException )
627cdf0e10cSrcweir {
628cdf0e10cSrcweir impl_EnsureNotDisposed();
629cdf0e10cSrcweir
630cdf0e10cSrcweir if( !getPropertySetInfo().is() )
631cdf0e10cSrcweir {
632cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
633cdf0e10cSrcweir throw UnknownPropertyException();
634cdf0e10cSrcweir }
635cdf0e10cSrcweir if( rPropertyName.getLength() )
636cdf0e10cSrcweir {
637cdf0e10cSrcweir m_xPropertySetInfo->getPropertyByName( rPropertyName );
638cdf0e10cSrcweir //throws UnknownPropertyException, if so
639cdf0e10cSrcweir }
640cdf0e10cSrcweir
641cdf0e10cSrcweir impl_getVetoableChangeListenerContainer();
642cdf0e10cSrcweir sal_Bool bNeedRegister = !m_pVetoableChangeListeners->
643cdf0e10cSrcweir getContainedTypes().getLength();
644cdf0e10cSrcweir m_pVetoableChangeListeners->addInterface( rPropertyName, xListener );
645cdf0e10cSrcweir if( bNeedRegister )
646cdf0e10cSrcweir {
647cdf0e10cSrcweir impl_init_xPropertySetOrigin();
648cdf0e10cSrcweir {
649cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
650cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
651cdf0e10cSrcweir {
652cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
653cdf0e10cSrcweir return;
654cdf0e10cSrcweir }
655cdf0e10cSrcweir }
656cdf0e10cSrcweir try
657cdf0e10cSrcweir {
658cdf0e10cSrcweir m_xPropertySetOrigin->addVetoableChangeListener(
659cdf0e10cSrcweir OUString(), static_cast< XVetoableChangeListener * >( m_pMyListenerImpl ) );
660cdf0e10cSrcweir }
661cdf0e10cSrcweir catch( Exception& rEx )
662cdf0e10cSrcweir {
663cdf0e10cSrcweir m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener );
664cdf0e10cSrcweir throw rEx;
665cdf0e10cSrcweir }
666cdf0e10cSrcweir }
667cdf0e10cSrcweir }
668cdf0e10cSrcweir
669cdf0e10cSrcweir //--------------------------------------------------------------------------
670cdf0e10cSrcweir // virtual
671cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
removePropertyChangeListener(const OUString & rPropertyName,const Reference<XPropertyChangeListener> & xListener)672cdf0e10cSrcweir ::removePropertyChangeListener(
673cdf0e10cSrcweir const OUString& rPropertyName,
674cdf0e10cSrcweir const Reference< XPropertyChangeListener >& xListener )
675cdf0e10cSrcweir throw( UnknownPropertyException,
676cdf0e10cSrcweir WrappedTargetException,
677cdf0e10cSrcweir RuntimeException )
678cdf0e10cSrcweir {
679cdf0e10cSrcweir impl_EnsureNotDisposed();
680cdf0e10cSrcweir
681cdf0e10cSrcweir {
682cdf0e10cSrcweir //noop, if no listener registered
683cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
684cdf0e10cSrcweir if( !m_pPropertyChangeListeners )
685cdf0e10cSrcweir return;
686cdf0e10cSrcweir }
687cdf0e10cSrcweir OInterfaceContainerHelper* pContainer =
688cdf0e10cSrcweir m_pPropertyChangeListeners->getContainer( rPropertyName );
689cdf0e10cSrcweir
690cdf0e10cSrcweir if( !pContainer )
691cdf0e10cSrcweir {
692cdf0e10cSrcweir if( rPropertyName.getLength() )
693cdf0e10cSrcweir {
694cdf0e10cSrcweir if( !getPropertySetInfo().is() )
695cdf0e10cSrcweir throw UnknownPropertyException();
696cdf0e10cSrcweir
697cdf0e10cSrcweir m_xPropertySetInfo->getPropertyByName( rPropertyName );
698cdf0e10cSrcweir //throws UnknownPropertyException, if so
699cdf0e10cSrcweir }
700cdf0e10cSrcweir return; //the listener was not registered
701cdf0e10cSrcweir }
702cdf0e10cSrcweir
703cdf0e10cSrcweir m_pPropertyChangeListeners->removeInterface( rPropertyName, xListener );
704cdf0e10cSrcweir
705cdf0e10cSrcweir if( !m_pPropertyChangeListeners->getContainedTypes().getLength() )
706cdf0e10cSrcweir {
707cdf0e10cSrcweir impl_init_xPropertySetOrigin();
708cdf0e10cSrcweir {
709cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
710cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
711cdf0e10cSrcweir {
712cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
713cdf0e10cSrcweir return;
714cdf0e10cSrcweir }
715cdf0e10cSrcweir }
716cdf0e10cSrcweir try
717cdf0e10cSrcweir {
718cdf0e10cSrcweir m_xPropertySetOrigin->removePropertyChangeListener(
719cdf0e10cSrcweir OUString(), static_cast< XPropertyChangeListener * >( m_pMyListenerImpl ) );
720cdf0e10cSrcweir }
721cdf0e10cSrcweir catch( Exception& )
722cdf0e10cSrcweir {
723cdf0e10cSrcweir OSL_ENSURE( sal_False, "could not remove PropertyChangeListener" );
724cdf0e10cSrcweir }
725cdf0e10cSrcweir }
726cdf0e10cSrcweir }
727cdf0e10cSrcweir
728cdf0e10cSrcweir //--------------------------------------------------------------------------
729cdf0e10cSrcweir // virtual
730cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
removeVetoableChangeListener(const OUString & rPropertyName,const Reference<XVetoableChangeListener> & xListener)731cdf0e10cSrcweir ::removeVetoableChangeListener(
732cdf0e10cSrcweir const OUString& rPropertyName,
733cdf0e10cSrcweir const Reference< XVetoableChangeListener >& xListener )
734cdf0e10cSrcweir throw( UnknownPropertyException,
735cdf0e10cSrcweir WrappedTargetException,
736cdf0e10cSrcweir RuntimeException )
737cdf0e10cSrcweir {
738cdf0e10cSrcweir impl_EnsureNotDisposed();
739cdf0e10cSrcweir
740cdf0e10cSrcweir {
741cdf0e10cSrcweir //noop, if no listener registered
742cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
743cdf0e10cSrcweir if( !m_pVetoableChangeListeners )
744cdf0e10cSrcweir return;
745cdf0e10cSrcweir }
746cdf0e10cSrcweir OInterfaceContainerHelper* pContainer =
747cdf0e10cSrcweir m_pVetoableChangeListeners->getContainer( rPropertyName );
748cdf0e10cSrcweir
749cdf0e10cSrcweir if( !pContainer )
750cdf0e10cSrcweir {
751cdf0e10cSrcweir if( rPropertyName.getLength() )
752cdf0e10cSrcweir {
753cdf0e10cSrcweir if( !getPropertySetInfo().is() )
754cdf0e10cSrcweir throw UnknownPropertyException();
755cdf0e10cSrcweir
756cdf0e10cSrcweir m_xPropertySetInfo->getPropertyByName( rPropertyName );
757cdf0e10cSrcweir //throws UnknownPropertyException, if so
758cdf0e10cSrcweir }
759cdf0e10cSrcweir return; //the listener was not registered
760cdf0e10cSrcweir }
761cdf0e10cSrcweir
762cdf0e10cSrcweir m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener );
763cdf0e10cSrcweir
764cdf0e10cSrcweir if( !m_pVetoableChangeListeners->getContainedTypes().getLength() )
765cdf0e10cSrcweir {
766cdf0e10cSrcweir impl_init_xPropertySetOrigin();
767cdf0e10cSrcweir {
768cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
769cdf0e10cSrcweir if( !m_xPropertySetOrigin.is() )
770cdf0e10cSrcweir {
771cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
772cdf0e10cSrcweir return;
773cdf0e10cSrcweir }
774cdf0e10cSrcweir }
775cdf0e10cSrcweir try
776cdf0e10cSrcweir {
777cdf0e10cSrcweir m_xPropertySetOrigin->removeVetoableChangeListener(
778cdf0e10cSrcweir OUString(), static_cast< XVetoableChangeListener * >( m_pMyListenerImpl ) );
779cdf0e10cSrcweir }
780cdf0e10cSrcweir catch( Exception& )
781cdf0e10cSrcweir {
782cdf0e10cSrcweir OSL_ENSURE( sal_False, "could not remove VetoableChangeListener" );
783cdf0e10cSrcweir }
784cdf0e10cSrcweir }
785cdf0e10cSrcweir }
786cdf0e10cSrcweir
787cdf0e10cSrcweir //--------------------------------------------------------------------------
788cdf0e10cSrcweir // own methods.
789cdf0e10cSrcweir //--------------------------------------------------------------------------
790cdf0e10cSrcweir
791cdf0e10cSrcweir //virtual
792cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_disposing(const EventObject &)793cdf0e10cSrcweir ::impl_disposing( const EventObject& )
794cdf0e10cSrcweir throw( RuntimeException )
795cdf0e10cSrcweir {
796cdf0e10cSrcweir impl_EnsureNotDisposed();
797cdf0e10cSrcweir
798cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex );
799cdf0e10cSrcweir
800cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
801cdf0e10cSrcweir return;
802cdf0e10cSrcweir
803cdf0e10cSrcweir //release all references to the broadcaster:
804cdf0e10cSrcweir m_xResultSetOrigin.clear();
805cdf0e10cSrcweir if(m_xRowOrigin.is())
806cdf0e10cSrcweir m_xRowOrigin.clear();
807cdf0e10cSrcweir if(m_xContentAccessOrigin.is())
808cdf0e10cSrcweir m_xContentAccessOrigin.clear();
809cdf0e10cSrcweir if(m_xPropertySetOrigin.is())
810cdf0e10cSrcweir m_xPropertySetOrigin.clear();
811cdf0e10cSrcweir m_xMetaDataFromOrigin.clear();
812cdf0e10cSrcweir if(m_xPropertySetInfo.is())
813cdf0e10cSrcweir m_xPropertySetInfo.clear();
814cdf0e10cSrcweir }
815cdf0e10cSrcweir
816cdf0e10cSrcweir //virtual
817cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_propertyChange(const PropertyChangeEvent & rEvt)818cdf0e10cSrcweir ::impl_propertyChange( const PropertyChangeEvent& rEvt )
819cdf0e10cSrcweir throw( RuntimeException )
820cdf0e10cSrcweir {
821cdf0e10cSrcweir impl_EnsureNotDisposed();
822cdf0e10cSrcweir
823cdf0e10cSrcweir PropertyChangeEvent aEvt( rEvt );
824cdf0e10cSrcweir aEvt.Source = static_cast< XPropertySet * >( this );
825cdf0e10cSrcweir aEvt.Further = sal_False;
826cdf0e10cSrcweir impl_notifyPropertyChangeListeners( aEvt );
827cdf0e10cSrcweir }
828cdf0e10cSrcweir
829cdf0e10cSrcweir //virtual
830cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
impl_vetoableChange(const PropertyChangeEvent & rEvt)831cdf0e10cSrcweir ::impl_vetoableChange( const PropertyChangeEvent& rEvt )
832cdf0e10cSrcweir throw( PropertyVetoException,
833cdf0e10cSrcweir RuntimeException )
834cdf0e10cSrcweir {
835cdf0e10cSrcweir impl_EnsureNotDisposed();
836cdf0e10cSrcweir
837cdf0e10cSrcweir PropertyChangeEvent aEvt( rEvt );
838cdf0e10cSrcweir aEvt.Source = static_cast< XPropertySet * >( this );
839cdf0e10cSrcweir aEvt.Further = sal_False;
840cdf0e10cSrcweir
841cdf0e10cSrcweir impl_notifyVetoableChangeListeners( aEvt );
842cdf0e10cSrcweir }
843cdf0e10cSrcweir
844cdf0e10cSrcweir //--------------------------------------------------------------------------
845cdf0e10cSrcweir // XContentAccess methods. ( -- position dependent )
846cdf0e10cSrcweir //--------------------------------------------------------------------------
847cdf0e10cSrcweir
848cdf0e10cSrcweir // virtual
849cdf0e10cSrcweir OUString SAL_CALL ContentResultSetWrapper
queryContentIdentifierString()850cdf0e10cSrcweir ::queryContentIdentifierString()
851cdf0e10cSrcweir throw( RuntimeException )
852cdf0e10cSrcweir {
853cdf0e10cSrcweir impl_EnsureNotDisposed();
854cdf0e10cSrcweir impl_init_xContentAccessOrigin();
855cdf0e10cSrcweir if( !m_xContentAccessOrigin.is() )
856cdf0e10cSrcweir {
857cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
858cdf0e10cSrcweir throw RuntimeException();
859cdf0e10cSrcweir }
860cdf0e10cSrcweir return m_xContentAccessOrigin->queryContentIdentifierString();
861cdf0e10cSrcweir }
862cdf0e10cSrcweir
863cdf0e10cSrcweir //--------------------------------------------------------------------------
864cdf0e10cSrcweir // virtual
865cdf0e10cSrcweir Reference< XContentIdentifier > SAL_CALL ContentResultSetWrapper
queryContentIdentifier()866cdf0e10cSrcweir ::queryContentIdentifier()
867cdf0e10cSrcweir throw( RuntimeException )
868cdf0e10cSrcweir {
869cdf0e10cSrcweir impl_EnsureNotDisposed();
870cdf0e10cSrcweir impl_init_xContentAccessOrigin();
871cdf0e10cSrcweir if( !m_xContentAccessOrigin.is() )
872cdf0e10cSrcweir {
873cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
874cdf0e10cSrcweir throw RuntimeException();
875cdf0e10cSrcweir }
876cdf0e10cSrcweir return m_xContentAccessOrigin->queryContentIdentifier();
877cdf0e10cSrcweir }
878cdf0e10cSrcweir
879cdf0e10cSrcweir //--------------------------------------------------------------------------
880cdf0e10cSrcweir // virtual
881cdf0e10cSrcweir Reference< XContent > SAL_CALL ContentResultSetWrapper
queryContent()882cdf0e10cSrcweir ::queryContent()
883cdf0e10cSrcweir throw( RuntimeException )
884cdf0e10cSrcweir {
885cdf0e10cSrcweir impl_EnsureNotDisposed();
886cdf0e10cSrcweir impl_init_xContentAccessOrigin();
887cdf0e10cSrcweir if( !m_xContentAccessOrigin.is() )
888cdf0e10cSrcweir {
889cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
890cdf0e10cSrcweir throw RuntimeException();
891cdf0e10cSrcweir }
892cdf0e10cSrcweir return m_xContentAccessOrigin->queryContent();
893cdf0e10cSrcweir }
894cdf0e10cSrcweir
895cdf0e10cSrcweir //-----------------------------------------------------------------
896cdf0e10cSrcweir // XResultSet methods.
897cdf0e10cSrcweir //-----------------------------------------------------------------
898cdf0e10cSrcweir //virtual
899cdf0e10cSrcweir
900cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
next()901cdf0e10cSrcweir ::next()
902cdf0e10cSrcweir throw( SQLException,
903cdf0e10cSrcweir RuntimeException )
904cdf0e10cSrcweir {
905cdf0e10cSrcweir impl_EnsureNotDisposed();
906cdf0e10cSrcweir
907cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
908cdf0e10cSrcweir {
909cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
910cdf0e10cSrcweir throw RuntimeException();
911cdf0e10cSrcweir }
912cdf0e10cSrcweir return m_xResultSetOrigin->next();
913cdf0e10cSrcweir }
914cdf0e10cSrcweir
915cdf0e10cSrcweir //virtual
916cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
previous()917cdf0e10cSrcweir ::previous()
918cdf0e10cSrcweir throw( SQLException,
919cdf0e10cSrcweir RuntimeException )
920cdf0e10cSrcweir {
921cdf0e10cSrcweir impl_EnsureNotDisposed();
922cdf0e10cSrcweir
923cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
924cdf0e10cSrcweir {
925cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
926cdf0e10cSrcweir throw RuntimeException();
927cdf0e10cSrcweir }
928cdf0e10cSrcweir return m_xResultSetOrigin->previous();
929cdf0e10cSrcweir }
930cdf0e10cSrcweir
931cdf0e10cSrcweir //virtual
932cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
absolute(sal_Int32 row)933cdf0e10cSrcweir ::absolute( sal_Int32 row )
934cdf0e10cSrcweir throw( SQLException,
935cdf0e10cSrcweir RuntimeException )
936cdf0e10cSrcweir {
937cdf0e10cSrcweir impl_EnsureNotDisposed();
938cdf0e10cSrcweir
939cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
940cdf0e10cSrcweir {
941cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
942cdf0e10cSrcweir throw RuntimeException();
943cdf0e10cSrcweir }
944cdf0e10cSrcweir return m_xResultSetOrigin->absolute( row );
945cdf0e10cSrcweir }
946cdf0e10cSrcweir
947cdf0e10cSrcweir //virtual
948cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
relative(sal_Int32 rows)949cdf0e10cSrcweir ::relative( sal_Int32 rows )
950cdf0e10cSrcweir throw( SQLException,
951cdf0e10cSrcweir RuntimeException )
952cdf0e10cSrcweir {
953cdf0e10cSrcweir impl_EnsureNotDisposed();
954cdf0e10cSrcweir
955cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
956cdf0e10cSrcweir {
957cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
958cdf0e10cSrcweir throw RuntimeException();
959cdf0e10cSrcweir }
960cdf0e10cSrcweir return m_xResultSetOrigin->relative( rows );
961cdf0e10cSrcweir }
962cdf0e10cSrcweir
963cdf0e10cSrcweir
964cdf0e10cSrcweir //virtual
965cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
first()966cdf0e10cSrcweir ::first()
967cdf0e10cSrcweir throw( SQLException,
968cdf0e10cSrcweir RuntimeException )
969cdf0e10cSrcweir {
970cdf0e10cSrcweir impl_EnsureNotDisposed();
971cdf0e10cSrcweir
972cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
973cdf0e10cSrcweir {
974cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
975cdf0e10cSrcweir throw RuntimeException();
976cdf0e10cSrcweir }
977cdf0e10cSrcweir return m_xResultSetOrigin->first();
978cdf0e10cSrcweir }
979cdf0e10cSrcweir
980cdf0e10cSrcweir //virtual
981cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
last()982cdf0e10cSrcweir ::last()
983cdf0e10cSrcweir throw( SQLException,
984cdf0e10cSrcweir RuntimeException )
985cdf0e10cSrcweir {
986cdf0e10cSrcweir impl_EnsureNotDisposed();
987cdf0e10cSrcweir
988cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
989cdf0e10cSrcweir {
990cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
991cdf0e10cSrcweir throw RuntimeException();
992cdf0e10cSrcweir }
993cdf0e10cSrcweir return m_xResultSetOrigin->last();
994cdf0e10cSrcweir }
995cdf0e10cSrcweir
996cdf0e10cSrcweir //virtual
997cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
beforeFirst()998cdf0e10cSrcweir ::beforeFirst()
999cdf0e10cSrcweir throw( SQLException,
1000cdf0e10cSrcweir RuntimeException )
1001cdf0e10cSrcweir {
1002cdf0e10cSrcweir impl_EnsureNotDisposed();
1003cdf0e10cSrcweir
1004cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1005cdf0e10cSrcweir {
1006cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1007cdf0e10cSrcweir throw RuntimeException();
1008cdf0e10cSrcweir }
1009cdf0e10cSrcweir m_xResultSetOrigin->beforeFirst();
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir
1012cdf0e10cSrcweir //virtual
1013cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
afterLast()1014cdf0e10cSrcweir ::afterLast()
1015cdf0e10cSrcweir throw( SQLException,
1016cdf0e10cSrcweir RuntimeException )
1017cdf0e10cSrcweir {
1018cdf0e10cSrcweir impl_EnsureNotDisposed();
1019cdf0e10cSrcweir
1020cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1021cdf0e10cSrcweir {
1022cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1023cdf0e10cSrcweir throw RuntimeException();
1024cdf0e10cSrcweir }
1025cdf0e10cSrcweir m_xResultSetOrigin->afterLast();
1026cdf0e10cSrcweir }
1027cdf0e10cSrcweir
1028cdf0e10cSrcweir //virtual
1029cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
isAfterLast()1030cdf0e10cSrcweir ::isAfterLast()
1031cdf0e10cSrcweir throw( SQLException,
1032cdf0e10cSrcweir RuntimeException )
1033cdf0e10cSrcweir {
1034cdf0e10cSrcweir impl_EnsureNotDisposed();
1035cdf0e10cSrcweir
1036cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1037cdf0e10cSrcweir {
1038cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1039cdf0e10cSrcweir throw RuntimeException();
1040cdf0e10cSrcweir }
1041cdf0e10cSrcweir return m_xResultSetOrigin->isAfterLast();
1042cdf0e10cSrcweir }
1043cdf0e10cSrcweir
1044cdf0e10cSrcweir //virtual
1045cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
isBeforeFirst()1046cdf0e10cSrcweir ::isBeforeFirst()
1047cdf0e10cSrcweir throw( SQLException,
1048cdf0e10cSrcweir RuntimeException )
1049cdf0e10cSrcweir {
1050cdf0e10cSrcweir impl_EnsureNotDisposed();
1051cdf0e10cSrcweir
1052cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1053cdf0e10cSrcweir {
1054cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1055cdf0e10cSrcweir throw RuntimeException();
1056cdf0e10cSrcweir }
1057cdf0e10cSrcweir return m_xResultSetOrigin->isBeforeFirst();
1058cdf0e10cSrcweir }
1059cdf0e10cSrcweir
1060cdf0e10cSrcweir //virtual
1061cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
isFirst()1062cdf0e10cSrcweir ::isFirst()
1063cdf0e10cSrcweir throw( SQLException,
1064cdf0e10cSrcweir RuntimeException )
1065cdf0e10cSrcweir {
1066cdf0e10cSrcweir impl_EnsureNotDisposed();
1067cdf0e10cSrcweir
1068cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1069cdf0e10cSrcweir {
1070cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1071cdf0e10cSrcweir throw RuntimeException();
1072cdf0e10cSrcweir }
1073cdf0e10cSrcweir return m_xResultSetOrigin->isFirst();
1074cdf0e10cSrcweir }
1075cdf0e10cSrcweir
1076cdf0e10cSrcweir //virtual
1077cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
isLast()1078cdf0e10cSrcweir ::isLast()
1079cdf0e10cSrcweir throw( SQLException,
1080cdf0e10cSrcweir RuntimeException )
1081cdf0e10cSrcweir {
1082cdf0e10cSrcweir impl_EnsureNotDisposed();
1083cdf0e10cSrcweir
1084cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1085cdf0e10cSrcweir {
1086cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1087cdf0e10cSrcweir throw RuntimeException();
1088cdf0e10cSrcweir }
1089cdf0e10cSrcweir return m_xResultSetOrigin->isLast();
1090cdf0e10cSrcweir }
1091cdf0e10cSrcweir
1092cdf0e10cSrcweir
1093cdf0e10cSrcweir //virtual
1094cdf0e10cSrcweir sal_Int32 SAL_CALL ContentResultSetWrapper
getRow()1095cdf0e10cSrcweir ::getRow()
1096cdf0e10cSrcweir throw( SQLException,
1097cdf0e10cSrcweir RuntimeException )
1098cdf0e10cSrcweir {
1099cdf0e10cSrcweir impl_EnsureNotDisposed();
1100cdf0e10cSrcweir
1101cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1102cdf0e10cSrcweir {
1103cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1104cdf0e10cSrcweir throw RuntimeException();
1105cdf0e10cSrcweir }
1106cdf0e10cSrcweir return m_xResultSetOrigin->getRow();
1107cdf0e10cSrcweir }
1108cdf0e10cSrcweir
1109cdf0e10cSrcweir //virtual
1110cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapper
refreshRow()1111cdf0e10cSrcweir ::refreshRow()
1112cdf0e10cSrcweir throw( SQLException,
1113cdf0e10cSrcweir RuntimeException )
1114cdf0e10cSrcweir {
1115cdf0e10cSrcweir impl_EnsureNotDisposed();
1116cdf0e10cSrcweir
1117cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1118cdf0e10cSrcweir {
1119cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1120cdf0e10cSrcweir throw RuntimeException();
1121cdf0e10cSrcweir }
1122cdf0e10cSrcweir m_xResultSetOrigin->refreshRow();
1123cdf0e10cSrcweir }
1124cdf0e10cSrcweir
1125cdf0e10cSrcweir //virtual
1126cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
rowUpdated()1127cdf0e10cSrcweir ::rowUpdated()
1128cdf0e10cSrcweir throw( SQLException,
1129cdf0e10cSrcweir RuntimeException )
1130cdf0e10cSrcweir {
1131cdf0e10cSrcweir impl_EnsureNotDisposed();
1132cdf0e10cSrcweir
1133cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1134cdf0e10cSrcweir {
1135cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1136cdf0e10cSrcweir throw RuntimeException();
1137cdf0e10cSrcweir }
1138cdf0e10cSrcweir return m_xResultSetOrigin->rowUpdated();
1139cdf0e10cSrcweir }
1140cdf0e10cSrcweir //virtual
1141cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
rowInserted()1142cdf0e10cSrcweir ::rowInserted()
1143cdf0e10cSrcweir throw( SQLException,
1144cdf0e10cSrcweir RuntimeException )
1145cdf0e10cSrcweir {
1146cdf0e10cSrcweir impl_EnsureNotDisposed();
1147cdf0e10cSrcweir
1148cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1149cdf0e10cSrcweir {
1150cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1151cdf0e10cSrcweir throw RuntimeException();
1152cdf0e10cSrcweir }
1153cdf0e10cSrcweir return m_xResultSetOrigin->rowInserted();
1154cdf0e10cSrcweir }
1155cdf0e10cSrcweir
1156cdf0e10cSrcweir //virtual
1157cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
rowDeleted()1158cdf0e10cSrcweir ::rowDeleted()
1159cdf0e10cSrcweir throw( SQLException,
1160cdf0e10cSrcweir RuntimeException )
1161cdf0e10cSrcweir {
1162cdf0e10cSrcweir impl_EnsureNotDisposed();
1163cdf0e10cSrcweir
1164cdf0e10cSrcweir if( !m_xResultSetOrigin.is() )
1165cdf0e10cSrcweir {
1166cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1167cdf0e10cSrcweir throw RuntimeException();
1168cdf0e10cSrcweir }
1169cdf0e10cSrcweir return m_xResultSetOrigin->rowDeleted();
1170cdf0e10cSrcweir }
1171cdf0e10cSrcweir
1172cdf0e10cSrcweir //virtual
1173cdf0e10cSrcweir Reference< XInterface > SAL_CALL ContentResultSetWrapper
getStatement()1174cdf0e10cSrcweir ::getStatement()
1175cdf0e10cSrcweir throw( SQLException,
1176cdf0e10cSrcweir RuntimeException )
1177cdf0e10cSrcweir {
1178cdf0e10cSrcweir impl_EnsureNotDisposed();
1179cdf0e10cSrcweir //@todo ?return anything
1180cdf0e10cSrcweir return Reference< XInterface >();
1181cdf0e10cSrcweir }
1182cdf0e10cSrcweir
1183cdf0e10cSrcweir //-----------------------------------------------------------------
1184cdf0e10cSrcweir // XRow methods.
1185cdf0e10cSrcweir //-----------------------------------------------------------------
1186cdf0e10cSrcweir
1187cdf0e10cSrcweir #define XROW_GETXXX( getXXX ) \
1188cdf0e10cSrcweir impl_EnsureNotDisposed(); \
1189cdf0e10cSrcweir impl_init_xRowOrigin(); \
1190cdf0e10cSrcweir if( !m_xRowOrigin.is() ) \
1191cdf0e10cSrcweir { \
1192cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );\
1193cdf0e10cSrcweir throw RuntimeException(); \
1194cdf0e10cSrcweir } \
1195cdf0e10cSrcweir return m_xRowOrigin->getXXX( columnIndex );
1196cdf0e10cSrcweir
1197cdf0e10cSrcweir //virtual
1198cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
wasNull()1199cdf0e10cSrcweir ::wasNull()
1200cdf0e10cSrcweir throw( SQLException,
1201cdf0e10cSrcweir RuntimeException )
1202cdf0e10cSrcweir {
1203cdf0e10cSrcweir impl_EnsureNotDisposed();
1204cdf0e10cSrcweir impl_init_xRowOrigin();
1205cdf0e10cSrcweir if( !m_xRowOrigin.is() )
1206cdf0e10cSrcweir {
1207cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1208cdf0e10cSrcweir throw RuntimeException();
1209cdf0e10cSrcweir }
1210cdf0e10cSrcweir return m_xRowOrigin->wasNull();
1211cdf0e10cSrcweir }
1212cdf0e10cSrcweir
1213cdf0e10cSrcweir //virtual
1214cdf0e10cSrcweir rtl::OUString SAL_CALL ContentResultSetWrapper
getString(sal_Int32 columnIndex)1215cdf0e10cSrcweir ::getString( sal_Int32 columnIndex )
1216cdf0e10cSrcweir throw( SQLException,
1217cdf0e10cSrcweir RuntimeException )
1218cdf0e10cSrcweir {
1219cdf0e10cSrcweir XROW_GETXXX( getString );
1220cdf0e10cSrcweir }
1221cdf0e10cSrcweir
1222cdf0e10cSrcweir //virtual
1223cdf0e10cSrcweir sal_Bool SAL_CALL ContentResultSetWrapper
getBoolean(sal_Int32 columnIndex)1224cdf0e10cSrcweir ::getBoolean( sal_Int32 columnIndex )
1225cdf0e10cSrcweir throw( SQLException,
1226cdf0e10cSrcweir RuntimeException )
1227cdf0e10cSrcweir {
1228cdf0e10cSrcweir XROW_GETXXX( getBoolean );
1229cdf0e10cSrcweir }
1230cdf0e10cSrcweir
1231cdf0e10cSrcweir //virtual
1232cdf0e10cSrcweir sal_Int8 SAL_CALL ContentResultSetWrapper
getByte(sal_Int32 columnIndex)1233cdf0e10cSrcweir ::getByte( sal_Int32 columnIndex )
1234cdf0e10cSrcweir throw( SQLException,
1235cdf0e10cSrcweir RuntimeException )
1236cdf0e10cSrcweir {
1237cdf0e10cSrcweir XROW_GETXXX( getByte );
1238cdf0e10cSrcweir }
1239cdf0e10cSrcweir
1240cdf0e10cSrcweir //virtual
1241cdf0e10cSrcweir sal_Int16 SAL_CALL ContentResultSetWrapper
getShort(sal_Int32 columnIndex)1242cdf0e10cSrcweir ::getShort( sal_Int32 columnIndex )
1243cdf0e10cSrcweir throw( SQLException,
1244cdf0e10cSrcweir RuntimeException )
1245cdf0e10cSrcweir {
1246cdf0e10cSrcweir XROW_GETXXX( getShort );
1247cdf0e10cSrcweir }
1248cdf0e10cSrcweir
1249cdf0e10cSrcweir //virtual
1250cdf0e10cSrcweir sal_Int32 SAL_CALL ContentResultSetWrapper
getInt(sal_Int32 columnIndex)1251cdf0e10cSrcweir ::getInt( sal_Int32 columnIndex )
1252cdf0e10cSrcweir throw( SQLException,
1253cdf0e10cSrcweir RuntimeException )
1254cdf0e10cSrcweir {
1255cdf0e10cSrcweir XROW_GETXXX( getInt );
1256cdf0e10cSrcweir }
1257cdf0e10cSrcweir
1258cdf0e10cSrcweir //virtual
1259cdf0e10cSrcweir sal_Int64 SAL_CALL ContentResultSetWrapper
getLong(sal_Int32 columnIndex)1260cdf0e10cSrcweir ::getLong( sal_Int32 columnIndex )
1261cdf0e10cSrcweir throw( SQLException,
1262cdf0e10cSrcweir RuntimeException )
1263cdf0e10cSrcweir {
1264cdf0e10cSrcweir XROW_GETXXX( getLong );
1265cdf0e10cSrcweir }
1266cdf0e10cSrcweir
1267cdf0e10cSrcweir //virtual
1268cdf0e10cSrcweir float SAL_CALL ContentResultSetWrapper
getFloat(sal_Int32 columnIndex)1269cdf0e10cSrcweir ::getFloat( sal_Int32 columnIndex )
1270cdf0e10cSrcweir throw( SQLException,
1271cdf0e10cSrcweir RuntimeException )
1272cdf0e10cSrcweir {
1273cdf0e10cSrcweir XROW_GETXXX( getFloat );
1274cdf0e10cSrcweir }
1275cdf0e10cSrcweir
1276cdf0e10cSrcweir //virtual
1277cdf0e10cSrcweir double SAL_CALL ContentResultSetWrapper
getDouble(sal_Int32 columnIndex)1278cdf0e10cSrcweir ::getDouble( sal_Int32 columnIndex )
1279cdf0e10cSrcweir throw( SQLException,
1280cdf0e10cSrcweir RuntimeException )
1281cdf0e10cSrcweir {
1282cdf0e10cSrcweir XROW_GETXXX( getDouble );
1283cdf0e10cSrcweir }
1284cdf0e10cSrcweir
1285cdf0e10cSrcweir //virtual
1286cdf0e10cSrcweir Sequence< sal_Int8 > SAL_CALL ContentResultSetWrapper
getBytes(sal_Int32 columnIndex)1287cdf0e10cSrcweir ::getBytes( sal_Int32 columnIndex )
1288cdf0e10cSrcweir throw( SQLException,
1289cdf0e10cSrcweir RuntimeException )
1290cdf0e10cSrcweir {
1291cdf0e10cSrcweir XROW_GETXXX( getBytes );
1292cdf0e10cSrcweir }
1293cdf0e10cSrcweir
1294cdf0e10cSrcweir //virtual
1295cdf0e10cSrcweir Date SAL_CALL ContentResultSetWrapper
getDate(sal_Int32 columnIndex)1296cdf0e10cSrcweir ::getDate( sal_Int32 columnIndex )
1297cdf0e10cSrcweir throw( SQLException,
1298cdf0e10cSrcweir RuntimeException )
1299cdf0e10cSrcweir {
1300cdf0e10cSrcweir XROW_GETXXX( getDate );
1301cdf0e10cSrcweir }
1302cdf0e10cSrcweir
1303cdf0e10cSrcweir //virtual
1304cdf0e10cSrcweir Time SAL_CALL ContentResultSetWrapper
getTime(sal_Int32 columnIndex)1305cdf0e10cSrcweir ::getTime( sal_Int32 columnIndex )
1306cdf0e10cSrcweir throw( SQLException,
1307cdf0e10cSrcweir RuntimeException )
1308cdf0e10cSrcweir {
1309cdf0e10cSrcweir XROW_GETXXX( getTime );
1310cdf0e10cSrcweir }
1311cdf0e10cSrcweir
1312cdf0e10cSrcweir //virtual
1313cdf0e10cSrcweir DateTime SAL_CALL ContentResultSetWrapper
getTimestamp(sal_Int32 columnIndex)1314cdf0e10cSrcweir ::getTimestamp( sal_Int32 columnIndex )
1315cdf0e10cSrcweir throw( SQLException,
1316cdf0e10cSrcweir RuntimeException )
1317cdf0e10cSrcweir {
1318cdf0e10cSrcweir XROW_GETXXX( getTimestamp );
1319cdf0e10cSrcweir }
1320cdf0e10cSrcweir
1321cdf0e10cSrcweir //virtual
1322cdf0e10cSrcweir Reference< com::sun::star::io::XInputStream >
1323cdf0e10cSrcweir SAL_CALL ContentResultSetWrapper
getBinaryStream(sal_Int32 columnIndex)1324cdf0e10cSrcweir ::getBinaryStream( sal_Int32 columnIndex )
1325cdf0e10cSrcweir throw( SQLException,
1326cdf0e10cSrcweir RuntimeException )
1327cdf0e10cSrcweir {
1328cdf0e10cSrcweir XROW_GETXXX( getBinaryStream );
1329cdf0e10cSrcweir }
1330cdf0e10cSrcweir
1331cdf0e10cSrcweir //virtual
1332cdf0e10cSrcweir Reference< com::sun::star::io::XInputStream >
1333cdf0e10cSrcweir SAL_CALL ContentResultSetWrapper
getCharacterStream(sal_Int32 columnIndex)1334cdf0e10cSrcweir ::getCharacterStream( sal_Int32 columnIndex )
1335cdf0e10cSrcweir throw( SQLException,
1336cdf0e10cSrcweir RuntimeException )
1337cdf0e10cSrcweir {
1338cdf0e10cSrcweir XROW_GETXXX( getCharacterStream );
1339cdf0e10cSrcweir }
1340cdf0e10cSrcweir
1341cdf0e10cSrcweir //virtual
1342cdf0e10cSrcweir Any SAL_CALL ContentResultSetWrapper
getObject(sal_Int32 columnIndex,const Reference<com::sun::star::container::XNameAccess> & typeMap)1343cdf0e10cSrcweir ::getObject( sal_Int32 columnIndex,
1344cdf0e10cSrcweir const Reference<
1345cdf0e10cSrcweir com::sun::star::container::XNameAccess >& typeMap )
1346cdf0e10cSrcweir throw( SQLException,
1347cdf0e10cSrcweir RuntimeException )
1348cdf0e10cSrcweir {
1349cdf0e10cSrcweir //if you change this macro please pay attention to
1350cdf0e10cSrcweir //define XROW_GETXXX, where this is similar implemented
1351cdf0e10cSrcweir
1352cdf0e10cSrcweir impl_EnsureNotDisposed();
1353cdf0e10cSrcweir impl_init_xRowOrigin();
1354cdf0e10cSrcweir if( !m_xRowOrigin.is() )
1355cdf0e10cSrcweir {
1356cdf0e10cSrcweir OSL_ENSURE( sal_False, "broadcaster was disposed already" );
1357cdf0e10cSrcweir throw RuntimeException();
1358cdf0e10cSrcweir }
1359cdf0e10cSrcweir return m_xRowOrigin->getObject( columnIndex, typeMap );
1360cdf0e10cSrcweir }
1361cdf0e10cSrcweir
1362cdf0e10cSrcweir //virtual
1363cdf0e10cSrcweir Reference< XRef > SAL_CALL ContentResultSetWrapper
getRef(sal_Int32 columnIndex)1364cdf0e10cSrcweir ::getRef( sal_Int32 columnIndex )
1365cdf0e10cSrcweir throw( SQLException,
1366cdf0e10cSrcweir RuntimeException )
1367cdf0e10cSrcweir {
1368cdf0e10cSrcweir XROW_GETXXX( getRef );
1369cdf0e10cSrcweir }
1370cdf0e10cSrcweir
1371cdf0e10cSrcweir //virtual
1372cdf0e10cSrcweir Reference< XBlob > SAL_CALL ContentResultSetWrapper
getBlob(sal_Int32 columnIndex)1373cdf0e10cSrcweir ::getBlob( sal_Int32 columnIndex )
1374cdf0e10cSrcweir throw( SQLException,
1375cdf0e10cSrcweir RuntimeException )
1376cdf0e10cSrcweir {
1377cdf0e10cSrcweir XROW_GETXXX( getBlob );
1378cdf0e10cSrcweir }
1379cdf0e10cSrcweir
1380cdf0e10cSrcweir //virtual
1381cdf0e10cSrcweir Reference< XClob > SAL_CALL ContentResultSetWrapper
getClob(sal_Int32 columnIndex)1382cdf0e10cSrcweir ::getClob( sal_Int32 columnIndex )
1383cdf0e10cSrcweir throw( SQLException,
1384cdf0e10cSrcweir RuntimeException )
1385cdf0e10cSrcweir {
1386cdf0e10cSrcweir XROW_GETXXX( getClob );
1387cdf0e10cSrcweir }
1388cdf0e10cSrcweir
1389cdf0e10cSrcweir //virtual
1390cdf0e10cSrcweir Reference< XArray > SAL_CALL ContentResultSetWrapper
getArray(sal_Int32 columnIndex)1391cdf0e10cSrcweir ::getArray( sal_Int32 columnIndex )
1392cdf0e10cSrcweir throw( SQLException,
1393cdf0e10cSrcweir RuntimeException )
1394cdf0e10cSrcweir {
1395cdf0e10cSrcweir XROW_GETXXX( getArray );
1396cdf0e10cSrcweir }
1397cdf0e10cSrcweir
1398cdf0e10cSrcweir //--------------------------------------------------------------------------
1399cdf0e10cSrcweir //--------------------------------------------------------------------------
1400cdf0e10cSrcweir // class ContentResultSetWrapperListener
1401cdf0e10cSrcweir //--------------------------------------------------------------------------
1402cdf0e10cSrcweir //--------------------------------------------------------------------------
1403cdf0e10cSrcweir
ContentResultSetWrapperListener(ContentResultSetWrapper * pOwner)1404cdf0e10cSrcweir ContentResultSetWrapperListener::ContentResultSetWrapperListener(
1405cdf0e10cSrcweir ContentResultSetWrapper* pOwner )
1406cdf0e10cSrcweir : m_pOwner( pOwner )
1407cdf0e10cSrcweir {
1408cdf0e10cSrcweir }
1409cdf0e10cSrcweir
~ContentResultSetWrapperListener()1410cdf0e10cSrcweir ContentResultSetWrapperListener::~ContentResultSetWrapperListener()
1411cdf0e10cSrcweir {
1412cdf0e10cSrcweir }
1413cdf0e10cSrcweir
1414cdf0e10cSrcweir //--------------------------------------------------------------------------
1415cdf0e10cSrcweir // XInterface methods.
1416cdf0e10cSrcweir //--------------------------------------------------------------------------
1417cdf0e10cSrcweir //list all interfaces inclusive baseclasses of interfaces
1418cdf0e10cSrcweir XINTERFACE_COMMON_IMPL( ContentResultSetWrapperListener )
QUERYINTERFACE_IMPL_START(ContentResultSetWrapperListener)1419cdf0e10cSrcweir QUERYINTERFACE_IMPL_START( ContentResultSetWrapperListener )
1420cdf0e10cSrcweir
1421cdf0e10cSrcweir static_cast< XEventListener * >(
1422cdf0e10cSrcweir static_cast< XPropertyChangeListener * >(this))
1423cdf0e10cSrcweir , SAL_STATIC_CAST( XPropertyChangeListener*, this )
1424cdf0e10cSrcweir , SAL_STATIC_CAST( XVetoableChangeListener*, this )
1425cdf0e10cSrcweir
1426cdf0e10cSrcweir QUERYINTERFACE_IMPL_END
1427cdf0e10cSrcweir
1428cdf0e10cSrcweir
1429cdf0e10cSrcweir //--------------------------------------------------------------------------
1430cdf0e10cSrcweir //XEventListener methods.
1431cdf0e10cSrcweir //--------------------------------------------------------------------------
1432cdf0e10cSrcweir
1433cdf0e10cSrcweir //virtual
1434cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapperListener
1435cdf0e10cSrcweir ::disposing( const EventObject& rEventObject )
1436cdf0e10cSrcweir throw( RuntimeException )
1437cdf0e10cSrcweir {
1438cdf0e10cSrcweir if( m_pOwner )
1439cdf0e10cSrcweir m_pOwner->impl_disposing( rEventObject );
1440cdf0e10cSrcweir }
1441cdf0e10cSrcweir
1442cdf0e10cSrcweir //--------------------------------------------------------------------------
1443cdf0e10cSrcweir //XPropertyChangeListener methods.
1444cdf0e10cSrcweir //--------------------------------------------------------------------------
1445cdf0e10cSrcweir
1446cdf0e10cSrcweir //virtual
1447cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapperListener
propertyChange(const PropertyChangeEvent & rEvt)1448cdf0e10cSrcweir ::propertyChange( const PropertyChangeEvent& rEvt )
1449cdf0e10cSrcweir throw( RuntimeException )
1450cdf0e10cSrcweir {
1451cdf0e10cSrcweir if( m_pOwner )
1452cdf0e10cSrcweir m_pOwner->impl_propertyChange( rEvt );
1453cdf0e10cSrcweir }
1454cdf0e10cSrcweir
1455cdf0e10cSrcweir //--------------------------------------------------------------------------
1456cdf0e10cSrcweir //XVetoableChangeListener methods.
1457cdf0e10cSrcweir //--------------------------------------------------------------------------
1458cdf0e10cSrcweir //virtual
1459cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapperListener
vetoableChange(const PropertyChangeEvent & rEvt)1460cdf0e10cSrcweir ::vetoableChange( const PropertyChangeEvent& rEvt )
1461cdf0e10cSrcweir throw( PropertyVetoException,
1462cdf0e10cSrcweir RuntimeException )
1463cdf0e10cSrcweir {
1464cdf0e10cSrcweir if( m_pOwner )
1465cdf0e10cSrcweir m_pOwner->impl_vetoableChange( rEvt );
1466cdf0e10cSrcweir }
1467cdf0e10cSrcweir
1468cdf0e10cSrcweir void SAL_CALL ContentResultSetWrapperListener
impl_OwnerDies()1469cdf0e10cSrcweir ::impl_OwnerDies()
1470cdf0e10cSrcweir {
1471cdf0e10cSrcweir m_pOwner = NULL;
1472cdf0e10cSrcweir }
1473cdf0e10cSrcweir
1474