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

Generated by: LCOV version 1.10