LCOV - code coverage report
Current view: top level - libreoffice/svtools/source/brwbox - brwbox3.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 223 0.0 %
Date: 2012-12-27 Functions: 0 45 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             : #include <svtools/brwbox.hxx>
      21             : #include <svtools/AccessibleBrowseBoxObjType.hxx>
      22             : #include <tools/debug.hxx>
      23             : #include <tools/multisel.hxx>
      24             : #include "datwin.hxx"
      25             : #include "brwimpl.hxx"
      26             : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
      27             : #include <com/sun/star/accessibility/AccessibleRole.hpp>
      28             : #include <toolkit/helper/vclunohelper.hxx>
      29             : 
      30             : // Accessibility ==============================================================
      31             : 
      32             : using ::rtl::OUString;
      33             : using namespace ::com::sun::star::uno;
      34             : using ::com::sun::star::accessibility::XAccessible;
      35             : using namespace ::com::sun::star::accessibility;
      36             : 
      37             : // ============================================================================
      38             : namespace svt
      39             : {
      40             :     using namespace ::com::sun::star::lang;
      41             :     using namespace utl;
      42             : 
      43           0 :     Reference< XAccessible > getHeaderCell( BrowseBoxImpl::THeaderCellMap& _raHeaderCells,
      44             :                                             sal_Int32 _nPos,
      45             :                                             AccessibleBrowseBoxObjType _eType,
      46             :                                             const Reference< XAccessible >& _rParent,
      47             :                                             BrowseBox& _rBrowseBox,
      48             :                                             IAccessibleFactory& rFactory
      49             :                                           )
      50             :     {
      51           0 :         Reference< XAccessible > xRet;
      52           0 :         BrowseBoxImpl::THeaderCellMap::iterator aFind = _raHeaderCells.find( _nPos );
      53           0 :         if ( aFind == _raHeaderCells.end() )
      54             :         {
      55             :             Reference< XAccessible > xAccessible = rFactory.createAccessibleBrowseBoxHeaderCell(
      56             :                 _nPos,
      57             :                 _rParent,
      58             :                 _rBrowseBox,
      59             :                 NULL,
      60             :                 _eType
      61           0 :             );
      62           0 :             aFind = _raHeaderCells.insert( BrowseBoxImpl::THeaderCellMap::value_type( _nPos, xAccessible ) ).first;
      63             :         }
      64           0 :         if ( aFind != _raHeaderCells.end() )
      65           0 :             xRet = aFind->second;
      66           0 :         return xRet;
      67             :     }
      68             : 
      69             :     // ============================================================================
      70             :     // ----------------------------------------------------------------------------
      71           0 :     Reference< XAccessible > BrowseBoxImpl::getAccessibleHeaderBar( AccessibleBrowseBoxObjType _eObjType )
      72             :     {
      73           0 :         if ( m_pAccessible && m_pAccessible->isAlive() )
      74           0 :             return m_pAccessible->getHeaderBar( _eObjType );
      75           0 :         return NULL;
      76             :     }
      77             : 
      78             :     // ----------------------------------------------------------------------------
      79           0 :     Reference< XAccessible > BrowseBoxImpl::getAccessibleTable( )
      80             :     {
      81           0 :         if ( m_pAccessible && m_pAccessible->isAlive() )
      82           0 :             return m_pAccessible->getTable( );
      83           0 :         return NULL;
      84             :     }
      85             : }
      86             : 
      87             : // ============================================================================
      88             : 
      89           0 : Reference< XAccessible > BrowseBox::CreateAccessible()
      90             : {
      91           0 :     Window* pParent = GetAccessibleParentWindow();
      92             :     DBG_ASSERT( pParent, "BrowseBox::CreateAccessible - parent not found" );
      93             : 
      94           0 :     if( pParent && !m_pImpl->m_pAccessible)
      95             :     {
      96           0 :         Reference< XAccessible > xAccParent = pParent->GetAccessible();
      97           0 :         if( xAccParent.is() )
      98             :         {
      99           0 :             m_pImpl->m_pAccessible = getAccessibleFactory().createAccessibleBrowseBox(
     100             :                 xAccParent, *this
     101           0 :             );
     102           0 :         }
     103             :     }
     104             : 
     105           0 :     Reference< XAccessible > xAccessible;
     106           0 :     if ( m_pImpl->m_pAccessible )
     107           0 :         xAccessible = m_pImpl->m_pAccessible->getMyself();
     108             : 
     109           0 :     return xAccessible;
     110             : }
     111             : // -----------------------------------------------------------------------------
     112             : 
     113             : // Children -------------------------------------------------------------------
     114             : 
     115           0 : Reference< XAccessible > BrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
     116             : {
     117             :     // BBINDEX_TABLE must be the table
     118             :     OSL_ENSURE(m_pImpl->m_pAccessible,"Invalid call: Accessible is null");
     119             : 
     120           0 :     return m_pImpl->m_aFactoryAccess.getFactory().createAccessibleBrowseBoxTableCell(
     121             :         m_pImpl->getAccessibleTable(),
     122             :         *this,
     123             :         NULL,
     124             :         _nRow,
     125             :         _nColumnPos,
     126             :         OFFSET_DEFAULT
     127           0 :     );
     128             : }
     129             : // -----------------------------------------------------------------------------
     130             : 
     131           0 : Reference< XAccessible > BrowseBox::CreateAccessibleRowHeader( sal_Int32 _nRow )
     132             : {
     133             :     return svt::getHeaderCell(
     134           0 :         m_pImpl->m_aRowHeaderCellMap,
     135             :         _nRow,
     136             :         svt::BBTYPE_ROWHEADERCELL,
     137             :         m_pImpl->getAccessibleHeaderBar(svt::BBTYPE_ROWHEADERBAR),
     138             :         *this,
     139           0 :         m_pImpl->m_aFactoryAccess.getFactory()
     140           0 :     );
     141             : }
     142             : // -----------------------------------------------------------------------------
     143             : 
     144           0 : Reference< XAccessible > BrowseBox::CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos )
     145             : {
     146             :     return svt::getHeaderCell(
     147           0 :             m_pImpl->m_aColHeaderCellMap,
     148             :             _nColumnPos,
     149             :             svt::BBTYPE_COLUMNHEADERCELL,
     150             :             m_pImpl->getAccessibleHeaderBar(svt::BBTYPE_COLUMNHEADERBAR),
     151             :             *this,
     152           0 :             m_pImpl->m_aFactoryAccess.getFactory()
     153           0 :     );
     154             : }
     155             : // -----------------------------------------------------------------------------
     156             : 
     157           0 : sal_Int32 BrowseBox::GetAccessibleControlCount() const
     158             : {
     159           0 :     return 0;
     160             : }
     161             : // -----------------------------------------------------------------------------
     162             : 
     163           0 : Reference< XAccessible > BrowseBox::CreateAccessibleControl( sal_Int32 )
     164             : {
     165             :     DBG_ASSERT( sal_False, "BrowseBox::CreateAccessibleControl: to be overwritten!" );
     166           0 :     return NULL;
     167             : }
     168             : // -----------------------------------------------------------------------------
     169             : 
     170             : // Conversions ----------------------------------------------------------------
     171             : 
     172           0 : sal_Bool BrowseBox::ConvertPointToCellAddress(
     173             :         sal_Int32& rnRow, sal_uInt16& rnColumnPos, const Point& rPoint )
     174             : {
     175             :     //! TODO has to be checked
     176           0 :     rnRow = GetRowAtYPosPixel(rPoint.Y());
     177           0 :     rnColumnPos = GetColumnAtXPosPixel(rPoint.X());
     178           0 :     return rnRow != BROWSER_INVALIDID && rnColumnPos != BROWSER_INVALIDID;
     179             : }
     180             : // -----------------------------------------------------------------------------
     181             : 
     182           0 : sal_Bool BrowseBox::ConvertPointToRowHeader( sal_Int32& rnRow, const Point& rPoint )
     183             : {
     184           0 :     rnRow = GetRowAtYPosPixel(rPoint.Y());
     185             :     //  sal_uInt16 nColumnId = GetColumnAtXPosPixel(rPoint.X());
     186           0 :     return rnRow != BROWSER_INVALIDID;// && nColumnId == 0;
     187             : }
     188             : // -----------------------------------------------------------------------------
     189             : 
     190           0 : sal_Bool BrowseBox::ConvertPointToColumnHeader( sal_uInt16& _rnColumnPos, const Point& _rPoint )
     191             : {
     192           0 :     _rnColumnPos = GetColumnAtXPosPixel(_rPoint.X());
     193           0 :     return _rnColumnPos != BROWSER_INVALIDID;
     194             : }
     195             : // -----------------------------------------------------------------------------
     196             : 
     197           0 : sal_Bool BrowseBox::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
     198             : {
     199             :     //! TODO has to be checked
     200           0 :     sal_Int32 nRow = 0;
     201           0 :     sal_uInt16 nColumn = 0;
     202           0 :     sal_Bool bRet = ConvertPointToCellAddress(nRow,nColumn,_rPoint);
     203           0 :     if ( bRet )
     204           0 :         _rnIndex = nRow * ColCount() + nColumn;
     205             : 
     206           0 :     return bRet;
     207             : }
     208             : // -----------------------------------------------------------------------------
     209             : 
     210             : // Object data and state ------------------------------------------------------
     211             : 
     212           0 : OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 ) const
     213             : {
     214           0 :     OUString aRetText;
     215           0 :     switch( eObjType )
     216             :     {
     217             :         case ::svt::BBTYPE_BROWSEBOX:
     218           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BrowseBox" ) );
     219           0 :             break;
     220             :         case ::svt::BBTYPE_TABLE:
     221           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "Table" ) );
     222           0 :             break;
     223             :         case ::svt::BBTYPE_ROWHEADERBAR:
     224           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaderBar" ) );
     225           0 :             break;
     226             :         case ::svt::BBTYPE_COLUMNHEADERBAR:
     227           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar" ) );
     228           0 :             break;
     229             :         case ::svt::BBTYPE_TABLECELL:
     230           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TableCell" ) );
     231             : #if OSL_DEBUG_LEVEL > 1
     232             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( " [" ) );
     233             :             aRetText += OUString::valueOf(sal_Int32(GetCurRow()));
     234             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "," ) );
     235             :             aRetText += OUString::valueOf(sal_Int32(GetCurColumnId()));
     236             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "]" ) );
     237             : #endif
     238           0 :             break;
     239             :         case ::svt::BBTYPE_ROWHEADERCELL:
     240           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaderCell" ) );
     241             : #if OSL_DEBUG_LEVEL > 1
     242             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( " [" ) );
     243             :             aRetText += OUString::valueOf(sal_Int32(GetCurRow()));
     244             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "," ) );
     245             :             aRetText += OUString::valueOf(sal_Int32(GetCurColumnId()));
     246             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "]" ) );
     247             : #endif
     248           0 :             break;
     249             :         case ::svt::BBTYPE_COLUMNHEADERCELL:
     250           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderCell" ) );
     251             : #if OSL_DEBUG_LEVEL > 1
     252             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( " [" ) );
     253             :             aRetText += OUString::valueOf(sal_Int32(GetCurRow()));
     254             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "," ) );
     255             :             aRetText += OUString::valueOf(sal_Int32(GetCurColumnId()));
     256             :             aRetText += OUString( RTL_CONSTASCII_USTRINGPARAM( "]" ) );
     257             : #endif
     258           0 :             break;
     259             :         default:
     260             :             OSL_FAIL("BrowseBox::GetAccessibleName: invalid enum!");
     261             :     }
     262           0 :     return aRetText;
     263             : }
     264             : // -----------------------------------------------------------------------------
     265             : 
     266           0 : OUString BrowseBox::GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 ) const
     267             : {
     268           0 :     OUString aRetText;
     269           0 :     switch( eObjType )
     270             :     {
     271             :         case ::svt::BBTYPE_BROWSEBOX:
     272           0 :             aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BrowseBox description" ) );
     273           0 :             break;
     274             :         case ::svt::BBTYPE_TABLE:
     275             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
     276           0 :             break;
     277             :         case ::svt::BBTYPE_ROWHEADERBAR:
     278             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
     279           0 :             break;
     280             :         case ::svt::BBTYPE_COLUMNHEADERBAR:
     281             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
     282           0 :             break;
     283             :         case ::svt::BBTYPE_TABLECELL:
     284             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
     285           0 :             break;
     286             :         case ::svt::BBTYPE_ROWHEADERCELL:
     287             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
     288           0 :             break;
     289             :         case ::svt::BBTYPE_COLUMNHEADERCELL:
     290             :             //  aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
     291           0 :             break;
     292             :         case ::svt::BBTYPE_CHECKBOXCELL:
     293           0 :             break;
     294             :     }
     295           0 :     return aRetText;
     296             : }
     297             : // -----------------------------------------------------------------------------
     298             : 
     299           0 : OUString BrowseBox::GetRowDescription( sal_Int32 ) const
     300             : {
     301           0 :     return OUString();
     302             : }
     303             : // -----------------------------------------------------------------------------
     304             : 
     305           0 : OUString BrowseBox::GetColumnDescription( sal_uInt16 _nColumn ) const
     306             : {
     307           0 :     return OUString( GetColumnTitle( GetColumnId( _nColumn ) ) );
     308             : }
     309             : 
     310             : // -----------------------------------------------------------------------------
     311             : 
     312           0 : void BrowseBox::FillAccessibleStateSet(
     313             :         ::utl::AccessibleStateSetHelper& rStateSet,
     314             :         ::svt::AccessibleBrowseBoxObjType eObjType ) const
     315             : {
     316           0 :     switch( eObjType )
     317             :     {
     318             :         case ::svt::BBTYPE_BROWSEBOX:
     319             :         case ::svt::BBTYPE_TABLE:
     320             : 
     321           0 :             rStateSet.AddState( AccessibleStateType::FOCUSABLE );
     322           0 :             if ( HasFocus() )
     323           0 :                 rStateSet.AddState( AccessibleStateType::FOCUSED );
     324           0 :             if ( IsActive() )
     325           0 :                 rStateSet.AddState( AccessibleStateType::ACTIVE );
     326           0 :             if ( GetUpdateMode() )
     327           0 :                 rStateSet.AddState( AccessibleStateType::EDITABLE );
     328           0 :             if ( IsEnabled() )
     329             :             {
     330           0 :                 rStateSet.AddState( AccessibleStateType::ENABLED );
     331           0 :                 rStateSet.AddState( AccessibleStateType::SENSITIVE );
     332             :             }
     333           0 :             if ( IsReallyVisible() )
     334           0 :                 rStateSet.AddState( AccessibleStateType::VISIBLE );
     335           0 :             if ( eObjType == ::svt::BBTYPE_TABLE )
     336           0 :                 rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
     337             : 
     338           0 :             break;
     339             :         case ::svt::BBTYPE_ROWHEADERBAR:
     340           0 :             rStateSet.AddState( AccessibleStateType::FOCUSABLE );
     341           0 :             rStateSet.AddState( AccessibleStateType::VISIBLE );
     342           0 :             if ( GetSelectRowCount() )
     343           0 :                 rStateSet.AddState( AccessibleStateType::FOCUSED );
     344           0 :             rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
     345           0 :             break;
     346             :         case ::svt::BBTYPE_COLUMNHEADERBAR:
     347           0 :             rStateSet.AddState( AccessibleStateType::FOCUSABLE );
     348           0 :             rStateSet.AddState( AccessibleStateType::VISIBLE );
     349           0 :             if ( GetSelectColumnCount() )
     350           0 :                 rStateSet.AddState( AccessibleStateType::FOCUSED );
     351           0 :             rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
     352           0 :             break;
     353             :         case ::svt::BBTYPE_TABLECELL:
     354             :             {
     355           0 :                 sal_Int32 nRow = GetCurRow();
     356           0 :                 sal_uInt16 nColumn = GetCurColumnId();
     357           0 :                 if ( IsFieldVisible(nRow,nColumn) )
     358           0 :                     rStateSet.AddState( AccessibleStateType::VISIBLE );
     359           0 :                 if ( !IsFrozen( nColumn ) )
     360           0 :                     rStateSet.AddState( AccessibleStateType::FOCUSABLE );
     361           0 :                 rStateSet.AddState( AccessibleStateType::TRANSIENT );
     362             :             }
     363           0 :             break;
     364             :         case ::svt::BBTYPE_ROWHEADERCELL:
     365             :         case ::svt::BBTYPE_COLUMNHEADERCELL:
     366             :         case ::svt::BBTYPE_CHECKBOXCELL:
     367             :             OSL_FAIL("Illegal call here!");
     368           0 :             break;
     369             :     }
     370           0 : }
     371             : // -----------------------------------------------------------------------
     372           0 : void BrowseBox::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet,
     373             :                                                sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
     374             : {
     375             :     //! TODO check if the state is valid for table cells
     376           0 :     if ( IsCellVisible( _nRow, _nColumnPos ) )
     377           0 :         _rStateSet.AddState( AccessibleStateType::VISIBLE );
     378           0 :     if ( GetCurrRow() == _nRow && GetCurrColumn() == _nColumnPos )
     379           0 :         _rStateSet.AddState( AccessibleStateType::FOCUSED );
     380             :     else // only transient when column is not focused
     381           0 :         _rStateSet.AddState( AccessibleStateType::TRANSIENT );
     382           0 : }
     383             : // -----------------------------------------------------------------------------
     384             : 
     385           0 : void BrowseBox::GrabTableFocus()
     386             : {
     387           0 :     GrabFocus();
     388           0 : }
     389             : // -----------------------------------------------------------------------------
     390           0 : String BrowseBox::GetCellText(long, sal_uInt16 ) const
     391             : {
     392             :     DBG_ASSERT(0,"This method has to be implemented by the derived classes! BUG!!");
     393           0 :     return String();
     394             : }
     395             : 
     396             : // -----------------------------------------------------------------------------
     397           0 : void BrowseBox::commitHeaderBarEvent(sal_Int16 nEventId,
     398             :         const Any& rNewValue, const Any& rOldValue, sal_Bool _bColumnHeaderBar )
     399             : {
     400           0 :     if ( isAccessibleAlive() )
     401           0 :         m_pImpl->m_pAccessible->commitHeaderBarEvent( nEventId,
     402           0 :             rNewValue, rOldValue, _bColumnHeaderBar );
     403           0 : }
     404             : 
     405             : // -----------------------------------------------------------------------------
     406           0 : void BrowseBox::commitTableEvent( sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
     407             : {
     408           0 :     if ( isAccessibleAlive() )
     409           0 :         m_pImpl->m_pAccessible->commitTableEvent( _nEventId, _rNewValue, _rOldValue );
     410           0 : }
     411             : // -----------------------------------------------------------------------------
     412           0 : void BrowseBox::commitBrowseBoxEvent( sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
     413             : {
     414           0 :     if ( isAccessibleAlive() )
     415           0 :         m_pImpl->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue);
     416           0 : }
     417             : 
     418             : // -----------------------------------------------------------------------------
     419           0 : ::svt::IAccessibleFactory& BrowseBox::getAccessibleFactory()
     420             : {
     421           0 :     return m_pImpl->m_aFactoryAccess.getFactory();
     422             : }
     423             : 
     424             : // -----------------------------------------------------------------------------
     425           0 : sal_Bool BrowseBox::isAccessibleAlive( ) const
     426             : {
     427           0 :     return ( NULL != m_pImpl->m_pAccessible ) && m_pImpl->m_pAccessible->isAlive();
     428             : }
     429             : // -----------------------------------------------------------------------------
     430             : // IAccessibleTableProvider
     431             : // -----------------------------------------------------------------------------
     432           0 : sal_Int32 BrowseBox::GetCurrRow() const
     433             : {
     434           0 :     return GetCurRow();
     435             : }
     436             : // -----------------------------------------------------------------------------
     437           0 : sal_uInt16 BrowseBox::GetCurrColumn() const
     438             : {
     439           0 :     return GetColumnPos( GetCurColumnId() );
     440             : }
     441             : // -----------------------------------------------------------------------------
     442           0 : sal_Bool BrowseBox::HasRowHeader() const
     443             : {
     444           0 :     return ( GetColumnId( 0 ) == HandleColumnId ); // HandleColumn == RowHeader
     445             : }
     446             : // -----------------------------------------------------------------------------
     447           0 : sal_Bool BrowseBox::IsCellFocusable() const
     448             : {
     449           0 :     return sal_True;
     450             : }
     451             : // -----------------------------------------------------------------------------
     452           0 : sal_Bool BrowseBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn )
     453             : {
     454           0 :     return GoToRowColumnId( _nRow, GetColumnId( _nColumn ) );
     455             : }
     456             : // -----------------------------------------------------------------------------
     457           0 : void BrowseBox::SelectColumn( sal_uInt16 _nColumn, sal_Bool _bSelect )
     458             : {
     459           0 :     SelectColumnPos( _nColumn, _bSelect );
     460           0 : }
     461             : // -----------------------------------------------------------------------------
     462           0 : sal_Bool BrowseBox::IsColumnSelected( long _nColumn ) const
     463             : {
     464             :     return ( pColSel && (0 <= _nColumn) && (_nColumn <= 0xFFF) ) ?
     465           0 :         pColSel->IsSelected( static_cast< sal_uInt16 >( _nColumn ) ) :
     466           0 :         sal_False;
     467             : }
     468             : // -----------------------------------------------------------------------------
     469           0 : sal_Int32 BrowseBox::GetSelectedRowCount() const
     470             : {
     471           0 :     return GetSelectRowCount();
     472             : }
     473             : // -----------------------------------------------------------------------------
     474           0 : sal_Int32 BrowseBox::GetSelectedColumnCount() const
     475             : {
     476           0 :     const MultiSelection* pColumnSel = GetColumnSelection();
     477           0 :     return pColumnSel ? pColumnSel->GetSelectCount() : 0;
     478             : }
     479             : // -----------------------------------------------------------------------------
     480           0 : void BrowseBox::GetAllSelectedRows( ::com::sun::star::uno::Sequence< sal_Int32 >& _rRows ) const
     481             : {
     482           0 :     sal_Int32 nCount = GetSelectRowCount();
     483           0 :     if( nCount )
     484             :     {
     485           0 :         _rRows.realloc( nCount );
     486           0 :         _rRows[ 0 ] = const_cast< BrowseBox* >( this )->FirstSelectedRow();
     487           0 :         for( sal_Int32 nIndex = 1; nIndex < nCount; ++nIndex )
     488           0 :             _rRows[ nIndex ] = const_cast< BrowseBox* >( this )->NextSelectedRow();
     489             :         DBG_ASSERT( const_cast< BrowseBox* >( this )->NextSelectedRow() == BROWSER_ENDOFSELECTION,
     490             :                     "BrowseBox::GetAllSelectedRows - too many selected rows found" );
     491             :     }
     492           0 : }
     493             : // -----------------------------------------------------------------------------
     494           0 : void BrowseBox::GetAllSelectedColumns( ::com::sun::star::uno::Sequence< sal_Int32 >& _rColumns ) const
     495             : {
     496           0 :     const MultiSelection* pColumnSel = GetColumnSelection();
     497           0 :     sal_Int32 nCount = GetSelectedColumnCount();
     498           0 :     if( pColumnSel && nCount )
     499             :     {
     500           0 :         _rColumns.realloc( nCount );
     501             : 
     502           0 :         sal_Int32 nIndex = 0;
     503           0 :         sal_uInt32 nRangeCount = pColumnSel->GetRangeCount();
     504           0 :         for( sal_uInt32 nRange = 0; nRange < nRangeCount; ++nRange )
     505             :         {
     506           0 :             const Range& rRange = pColumnSel->GetRange( nRange );
     507             :             // loop has to include aRange.Max()
     508           0 :             for( sal_Int32 nCol = rRange.Min(); nCol <= rRange.Max(); ++nCol )
     509             :             {
     510             :                 DBG_ASSERT( nIndex < nCount,
     511             :                     "GetAllSelectedColumns - range overflow" );
     512           0 :                 _rColumns[ nIndex ] = nCol;
     513           0 :                 ++nIndex;
     514             :             }
     515             :         }
     516             :     }
     517           0 : }
     518             : // -----------------------------------------------------------------------------
     519           0 : sal_Bool BrowseBox::IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
     520             : {
     521           0 :     return IsFieldVisible( _nRow, GetColumnId( _nColumnPos ) );
     522             : }
     523             : // -----------------------------------------------------------------------------
     524           0 : String BrowseBox::GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const
     525             : {
     526           0 :     return GetCellText( _nRow, GetColumnId( _nColPos ) );
     527             : }
     528             : 
     529             : // -----------------------------------------------------------------------------
     530           0 : sal_Bool BrowseBox::GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex, int nLen, int nBase, MetricVector& rVector )
     531             : {
     532           0 :     return Control::GetGlyphBoundRects( rOrigin, rStr, nIndex, nLen, nBase, rVector );
     533             : }
     534             : // -----------------------------------------------------------------------------
     535           0 : Rectangle BrowseBox::GetWindowExtentsRelative( Window *pRelativeWindow ) const
     536             : {
     537           0 :     return Control::GetWindowExtentsRelative( pRelativeWindow );
     538             : }
     539             : // -----------------------------------------------------------------------------
     540           0 : void BrowseBox::GrabFocus()
     541             : {
     542           0 :     Control::GrabFocus();
     543           0 : }
     544             : // -----------------------------------------------------------------------------
     545           0 : Reference< XAccessible > BrowseBox::GetAccessible( sal_Bool bCreate )
     546             : {
     547           0 :     return Control::GetAccessible( bCreate );
     548             : }
     549             : // -----------------------------------------------------------------------------
     550           0 : Window* BrowseBox::GetAccessibleParentWindow() const
     551             : {
     552           0 :     return Control::GetAccessibleParentWindow();
     553             : }
     554             : // -----------------------------------------------------------------------------
     555           0 : Window* BrowseBox::GetWindowInstance()
     556             : {
     557           0 :     return this;
     558             : }
     559             : 
     560             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10