From a3ab9e8435dc16a89589e552a66485da4eb60d04 Mon Sep 17 00:00:00 2001 From: Mihaela Kedikova Date: Mon, 22 Mar 2010 11:17:10 +0100 Subject: recent changes for grid control --- .../source/extended/AccessibleGridControl.cxx | 7 -- .../source/extended/AccessibleGridControlBase.cxx | 7 -- .../extended/AccessibleGridControlHeader.cxx | 49 +++-------- .../source/extended/AccessibleGridControlTable.cxx | 97 ++++++++++------------ .../extended/AccessibleGridControlTableBase.cxx | 4 - .../extended/AccessibleGridControlTableCell.cxx | 7 +- 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 #include #include -//#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 = 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 selectedRows = getSelectedAccessibleRows(); + for(int i=0;i 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 -- cgit From 550d319ebe948dff72deaac7f0ef87f30c53006b Mon Sep 17 00:00:00 2001 From: Mihaela Kedikova Date: Tue, 23 Mar 2010 09:35:24 +0100 Subject: fixed bugs for linux build 4 --- accessibility/source/extended/AccessibleGridControlTable.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 8457406010de..e1047bcb969a 100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -282,7 +282,7 @@ void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection() TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - for(int i=0;i Date: Fri, 9 Apr 2010 13:46:38 +0200 Subject: add controltype for tablecontrol for testtool --- automation/source/server/sta_list.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index 7f346c298563..c0abcb057f8b 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #define WINDOW_ANYTYPE WINDOW_BASE @@ -999,6 +1000,8 @@ String StatementList::ClientTree(Window *pBase, int Indent) WRITEc("/RoadMap") else if ( dynamic_cast< svt::IExtensionListBox* >(pBase) ) WRITEc("/ExtensionListBox") + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + WRITEc("/TableControl") else WRITEc("/Unknown") } -- cgit From 536fef4b613ed07e96145fffcf61dc4d7d426496 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 9 Apr 2010 14:09:30 +0200 Subject: add methods for tablecontrol --- automation/source/server/statemnt.cxx | 149 ++++++++++++++++++++++++++++++++-- 1 file changed, 143 insertions(+), 6 deletions(-) diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 68ff61bbaa0d..3b29ddd93544 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -82,6 +82,7 @@ #include #include #include +#include #include #include // Hat keinen Includeschutz @@ -128,9 +129,10 @@ using namespace com::sun::star::frame; using namespace com::sun::star::uno; -using namespace com::sun::star::util; +//using namespace com::sun::star::util; geht wegen Color nicht using namespace com::sun::star::beans; using namespace svt; +//using namespace svt::table; #ifndef SBX_VALUE_DECL_DEFINED @@ -618,7 +620,7 @@ BOOL StatementSlot::Execute() AddReferer(); if ( !aUnoUrl.Len() ) aUnoUrl = CUniString("slot:").Append( String::CreateFromInt32( nFunctionId ) ); - URL aTargetURL; + ::com::sun::star::util::URL aTargetURL; aTargetURL.Complete = aUnoUrl; Reference < XFramesSupplier > xDesktop = Reference < XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.frame.Desktop") ), UNO_QUERY ); Reference < XFrame > xFrame; @@ -664,7 +666,7 @@ BOOL StatementSlot::Execute() ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_FRAME, aTargetURL.Complete ) ); else { - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -865,6 +867,13 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst if ( bFirst ) pRet->GenReturn ( RET_WinInfo, SmartId(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE ); + if ( bFirst ) + { + if ( pBase->GetType() == WINDOW_WINDOW && pBase->GetParent() && pBase->GetParent()->GetType() == WINDOW_CONTROL && + dynamic_cast< svt::table::TableControl* > ( pBase->GetParent() ) ) + pBase = pBase->GetParent(); + } + { // Klammerung, so daß der String nicht während der Rekursion bestehen bleibt String aName; BOOL bSkip = FALSE; @@ -958,6 +967,8 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst aTypeSuffix.AppendAscii( "/RoadMap", 8 ); else if ( dynamic_cast< IExtensionListBox* >(pBase) ) aTypeSuffix.AppendAscii( "/ExtensionListBox" ); + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + aTypeSuffix.AppendAscii( "/TableControl" ); else aTypeSuffix.AppendAscii( "/Unknown", 8 ); } @@ -3388,17 +3399,17 @@ BOOL StatementCommand::Execute() { if( (nParams & PARAM_USHORT_1) ) { - Reference < XCancellable > xPicker; + Reference < ::com::sun::star::util::XCancellable > xPicker; switch( nNr1 ) { case CONST_FilePicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); } break; case CONST_FolderPicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); } break; default: @@ -5807,6 +5818,8 @@ BOOL StatementControl::Execute() nRealControlType = CONST_CTORoadmap; else if ( dynamic_cast< IExtensionListBox* >(pControl) ) nRealControlType = CONST_CTIExtensionListBox; + else if ( dynamic_cast< ::svt::table::TableControl* >(pControl) ) + nRealControlType = CONST_CTTableControl; else nRealControlType = CONST_CTUnknown; @@ -6148,6 +6161,130 @@ protected: } } break; + + case CONST_CTTableControl: + { + ::svt::table::TableControl *pTC = dynamic_cast< ::svt::table::TableControl* >(pControl); + switch ( nMethodId ) + { + case M_GetItemType : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr1-1][nNr2-1]; + pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() )); + } + } + break; + case M_GetItemText : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr1-1][nNr2-1]; + ::rtl::OUString aContent; + aCell >>= aContent; + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + } + break; + case M_GetColumnCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetColumnCount() ); + } + break; + case M_GetRowCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetRowCount() ); + } + break; +/* case M_IsEditing : + { + CellControllerRef aControler; + aControler = pEBBox->Controller(); + pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)aControler.Is() ); + } + break; + case M_Select : + { + if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pEBBox->GetRowCount() ) ) + { + USHORT nColCount = pEBBox->GetColumnCount(); + comm_USHORT nUnfrozenColCount = 0; + USHORT i; + for ( i=0 ; i < nColCount ; i++ ) + { + if ( !pEBBox->IsFrozen( pEBBox->GetColumnId( i ) ) ) + nUnfrozenColCount++; + } + if ( ValueOK(aUId, MethodString( nMethodId ),nNr2,nUnfrozenColCount ) ) + pEBBox->GoToRowColumnId( nNr1-1, pEBBox->GetColumnId( nNr2 ) ); + } + } + break; + + + + + case M_GetSelCount : + pRet->GenReturn ( RET_Value, aUId, comm_ULONG(((SvLBox*)pControl)->GetSelectionCount())); + break; + case M_GetSelIndex : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK(aUId, CUniString("GetSelIndex"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) + { + nNr1--; + COUNT_LBOX( FirstSelected, NextSelected, nNr1); + pRet->GenReturn ( RET_Value, aUId, comm_ULONG( ((SvTreeListBox*)pControl)->GetVisiblePos( pThisEntry )) +1 ); + } + break; + case M_GetSelText : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) + { + nNr1--; + COUNT_LBOX( FirstSelected, NextSelected, nNr1); + GetFirstValidTextItem( pThisEntry ); + pRet->GenReturn ( RET_Value, aUId, pItem->GetText() ); + } + break; + case M_Select : + if ( ! (nParams & PARAM_BOOL_1) ) + bBool1 = TRUE; + if( nParams & PARAM_STR_1 ) + { + / * ListBox *pLB = ((ListBox*)pControl); + if ( pLB->GetEntryPos( aString1 ) == LISTBOX_ENTRY_NOTFOUND ) + ReportError( aUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) ); + else + { + pLB->SelectEntry( aString1, bBool1 ); + if ( pLB->IsEntrySelected( aString1 ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL + ReportError( aUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), aString1 ) ); + } + * / ReportError( aUId, GEN_RES_STR1( S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED, MethodString( nMethodId ) ) ); + } + else + { + if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) ) + { + SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 ); + ((SvTreeListBox*)pControl)->Select ( pEntry, bBool1 ); + } + } + break;*/ + default: + ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "RoadMap" ) ); + break; + } + } + break; + case CONST_CTUnknown: ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) ); break; -- cgit From 91959a7278da32ef9e44abb2b9b2fd35eb3a6195 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 9 Apr 2010 14:11:22 +0200 Subject: new define CONST_CTTableControl --- automation/source/inc/rcontrol.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automation/source/inc/rcontrol.hxx b/automation/source/inc/rcontrol.hxx index 829dd320beb6..7313603096b4 100644 --- a/automation/source/inc/rcontrol.hxx +++ b/automation/source/inc/rcontrol.hxx @@ -305,7 +305,7 @@ #define RC_Profile ( M_SOFFICE | M_MOZILLA | 9 ) // (Popup)Menu #define RC_MenuSelect ( M_SOFFICE | M_MOZILLA | 10 ) -#define RC_SetControlType ( M_SOFFICE | 11 ) +#define RC_SetControlType ( M_SOFFICE | 11 ) // deprecated since RTTI // RemoteFileAccess #define RC_Kill ( M_SOFFICE | 12 ) #define RC_RmDir ( M_SOFFICE | 13 ) @@ -429,14 +429,14 @@ -// Konstanten die im Basic zur Verfügung stehen sollen +// Constants which are available in VCLTestTool scripts -// Verschiedene Typen von Controls für den Befehl SetControlType -// !!!!!!!!!!! Müssen alle bei SetControlType eingetragen werden !!!!!!!!!!!! +// Different types of controls recognized via RTTI #define CONST_CTBrowseBox 100 #define CONST_CTValueSet 103 #define CONST_CTORoadmap 104 #define CONST_CTIExtensionListBox 105 +#define CONST_CTTableControl 106 #define CONST_CTUnknown 199 // Konstanten für das ALignment des gesuchten Splitters -- cgit From f3d3abbe4f0df2a9b7fc6bc6c758611ea1e79ab2 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Tue, 13 Apr 2010 13:33:30 +0200 Subject: fix some errors --- automation/source/server/statemnt.cxx | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 3b29ddd93544..71e76f146e10 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -6173,7 +6173,7 @@ protected: ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) { ::svt::table::PTableModel pModel = pTC->GetModel(); - Any aCell = pModel->getCellContent()[nNr1-1][nNr2-1]; + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() )); } } @@ -6184,7 +6184,7 @@ protected: ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) { ::svt::table::PTableModel pModel = pTC->GetModel(); - Any aCell = pModel->getCellContent()[nNr1-1][nNr2-1]; + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; ::rtl::OUString aContent; aCell >>= aContent; pRet->GenReturn ( RET_Value, aUId, aContent ); @@ -6207,21 +6207,16 @@ protected: aControler = pEBBox->Controller(); pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)aControler.Is() ); } - break; + break;*/ case M_Select : { - if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pEBBox->GetRowCount() ) ) + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) { - USHORT nColCount = pEBBox->GetColumnCount(); - comm_USHORT nUnfrozenColCount = 0; - USHORT i; - for ( i=0 ; i < nColCount ; i++ ) - { - if ( !pEBBox->IsFrozen( pEBBox->GetColumnId( i ) ) ) - nUnfrozenColCount++; - } - if ( ValueOK(aUId, MethodString( nMethodId ),nNr2,nUnfrozenColCount ) ) - pEBBox->GoToRowColumnId( nNr1-1, pEBBox->GetColumnId( nNr2 ) ); + if ( pTC->GoTo( ::svt::table::ColPos( nNr1 ), ::svt::table::RowPos( nNr2 ) ) ) + pTC->Select(); + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) ); } } break; @@ -6229,7 +6224,7 @@ protected: - case M_GetSelCount : +/* case M_GetSelCount : pRet->GenReturn ( RET_Value, aUId, comm_ULONG(((SvLBox*)pControl)->GetSelectionCount())); break; case M_GetSelIndex : @@ -6279,7 +6274,7 @@ protected: } break;*/ default: - ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "RoadMap" ) ); + ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) ); break; } } -- cgit From 591628e221db19e0ebe86208bea9c522c8c9c629 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 16 Apr 2010 14:12:57 +0200 Subject: add new VCLTestTool methods for TableControl --- automation/source/server/statemnt.cxx | 143 +++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 52 deletions(-) diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 71e76f146e10..89be43de60ab 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -97,6 +97,7 @@ #include #endif #include +#include #include #include #include @@ -6185,9 +6186,65 @@ protected: { ::svt::table::PTableModel pModel = pTC->GetModel(); Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; - ::rtl::OUString aContent; - aCell >>= aContent; - pRet->GenReturn ( RET_Value, aUId, aContent ); + /* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately + SbxVariableRef xRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( xRes, aCell ); + pRet->GenReturn ( RET_Value, aUId, *xRes );*/ + + Type aType = aCell.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + switch( eTypeClass ) + { + /*case TypeClass_ENUM: + { + sal_Int32 nEnum = 0; + enum2int( nEnum, aValue ); + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)nEnum ); + } + break;*/ + case TypeClass_BOOLEAN: + pRet->GenReturn ( RET_Value, aUId, *(sal_Bool*)aCell.getValue() ); + break; + case TypeClass_CHAR: + { + ::rtl::OUString aContent( *(sal_Unicode*)aCell.getValue() ); + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + case TypeClass_STRING: + { + ::rtl::OUString aContent; + aCell >>= aContent; + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + //case TypeClass_FLOAT: break; + //case TypeClass_DOUBLE: break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: + case TypeClass_SHORT: + case TypeClass_LONG: + case TypeClass_HYPER: + case TypeClass_UNSIGNED_LONG: + case TypeClass_UNSIGNED_HYPER: + { + comm_ULONG val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: + { + comm_USHORT val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + default: + pRet->GenReturn ( RET_Value, aUId, comm_USHORT(0) ); + break; + } } } break; @@ -6201,43 +6258,49 @@ protected: pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetRowCount() ); } break; -/* case M_IsEditing : - { - CellControllerRef aControler; - aControler = pEBBox->Controller(); - pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)aControler.Is() ); - } - break;*/ case M_Select : { - if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && - ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetRowCount() )) { - if ( pTC->GoTo( ::svt::table::ColPos( nNr1 ), ::svt::table::RowPos( nNr2 ) ) ) - pTC->Select(); + if ( pTC->GoToRow( ::svt::table::RowPos( nNr1-1 ) ) ) + { + Size aSize( pTC->GetSizePixel() ); +// DirectLog( S_QAError, UniString::CreateFromInt32( aSize.Width() ).Append( UniString::CreateFromInt32( aSize.Height() ) ) ); + Point aPos( aSize.Width() / 2, aSize.Height() / 2 ); + long nStep = aSize.Height() / 4; + ::svt::table::RowPos nLastPos; + while ( ( nLastPos = pTC->GetCurrentRow( aPos ) ) != nNr1-1 && nStep > 0 ) + { + if ( nLastPos > nNr1-1 ) + aPos.Y() -= nStep; + else + aPos.Y() += nStep; + nStep /= 2; + } + if ( pTC->GetCurrentRow( aPos ) == nNr1-1 ) + { + MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); + pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); + pTC->getSelEngine()->SelMouseButtonUp( aMEvnt ); + } + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "find pos" ) ); + } else ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) ); } } break; - - - - -/* case M_GetSelCount : - pRet->GenReturn ( RET_Value, aUId, comm_ULONG(((SvLBox*)pControl)->GetSelectionCount())); + case M_GetSelCount : + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() )); break; case M_GetSelIndex : if ( ! (nParams & PARAM_USHORT_1) ) nNr1 = 1; - if ( ValueOK(aUId, CUniString("GetSelIndex"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) - { - nNr1--; - COUNT_LBOX( FirstSelected, NextSelected, nNr1); - pRet->GenReturn ( RET_Value, aUId, comm_ULONG( ((SvTreeListBox*)pControl)->GetVisiblePos( pThisEntry )) +1 ); - } + if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRows().size() ) ) + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows()[nNr1-1] +1 ) ); break; - case M_GetSelText : +/* case M_GetSelText : if ( ! (nParams & PARAM_USHORT_1) ) nNr1 = 1; if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) @@ -6248,31 +6311,7 @@ protected: pRet->GenReturn ( RET_Value, aUId, pItem->GetText() ); } break; - case M_Select : - if ( ! (nParams & PARAM_BOOL_1) ) - bBool1 = TRUE; - if( nParams & PARAM_STR_1 ) - { - / * ListBox *pLB = ((ListBox*)pControl); - if ( pLB->GetEntryPos( aString1 ) == LISTBOX_ENTRY_NOTFOUND ) - ReportError( aUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) ); - else - { - pLB->SelectEntry( aString1, bBool1 ); - if ( pLB->IsEntrySelected( aString1 ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL - ReportError( aUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), aString1 ) ); - } - * / ReportError( aUId, GEN_RES_STR1( S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED, MethodString( nMethodId ) ) ); - } - else - { - if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) ) - { - SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 ); - ((SvTreeListBox*)pControl)->Select ( pEntry, bBool1 ); - } - } - break;*/ + */ default: ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) ); break; -- cgit From 771a23df1757f5aecbd2cb722e15691e9a6f28ff Mon Sep 17 00:00:00 2001 From: Mihaela Kedikova Date: Fri, 30 Apr 2010 10:22:04 +0200 Subject: gridcontrol_03: bug fixes --- automation/source/server/statemnt.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 89be43de60ab..2d1cccd9fc51 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -6271,7 +6271,7 @@ protected: ::svt::table::RowPos nLastPos; while ( ( nLastPos = pTC->GetCurrentRow( aPos ) ) != nNr1-1 && nStep > 0 ) { - if ( nLastPos > nNr1-1 ) + if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) aPos.Y() -= nStep; else aPos.Y() += nStep; -- cgit