LCOV - code coverage report
Current view: top level - ucb/source/cacher - contentresultsetwrapper.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 502 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 82 0.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11