diff options
Diffstat (limited to 'accessibility')
6 files changed, 58 insertions, 113 deletions
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 4671f3284110..2d313264bc6a 100755 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -36,7 +36,6 @@ #include <svtools/accessibletable.hxx> #include <comphelper/types.hxx> #include <toolkit/helper/vclunohelper.hxx> -//#include "svtools/table/tablecontrol.hxx" // ============================================================================ @@ -77,8 +76,6 @@ public: AccessibleGridControlHeader* m_pColumnHeaderBar; }; -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControl ) AccessibleGridControl::AccessibleGridControl( @@ -86,7 +83,6 @@ AccessibleGridControl::AccessibleGridControl( IAccessibleTable& _rTable ) : AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ) { -// DBG_CTOR( AccessibleTableControl, NULL ); m_pImpl.reset( new AccessibleGridControl_Impl() ); m_pImpl->m_aCreator = _rxCreator; } @@ -94,7 +90,6 @@ AccessibleGridControl::AccessibleGridControl( // ----------------------------------------------------------------------------- AccessibleGridControl::~AccessibleGridControl() { - DBG_DTOR( AccessibleGridControl, NULL ); } // ----------------------------------------------------------------------------- @@ -334,13 +329,11 @@ AccessibleGridControlAccess::AccessibleGridControlAccess( const Reference< XAcce ,m_rTable( _rTable ) ,m_pContext( NULL ) { - DBG_CTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- AccessibleGridControlAccess::~AccessibleGridControlAccess() { - DBG_DTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 91dd9bd3bdc5..8af6728dd827 100755 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -60,8 +60,6 @@ namespace accessibility { using namespace com::sun::star::accessibility::AccessibleStateType; // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlBase ) AccessibleGridControlBase::AccessibleGridControlBase( @@ -76,13 +74,10 @@ AccessibleGridControlBase::AccessibleGridControlBase( m_aDescription( rTable.GetAccessibleObjectDescription( eObjType ) ), m_aClientId(0) { - DBG_CTOR( AccessibleGridControlBase, NULL ); } AccessibleGridControlBase::~AccessibleGridControlBase() { -// DBG_DTOR( AccessibleGridControlBase, NULL ); - if( isAlive() ) { // increment ref count to prevent double call of Dtor @@ -521,7 +516,6 @@ GridControlAccessibleElement::GridControlAccessibleElement( const Reference< XAc AccessibleTableControlObjType eObjType ) :AccessibleGridControlBase( rxParent, rTable, eObjType ) { -// DBG_CTOR( GridControlAccessibleElement, NULL ); } // XInterface ----------------------------------------------------------------- @@ -540,7 +534,6 @@ Reference< XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccess // ---------------------------------------------------------------------------- GridControlAccessibleElement::~GridControlAccessibleElement( ) { -// DBG_DTOR( GridControlAccessibleElement, NULL ); } // ============================================================================ diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index a5a2be4049dc..fe02c92222fd 100755 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -59,8 +59,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlHeader ) AccessibleGridControlHeader::AccessibleGridControlHeader( @@ -69,15 +67,12 @@ AccessibleGridControlHeader::AccessibleGridControlHeader( ::svt::table::AccessibleTableControlObjType eObjType): AccessibleGridControlTableBase( rxParent, rTable, eObjType ) { -// DBG_CTOR( AccessibleGridControlHeaderBar, NULL ); - DBG_ASSERT( isRowBar() || isColumnBar(), "accessibility/extended/AccessibleGridControlHeaderBar - invalid object type" ); } AccessibleGridControlHeader::~AccessibleGridControlHeader() { -// DBG_DTOR( AccessibleGridControlHeader, NULL ); } // XAccessibleContext --------------------------------------------------------- @@ -184,35 +179,24 @@ Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibl ensureIsAlive(); return NULL; // no headers in headers } - +//not selectable Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleRows() throw ( uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - - Sequence< sal_Int32 > aSelSeq; - // row of column header bar not selectable - if( isRowBar() ) - implGetSelectedRows( aSelSeq ); + Sequence< sal_Int32 > aSelSeq(0); return aSelSeq; } //columns aren't selectable Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleColumns() throw ( uno::RuntimeException ) { - return NULL; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//To Do - not yet implemented -sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 nRow ) +//row headers not selectable +sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 /*nRow*/ ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidRow( nRow ); - //return isRowBar() ? implIsRowSelected( nRow ) : sal_False; return sal_False; } //columns aren't selectable @@ -222,28 +206,19 @@ sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleColumnSelected( sal_I (void)nColumn; return sal_False; } - +//not implemented Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleCellAt( - sal_Int32 nRow, sal_Int32 nColumn ) + sal_Int32 /*nRow*/, sal_Int32 /*nColumn*/ ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidAddress( nRow, nColumn ); - return implGetChild( nRow, implToVCLColumnPos( nColumn ) ); + return NULL; } -// TO DO - not implemented yet +// not selectable sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleSelected( - sal_Int32 nRow, sal_Int32 nColumn ) + sal_Int32 /*nRow*/, sal_Int32 /*nColumn */) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidAddress( nRow, nColumn ); - return FALSE; - // return isRowBar() ? implIsRowSelected( nRow ) : implIsColumnSelected( nColumn ); + return sal_False; } // XServiceInfo --------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 3b51c986b8b1..8457406010de 100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -54,8 +54,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTable ) AccessibleGridControlTable::AccessibleGridControlTable( @@ -64,12 +62,10 @@ AccessibleGridControlTable::AccessibleGridControlTable( AccessibleTableControlObjType _eType) : AccessibleGridControlTableBase( rxParent, rTable, _eType ) { - DBG_CTOR( AccessibleGridControlTable, NULL ); } AccessibleGridControlTable::~AccessibleGridControlTable() { - DBG_DTOR( AccessibleGridControlTable, NULL ); } // XAccessibleContext --------------------------------------------------------- @@ -197,20 +193,28 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible // Sequence< sal_Int32 > aSelSeq; // implGetSelectedColumns( aSelSeq ); // return aSelSeq; - return NULL; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//To Do: not implemented yet sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 nRow ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - //TCSolarGuard aSolarGuard; - //::osl::MutexGuard aGuard( getOslMutex() ); - //ensureIsAlive(); - //ensureIsValidRow( nRow ); - //return implIsRowSelected( nRow ); - (void) nRow; - return sal_False; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + sal_Bool bSelected = sal_False; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0; i<selectedRows.getLength(); i++) + { + if(nRow == selectedRows[i]) + { + bSelected = sal_True; + continue; + } + } + return bSelected; } //columns aren't selectable @@ -241,16 +245,14 @@ sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - /*TCSolarGuard aSolarGuard; + TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidAddress( nRow, nColumn ); - return implIsRowSelected( nRow ) || implIsColumnSelected( nColumn );*/ - (void) nRow; (void) nColumn; - return sal_False; + //selection of single cells not possible, so if row is selected, the cell will be selected too + return isAccessibleRowSelected(nRow); } -//To Do: not implemented yet void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { @@ -258,48 +260,51 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidIndex( nChildIndex ); - //if( isRowBar() ) - // implSelectRow( nChildIndex, sal_True ); - //else - // implSelectColumn( implToVCLColumnPos( nChildIndex ), sal_True ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows(); + selectedRows.push_back(nRow); } -//To Do - not implemented yet sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - // using interface methods - no mutex - /*return isRowBar() ? - isAccessibleRowSelected( nChildIndex ) : - isAccessibleColumnSelected( nChildIndex );*/ - (void)nChildIndex; - return FALSE; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + return isAccessibleRowSelected(nRow); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + for(int i=0;i<m_aTable.GetSelectedRows().size();i++) + m_aTable.RemoveSelectedRow((sal_Int32)i); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0;i<m_aTable.GetRowCount();i++) + selectedRows[i]=i; } -//To Do - not implemented yet sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - return 0; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + return selectedRows.getLength()*nColumns; } -//To Do - not implemented yet Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -307,10 +312,12 @@ AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChild TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - (void)nSelectedChildIndex; - return NULL; + if(isAccessibleChildSelected(nSelectedChildIndex)) + return getAccessibleChild(nSelectedChildIndex); + else + return NULL; } -//To Do - not implemented yet +//not implemented yet, because only row selection possible void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -319,14 +326,6 @@ void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); (void)nSelectedChildIndex; - // method may throw lang::IndexOutOfBoundsException - //if ( isAccessibleChildSelected(nSelectedChildIndex) ) - //{ - // if( isRowBar() ) - // implSelectRow( nSelectedChildIndex, sal_False ); - // else - // implSelectColumn( implToVCLColumnPos( nSelectedChildIndex ), sal_False ); - //} } // XInterface ----------------------------------------------------------------- @@ -367,14 +366,6 @@ Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() return m_aTable.calcTableRect(); } // internal helper methods ---------------------------------------------------- -//To Do - not implemented yet -//sal_Int32 AccessibleGridControlTable::implGetChildIndexFromSelectedIndex( -// sal_Int32 nSelectedChildIndex ) -// throw ( lang::IndexOutOfBoundsException ) -//{ -// (void)nSelectedChildIndex; -// return 0; -//} Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar( sal_Int32 nChildIndex ) throw ( uno::RuntimeException ) diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index 76584bf4b965..2416e96fdd53 100755 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -56,8 +56,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTableBase ) AccessibleGridControlTableBase::AccessibleGridControlTableBase( @@ -66,12 +64,10 @@ AccessibleGridControlTableBase::AccessibleGridControlTableBase( AccessibleTableControlObjType eObjType ) : GridControlAccessibleElement( rxParent, rTable, eObjType ) { - DBG_CTOR( AccessibleGridControlTableBase, NULL ); } AccessibleGridControlTableBase::~AccessibleGridControlTableBase() { - DBG_DTOR( AccessibleGridControlTableBase, NULL ); } // XAccessibleContext --------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index 981a3e6086b0..cad1d7f0cbc3 100755 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -68,7 +68,6 @@ namespace accessibility // ============================================================================= // = AccessibleGridControlCell // ============================================================================= - //DBG_NAME( svt_AccessibleGridControlCell ) // ----------------------------------------------------------------------------- AccessibleGridControlCell::AccessibleGridControlCell( const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable, @@ -77,7 +76,6 @@ namespace accessibility ,m_nRowPos( _nRowPos ) ,m_nColPos( _nColPos ) { -// DBG_CTOR( svt_AccessibleGridControlCell, NULL ); // set accessible name here, because for that we need the position of the cell // and so the base class isn't capable of doing this ::rtl::OUString aAccName; @@ -107,8 +105,7 @@ namespace accessibility ::rtl::OUString AccessibleGridControlTableCell::implGetText() { ensureIsAlive(); - //return mpTable->GetAccessibleCellText( getRowPos(), static_cast< USHORT >( getColumnPos() ) ); - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "test" )); + return m_aTable.GetAccessibleCellText( getRowPos(), getColumnPos() ); } ::com::sun::star::lang::Locale AccessibleGridControlTableCell::implGetLocale() @@ -366,12 +363,12 @@ namespace accessibility //!!! don't know how to put a string into the clipboard return sal_False; } + Rectangle AccessibleGridControlTableCell::implGetBoundingBox() { return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle } // ----------------------------------------------------------------------------- - Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen() { return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle |