diff options
author | Mihaela Kedikova <misheto@openoffice.org> | 2010-06-11 17:09:46 +0200 |
---|---|---|
committer | Mihaela Kedikova <misheto@openoffice.org> | 2010-06-11 17:09:46 +0200 |
commit | 582fd11a71e391a5d8896ef4b25183023b1d07c1 (patch) | |
tree | e4e6f70efbf19472371fd7b7e9e929a10a71ec94 /svtools | |
parent | b75ce9cf2a1345f1eb59d8e2d28d0e0eb7b72422 (diff) |
gridcontrol04: fix for #i112290# and some build problems
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/table/tabledatawindow.cxx | 8 | ||||
-rwxr-xr-x | svtools/source/uno/svtxgridcontrol.cxx | 30 |
2 files changed, 20 insertions, 18 deletions
diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 71410fee4e2a..5e2cb44cd9a3 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -57,22 +57,22 @@ namespace svt { namespace table //-------------------------------------------------------------------- void TableDataWindow::SetBackground( const Wallpaper& rColor ) { - SetBackground( rColor ); + Window::SetBackground( rColor ); } //-------------------------------------------------------------------- void TableDataWindow::SetControlBackground( const Color& rColor ) { - SetControlBackground( rColor ); + Window::SetControlBackground( rColor ); } //-------------------------------------------------------------------- void TableDataWindow::SetBackground() { - SetBackground(); + Window::SetBackground(); } //-------------------------------------------------------------------- void TableDataWindow::SetControlBackground() { - SetControlBackground(); + Window::SetControlBackground(); } //-------------------------------------------------------------------- void TableDataWindow::MouseMove( const MouseEvent& rMEvt ) diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 72da2274af3a..19a29abacc11 100755 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -664,10 +664,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) { std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); - if(!selectedRows.empty()) - selectedRows.clear(); if(eSelMode == SINGLE_SELECTION) { + if(!selectedRows.empty()) + selectedRows.clear(); if(rangeOfRows.getLength() == 1) selectedRows.push_back(start); else @@ -676,7 +676,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< else { for(int i=0;i<seqSize;i++) - selectedRows.push_back(rangeOfRows[i]); + { + if(!isSelectedIndex(rangeOfRows[i])) + selectedRows.push_back(rangeOfRows[i]); + } } pTable->selectionChanged(true); pTable->InvalidateDataWindow(start, end, false); @@ -704,24 +707,23 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::Run SetSynthesizingVCLEvent( sal_False ); } } + void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException) { TableControl* pTable = (TableControl*)GetWindow(); std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); std::vector<RowPos>::iterator itStart = selectedRows.begin(); std::vector<RowPos>::iterator itEnd = selectedRows.end(); - sal_Int32 start = rangeOfRows[0]; - sal_Int32 end = rangeOfRows[rangeOfRows.getLength()-1]; - if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) + for(int i = 0; i < rangeOfRows.getLength(); i++ ) { - std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, start); - selectedRows.erase(iter, iter+(end-start)+1); - pTable->selectionChanged(true); - pTable->InvalidateDataWindow(start, end, false); - SetSynthesizingVCLEvent( sal_True ); - pTable->Select(); - SetSynthesizingVCLEvent( sal_False ); + std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]); + selectedRows.erase(iter); } + pTable->selectionChanged(true); + pTable->Invalidate(); + SetSynthesizingVCLEvent( sal_True ); + pTable->Select(); + SetSynthesizingVCLEvent( sal_False ); } void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) @@ -860,7 +862,7 @@ void SVTXGridControl::ImplCallItemListeners() aEvent.Range = diff; } //selected row changed - else if(diff == 0) + else if(diff == 0 && actSelRowCount != 0) { aEvent.Row = selRows[actSelRowCount-1]; aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2); |