From dd42af8c16804d848b1358ea46811fae64088f9f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 23 Dec 2010 15:48:53 +0100 Subject: gridsort: re-factoring the column-resizing thingie, step 1 In the current implementation, this is rather complex, and hardly maintainable. Also, it all happens in TableControl_Impl and TableDataWindow, while in the original design, the InputHandler was intended to care for this kind of tasks (one class - one responsibility). --- automation/source/server/statemnt.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'automation') diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index a288c3d4d3a7..353796a4c594 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -6207,7 +6207,7 @@ protected: 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 ) + while ( ( nLastPos = pTC->GetRowAtPoint( aPos ) ) != nNr1-1 && nStep > 0 ) { if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) aPos.Y() -= nStep; @@ -6215,7 +6215,7 @@ protected: aPos.Y() += nStep; nStep /= 2; } - if ( pTC->GetCurrentRow( aPos ) == nNr1-1 ) + if ( pTC->GetRowAtPoint( aPos ) == nNr1-1 ) { MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); -- cgit v1.2.3 From 9b34df43b9a054b0eea74f65f68b11ddd93ae5eb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 4 Jan 2011 10:37:54 +0100 Subject: gridsort: getCellContent: (col,row) instead of (row,col) parameters --- automation/source/server/statemnt.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'automation') diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 353796a4c594..3e086f485826 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -6112,7 +6112,8 @@ protected: ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) { ::svt::table::PTableModel pModel = pTC->GetModel(); - Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + Any aCell; + pModel->getCellContent( nNr1-1, nNr2-1, aCell ); pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() )); } } @@ -6123,7 +6124,8 @@ protected: ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) { ::svt::table::PTableModel pModel = pTC->GetModel(); - Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + Any aCell; + pModel->getCellContent( nNr1-1, nNr2-1, aCell ); /* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately SbxVariableRef xRes = new SbxVariable( SbxVARIANT ); unoToSbxValue( xRes, aCell ); -- cgit v1.2.3 From 1cc8adbaf6e766689c879672936e98f88b1d9c08 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 11 Jan 2011 10:58:26 +0100 Subject: gridsort: removed XGridControl::setTooltip. It had a rather strange semantics, seems to be unused in the current OOo code base, and would belong to the model, if at all. Still one thing to do: do not unconditionally display the cell content as tooltip, but make this dependent on whether or not the cell content fits into the cell. --- automation/source/server/statemnt.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'automation') diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 3e086f485826..a42f0fd67f95 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -83,6 +83,7 @@ #include #include #include +#include #include #include // Hat keinen Includeschutz @@ -6209,7 +6210,7 @@ protected: Point aPos( aSize.Width() / 2, aSize.Height() / 2 ); long nStep = aSize.Height() / 4; ::svt::table::RowPos nLastPos; - while ( ( nLastPos = pTC->GetRowAtPoint( aPos ) ) != nNr1-1 && nStep > 0 ) + while ( ( nLastPos = pTC->getTableControlInterface().getRowAtPoint( aPos ) ) != nNr1-1 && nStep > 0 ) { if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) aPos.Y() -= nStep; @@ -6217,7 +6218,7 @@ protected: aPos.Y() += nStep; nStep /= 2; } - if ( pTC->GetRowAtPoint( aPos ) == nNr1-1 ) + if ( pTC->getTableControlInterface().getRowAtPoint( aPos ) == nNr1-1 ) { MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); -- cgit v1.2.3 From bba68ad15d79fc2fd58c7bdf75d8badc66253077 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 11 Jan 2011 13:26:40 +0100 Subject: gridsort: IAbstractTableControl renamed to ITableControl, added a few more methods previously found at the TableControl_Impl only --- automation/source/server/statemnt.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'automation') diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index a42f0fd67f95..89c59f8172af 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -83,7 +83,7 @@ #include #include #include -#include +#include #include #include // Hat keinen Includeschutz -- cgit v1.2.3 From 3862204a208143119d3304ef891d591b6da831de Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 14 Jan 2011 11:04:24 +0100 Subject: gridsort: ouch. Removed IAccessibleTable::GetSelectedRows. It exposed an internal implementation detail, and in fact some clients (the A11Y API implementation) exploited this, e.g. by simply adding elements to the array, without the owner (the TableControl/_Impl) ever noticing it. Replaced that with a working API. In this course, removed XGridSelection::getMin/MaxSelectionIndex. Pretty useless IMO, unused, and ugly to implement. --- accessibility/source/extended/AccessibleGridControlTable.cxx | 3 +-- accessibility/source/extended/AccessibleGridControlTableBase.cxx | 5 ++++- automation/source/server/statemnt.cxx | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) mode change 100755 => 100644 accessibility/source/extended/AccessibleGridControlTableBase.cxx (limited to 'automation') diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 513056877967..49e469675cef 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -245,8 +245,7 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil ensureIsValidIndex( nChildIndex ); sal_Int32 nColumns = m_aTable.GetColumnCount(); sal_Int32 nRow = (nChildIndex / nColumns); - std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows(); - selectedRows.push_back(nRow); + m_aTable.SelectRow( nRow, TRUE ); } sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx old mode 100755 new mode 100644 index f6d1147ad309..d97feb1277ec --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -245,7 +245,10 @@ sal_Int32 AccessibleGridControlTableBase::implGetChildIndex( void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& rSeq ) { - rSeq = comphelper::containerToSequence(m_aTable.GetSelectedRows()); + sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() ); + rSeq.realloc( selectionCount ); + for ( sal_Int32 i=0; iGenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() )); + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRowCount() )); break; case M_GetSelIndex : if ( ! (nParams & PARAM_USHORT_1) ) nNr1 = 1; - if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRows().size() ) ) - pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows()[nNr1-1] +1 ) ); + if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRowCount() ) ) + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRowIndex( nNr1-1 ) +1 ) ); break; /* case M_GetSelText : if ( ! (nParams & PARAM_USHORT_1) ) -- cgit v1.2.3 From 16932cb2060d4f3965a8db131a6b6123c2b7760f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 19 Jan 2011 08:38:58 +0100 Subject: gridsort: TableControl API adjustments --- automation/source/server/statemnt.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'automation') diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 3e3b6db764df..f4ae483da633 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -6210,7 +6210,7 @@ protected: Point aPos( aSize.Width() / 2, aSize.Height() / 2 ); long nStep = aSize.Height() / 4; ::svt::table::RowPos nLastPos; - while ( ( nLastPos = pTC->getTableControlInterface().getRowAtPoint( aPos ) ) != nNr1-1 && nStep > 0 ) + while ( ( nLastPos = pTC->getTableControlInterface().hitTest( aPos ).nRow ) != nNr1-1 && nStep > 0 ) { if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) aPos.Y() -= nStep; @@ -6218,7 +6218,7 @@ protected: aPos.Y() += nStep; nStep /= 2; } - if ( pTC->getTableControlInterface().getRowAtPoint( aPos ) == nNr1-1 ) + if ( pTC->getTableControlInterface().hitTest( aPos ).nRow == nNr1-1 ) { MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); -- cgit v1.2.3