LCOV - code coverage report
Current view: top level - toolkit/source/controls/grid - gridcontrol.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 155 194 79.9 %
Date: 2014-04-11 Functions: 24 36 66.7 %
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 "gridcontrol.hxx"
      22             : #include "grideventforwarder.hxx"
      23             : 
      24             : #include <com/sun/star/view/SelectionType.hpp>
      25             : #include <com/sun/star/awt/grid/XGridControl.hpp>
      26             : #include <com/sun/star/awt/grid/XGridDataModel.hpp>
      27             : #include <com/sun/star/awt/grid/XGridRowSelection.hpp>
      28             : #include <com/sun/star/awt/grid/XMutableGridDataModel.hpp>
      29             : #include <com/sun/star/awt/grid/DefaultGridDataModel.hpp>
      30             : #include <com/sun/star/awt/grid/SortableGridDataModel.hpp>
      31             : #include <com/sun/star/awt/grid/DefaultGridColumnModel.hpp>
      32             : #include <toolkit/helper/unopropertyarrayhelper.hxx>
      33             : #include <toolkit/helper/property.hxx>
      34             : #include <tools/diagnose_ex.h>
      35             : #include <tools/color.hxx>
      36             : #include <toolkit/controls/unocontrolbase.hxx>
      37             : #include <toolkit/controls/unocontrolmodel.hxx>
      38             : #include <toolkit/helper/listenermultiplexer.hxx>
      39             : 
      40             : #include <boost/scoped_ptr.hpp>
      41             : 
      42             : using namespace ::com::sun::star;
      43             : using namespace ::com::sun::star::uno;
      44             : using namespace ::com::sun::star::awt;
      45             : using namespace ::com::sun::star::awt::grid;
      46             : using namespace ::com::sun::star::lang;
      47             : using namespace ::com::sun::star::beans;
      48             : using namespace ::com::sun::star::container;
      49             : using namespace ::com::sun::star::view;
      50             : using namespace ::com::sun::star::util;
      51             : 
      52             : namespace toolkit {
      53             : 
      54             : namespace
      55             : {
      56           8 :     Reference< XGridDataModel > lcl_getDefaultDataModel_throw( const Reference<XComponentContext> & i_context )
      57             :     {
      58           8 :         Reference< XMutableGridDataModel > const xDelegatorModel( DefaultGridDataModel::create( i_context ), UNO_QUERY_THROW );
      59           8 :         Reference< XGridDataModel > const xDataModel( SortableGridDataModel::create( i_context, xDelegatorModel ), UNO_QUERY_THROW );
      60           8 :         return xDataModel;
      61             :     }
      62             : 
      63           8 :     Reference< XGridColumnModel > lcl_getDefaultColumnModel_throw( const Reference<XComponentContext> & i_context )
      64             :     {
      65           8 :         Reference< XGridColumnModel > const xColumnModel = DefaultGridColumnModel::create( i_context );
      66           8 :         return xColumnModel;
      67             :     }
      68             : }
      69             : 
      70             : 
      71           8 : UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
      72           8 :         :UnoControlModel( rxContext )
      73             : {
      74           8 :     ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
      75           8 :     ImplRegisterProperty( BASEPROPERTY_BORDER );
      76           8 :     ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
      77           8 :     ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
      78           8 :     ImplRegisterProperty( BASEPROPERTY_ENABLED );
      79           8 :     ImplRegisterProperty( BASEPROPERTY_FILLCOLOR );
      80           8 :     ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
      81           8 :     ImplRegisterProperty( BASEPROPERTY_HELPURL );
      82           8 :     ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
      83           8 :     ImplRegisterProperty( BASEPROPERTY_SIZEABLE ); // resizable
      84           8 :     ImplRegisterProperty( BASEPROPERTY_HSCROLL );
      85           8 :     ImplRegisterProperty( BASEPROPERTY_VSCROLL );
      86           8 :     ImplRegisterProperty( BASEPROPERTY_TABSTOP );
      87           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_SHOWROWHEADER );
      88           8 :     ImplRegisterProperty( BASEPROPERTY_ROW_HEADER_WIDTH );
      89           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER );
      90           8 :     ImplRegisterProperty( BASEPROPERTY_COLUMN_HEADER_HEIGHT );
      91           8 :     ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT );
      92           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( lcl_getDefaultDataModel_throw( m_xContext ) ) );
      93           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( lcl_getDefaultColumnModel_throw( m_xContext ) ) );
      94           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE );
      95           8 :     ImplRegisterProperty( BASEPROPERTY_FONTRELIEF );
      96           8 :     ImplRegisterProperty( BASEPROPERTY_FONTEMPHASISMARK );
      97           8 :     ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
      98           8 :     ImplRegisterProperty( BASEPROPERTY_TEXTCOLOR );
      99           8 :     ImplRegisterProperty( BASEPROPERTY_TEXTLINECOLOR );
     100           8 :     ImplRegisterProperty( BASEPROPERTY_USE_GRID_LINES );
     101           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_LINE_COLOR );
     102           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND );
     103           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_TEXT_COLOR );
     104           8 :     ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS );
     105           8 :     ImplRegisterProperty( BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR );
     106           8 :     ImplRegisterProperty( BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR );
     107           8 :     ImplRegisterProperty( BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR );
     108           8 :     ImplRegisterProperty( BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR );
     109           8 :     ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
     110           8 : }
     111             : 
     112             : 
     113           1 : UnoGridModel::UnoGridModel( const UnoGridModel& rModel )
     114           1 :     :UnoControlModel( rModel )
     115             : {
     116           1 :     osl_atomic_increment( &m_refCount );
     117             :     {
     118           1 :         Reference< XGridDataModel > xDataModel;
     119             :         // clone the data model
     120           2 :         const Reference< XFastPropertySet > xCloneSource( &const_cast< UnoGridModel& >( rModel ) );
     121             :         try
     122             :         {
     123           1 :             const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ), UNO_QUERY_THROW );
     124           1 :             xDataModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
     125             :         }
     126           0 :         catch( const Exception& )
     127             :         {
     128             :             DBG_UNHANDLED_EXCEPTION();
     129             :         }
     130           1 :         if ( !xDataModel.is() )
     131           0 :             xDataModel = lcl_getDefaultDataModel_throw( m_xContext );
     132           1 :         UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_DATAMODEL, makeAny( xDataModel ) );
     133             :             // do *not* use setFastPropertyValue here: The UnoControlModel ctor did a simple copy of all property values,
     134             :             // so before this call here, we share our data model with the own of the clone source. setFastPropertyValue,
     135             :             // then, disposes the old data model - which means the data model which in fact belongs to the clone source.
     136             :             // so, call the UnoControlModel's impl-method for setting the value.
     137             : 
     138             :         // clone the column model
     139           2 :         Reference< XGridColumnModel > xColumnModel;
     140             :         try
     141             :         {
     142           1 :             const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ), UNO_QUERY_THROW );
     143           1 :             xColumnModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
     144             :         }
     145           0 :         catch( const Exception& )
     146             :         {
     147             :             DBG_UNHANDLED_EXCEPTION();
     148             :         }
     149           1 :         if ( !xColumnModel.is() )
     150           0 :             xColumnModel = lcl_getDefaultColumnModel_throw( m_xContext );
     151           2 :         UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( xColumnModel ) );
     152             :             // same comment as above: do not use our own setPropertyValue here.
     153             :     }
     154           1 :     osl_atomic_decrement( &m_refCount );
     155           1 : }
     156             : 
     157             : 
     158           1 : UnoControlModel* UnoGridModel::Clone() const
     159             : {
     160           1 :     return new UnoGridModel( *this );
     161             : }
     162             : 
     163             : 
     164             : namespace
     165             : {
     166           8 :     void lcl_dispose_nothrow( const Any& i_component )
     167             :     {
     168             :         try
     169             :         {
     170           8 :             const Reference< XComponent > xComponent( i_component, UNO_QUERY_THROW );
     171           8 :             xComponent->dispose();
     172             :         }
     173           0 :         catch( const Exception& )
     174             :         {
     175             :             DBG_UNHANDLED_EXCEPTION();
     176             :         }
     177           8 :     }
     178             : }
     179             : 
     180             : 
     181           3 : void SAL_CALL UnoGridModel::dispose(  ) throw(RuntimeException, std::exception)
     182             : {
     183           3 :     lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ) );
     184           3 :     lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ) );
     185             : 
     186           3 :     UnoControlModel::dispose();
     187           3 : }
     188             : 
     189             : 
     190           2 : void SAL_CALL UnoGridModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception, std::exception)
     191             : {
     192           2 :     Any aOldSubModel;
     193           2 :     if ( ( nHandle == BASEPROPERTY_GRID_COLUMNMODEL ) || ( nHandle == BASEPROPERTY_GRID_DATAMODEL ) )
     194             :     {
     195           2 :         aOldSubModel = getFastPropertyValue( nHandle );
     196           2 :         if ( aOldSubModel == rValue )
     197             :         {
     198             :             OSL_ENSURE( false, "UnoGridModel::setFastPropertyValue_NoBroadcast: setting the same value, again!" );
     199             :                 // shouldn't this have been caught by convertFastPropertyValue?
     200           0 :             aOldSubModel.clear();
     201             :         }
     202             :     }
     203             : 
     204           2 :     UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
     205             : 
     206           2 :     if ( aOldSubModel.hasValue() )
     207           2 :         lcl_dispose_nothrow( aOldSubModel );
     208           2 : }
     209             : 
     210             : 
     211           0 : OUString UnoGridModel::getServiceName() throw(RuntimeException, std::exception)
     212             : {
     213           0 :     return OUString("com.sun.star.awt.grid.UnoControlGridModel");
     214             : }
     215             : 
     216             : 
     217         304 : Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
     218             : {
     219         304 :     switch( nPropId )
     220             :     {
     221             :         case BASEPROPERTY_DEFAULTCONTROL:
     222           8 :             return uno::makeAny( OUString("com.sun.star.awt.grid.UnoControlGrid") );
     223             :         case BASEPROPERTY_GRID_SELECTIONMODE:
     224           8 :             return uno::makeAny( SelectionType(1) );
     225             :         case BASEPROPERTY_GRID_SHOWROWHEADER:
     226             :         case BASEPROPERTY_USE_GRID_LINES:
     227          16 :             return uno::makeAny( false );
     228             :         case BASEPROPERTY_ROW_HEADER_WIDTH:
     229           8 :             return uno::makeAny( sal_Int32( 10 ) );
     230             :         case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
     231           8 :             return uno::makeAny( true );
     232             :         case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
     233             :         case BASEPROPERTY_ROW_HEIGHT:
     234             :         case BASEPROPERTY_GRID_HEADER_BACKGROUND:
     235             :         case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
     236             :         case BASEPROPERTY_GRID_LINE_COLOR:
     237             :         case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
     238             :         case BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR:
     239             :         case BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR:
     240             :         case BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR:
     241             :         case BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR:
     242          80 :             return Any();
     243             :         default:
     244         176 :             return UnoControlModel::ImplGetDefaultValue( nPropId );
     245             :     }
     246             : 
     247             : }
     248             : 
     249             : 
     250         117 : ::cppu::IPropertyArrayHelper& UnoGridModel::getInfoHelper()
     251             : {
     252             :     static UnoPropertyArrayHelper* pHelper = NULL;
     253         117 :     if ( !pHelper )
     254             :     {
     255           2 :         Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
     256           2 :         pHelper = new UnoPropertyArrayHelper( aIDs );
     257             :     }
     258         117 :     return *pHelper;
     259             : }
     260             : 
     261             : 
     262             : // XMultiPropertySet
     263           1 : Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo(  ) throw(RuntimeException, std::exception)
     264             : {
     265           1 :     static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
     266           1 :     return xInfo;
     267             : }
     268             : 
     269             : 
     270             : 
     271             : //= UnoGridControl
     272             : 
     273           1 : UnoGridControl::UnoGridControl()
     274             :     :UnoGridControl_Base()
     275             :     ,m_aSelectionListeners( *this )
     276           1 :     ,m_pEventForwarder( new toolkit::GridEventForwarder( *this ) )
     277             : {
     278           1 : }
     279             : 
     280             : 
     281           2 : UnoGridControl::~UnoGridControl()
     282             : {
     283           2 : }
     284             : 
     285             : 
     286           1 : OUString UnoGridControl::GetComponentServiceName()
     287             : {
     288           1 :     return OUString("Grid");
     289             : }
     290             : 
     291             : 
     292           1 : void SAL_CALL UnoGridControl::dispose(  ) throw(RuntimeException, std::exception)
     293             : {
     294           1 :     lang::EventObject aEvt;
     295           1 :     aEvt.Source = (::cppu::OWeakObject*)this;
     296           1 :     m_aSelectionListeners.disposeAndClear( aEvt );
     297           1 :     UnoControl::dispose();
     298           1 : }
     299             : 
     300             : 
     301           1 : void SAL_CALL UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer >  & rParentPeer ) throw(uno::RuntimeException, std::exception)
     302             : {
     303           1 :     UnoControlBase::createPeer( rxToolkit, rParentPeer );
     304             : 
     305           1 :     const Reference< XGridRowSelection > xGrid( getPeer(), UNO_QUERY_THROW );
     306           1 :     xGrid->addSelectionListener( &m_aSelectionListeners );
     307           1 : }
     308             : 
     309             : 
     310             : namespace
     311             : {
     312           3 :     void lcl_setEventForwarding( const Reference< XControlModel >& i_gridControlModel, const ::boost::scoped_ptr< toolkit::GridEventForwarder >& i_listener,
     313             :         bool const i_add )
     314             :     {
     315           3 :         const Reference< XPropertySet > xModelProps( i_gridControlModel, UNO_QUERY );
     316           3 :         if ( !xModelProps.is() )
     317           4 :             return;
     318             : 
     319             :         try
     320             :         {
     321             :             Reference< XContainer > const xColModel(
     322           2 :                 xModelProps->getPropertyValue("ColumnModel"),
     323           2 :                 UNO_QUERY_THROW );
     324           2 :             if ( i_add )
     325           1 :                 xColModel->addContainerListener( i_listener.get() );
     326             :             else
     327           1 :                 xColModel->removeContainerListener( i_listener.get() );
     328             : 
     329             :             Reference< XGridDataModel > const xDataModel(
     330           2 :                 xModelProps->getPropertyValue("GridDataModel"),
     331             :                 UNO_QUERY_THROW
     332           4 :             );
     333           4 :             Reference< XMutableGridDataModel > const xMutableDataModel( xDataModel, UNO_QUERY );
     334           2 :             if ( xMutableDataModel.is() )
     335             :             {
     336           2 :                 if ( i_add )
     337           1 :                     xMutableDataModel->addGridDataListener( i_listener.get() );
     338             :                 else
     339           1 :                     xMutableDataModel->removeGridDataListener( i_listener.get() );
     340           2 :             }
     341             :         }
     342           0 :         catch( const Exception& )
     343             :         {
     344             :             DBG_UNHANDLED_EXCEPTION();
     345           2 :         }
     346             :     }
     347             : }
     348             : 
     349             : 
     350           2 : sal_Bool SAL_CALL UnoGridControl::setModel( const Reference< XControlModel >& i_model ) throw(RuntimeException, std::exception)
     351             : {
     352           2 :     lcl_setEventForwarding( getModel(), m_pEventForwarder, false );
     353           2 :     if ( !UnoGridControl_Base::setModel( i_model ) )
     354           1 :         return sal_False;
     355           1 :     lcl_setEventForwarding( getModel(), m_pEventForwarder, true );
     356           1 :     return sal_True;
     357             : }
     358             : 
     359             : 
     360           0 : ::sal_Int32 UnoGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException, std::exception)
     361             : {
     362           0 :     Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
     363           0 :     return xGrid->getRowAtPoint( x, y );
     364             : }
     365             : 
     366             : 
     367           0 : ::sal_Int32 UnoGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException, std::exception)
     368             : {
     369           0 :     Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
     370           0 :     return xGrid->getColumnAtPoint( x, y );
     371             : }
     372             : 
     373             : 
     374           3 : ::sal_Int32 SAL_CALL UnoGridControl::getCurrentColumn(  ) throw (RuntimeException, std::exception)
     375             : {
     376           3 :     Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
     377           3 :     return xGrid->getCurrentColumn();
     378             : }
     379             : 
     380             : 
     381           3 : ::sal_Int32 SAL_CALL UnoGridControl::getCurrentRow(  ) throw (RuntimeException, std::exception)
     382             : {
     383           3 :     Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
     384           3 :     return xGrid->getCurrentRow();
     385             : }
     386             : 
     387             : 
     388           2 : void SAL_CALL UnoGridControl::goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException, VetoException, std::exception)
     389             : {
     390           2 :     Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
     391           2 :     xGrid->goToCell( i_columnIndex, i_rowIndex );
     392           2 : }
     393             : 
     394             : 
     395           0 : void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException, std::exception )
     396             : {
     397           0 :     Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->selectRow( i_rowIndex );
     398           0 : }
     399             : 
     400             : 
     401           0 : void SAL_CALL UnoGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException, std::exception)
     402             : {
     403           0 :     Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->selectAllRows();
     404           0 : }
     405             : 
     406             : 
     407           0 : void SAL_CALL UnoGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException, std::exception )
     408             : {
     409           0 :     Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->deselectRow( i_rowIndex );
     410           0 : }
     411             : 
     412             : 
     413           0 : void SAL_CALL UnoGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException, std::exception)
     414             : {
     415           0 :     Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->deselectAllRows();
     416           0 : }
     417             : 
     418             : 
     419           0 : ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelectedRows() throw (::com::sun::star::uno::RuntimeException, std::exception)
     420             : {
     421           0 :     return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->getSelectedRows();
     422             : }
     423             : 
     424             : 
     425           0 : sal_Bool SAL_CALL UnoGridControl::hasSelectedRows() throw (::com::sun::star::uno::RuntimeException, std::exception)
     426             : {
     427           0 :     return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->hasSelectedRows();
     428             : }
     429             : 
     430             : 
     431           0 : sal_Bool SAL_CALL UnoGridControl::isRowSelected(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException, std::exception)
     432             : {
     433           0 :     return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->isRowSelected( index );
     434             : }
     435             : 
     436             : 
     437           0 : void SAL_CALL UnoGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException, std::exception)
     438             : {
     439           0 :     m_aSelectionListeners.addInterface( listener );
     440           0 : }
     441             : 
     442             : 
     443           0 : void SAL_CALL UnoGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException, std::exception)
     444             : {
     445           0 :     m_aSelectionListeners.removeInterface( listener );
     446           0 : }
     447             : 
     448             : }
     449             : 
     450             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     451           1 : stardiv_Toolkit_GridControl_get_implementation(
     452             :     css::uno::XComponentContext *,
     453             :     css::uno::Sequence<css::uno::Any> const &)
     454             : {
     455           1 :     return cppu::acquire(new toolkit::UnoGridControl());
     456             : }
     457             : 
     458             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     459           6 : stardiv_Toolkit_GridControlModel_get_implementation(
     460             :     css::uno::XComponentContext *context,
     461             :     css::uno::Sequence<css::uno::Any> const &)
     462             : {
     463           6 :     return cppu::acquire(new toolkit::UnoGridModel(context));
     464             : }
     465             : 
     466             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10