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