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