diff options
author | Mihaela Kedikova <misheto@openoffice.org> | 2009-11-03 14:01:51 +0000 |
---|---|---|
committer | Mihaela Kedikova <misheto@openoffice.org> | 2009-11-03 14:01:51 +0000 |
commit | c131a4bba9e1c09c8e82731b36896451981cd9aa (patch) | |
tree | ada9ab8ce8d079dc426355672decd72151cebcf3 /svtools/source/uno/unocontroltablemodel.cxx | |
parent | 554db14f76ae85a271ae4502a2dcdfb923ad2eff (diff) |
fixes for i106470
Diffstat (limited to 'svtools/source/uno/unocontroltablemodel.cxx')
-rw-r--r-- | svtools/source/uno/unocontroltablemodel.cxx | 374 |
1 files changed, 2 insertions, 372 deletions
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index 566848f19023..b4ddc2cc472d 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -162,7 +162,8 @@ using namespace ::com::sun::star::awt::grid; std::vector<std::vector<rtl::OUString> >& aCellContent; UnoControlTableModel_Impl() - :nRowCount ( 0 ) + :aColumns ( *(new std::vector< PColumnModel> (0))) + ,nRowCount ( 0 ) ,bHasColumnHeaders ( false ) ,bHasRowHeaders ( false ) ,pRenderer ( ) @@ -172,7 +173,6 @@ using namespace ::com::sun::star::awt::grid; ,nRowHeaderWidth ( 10 * 100 ) // 50 mm ,aRowHeadersTitle ( *(new std::vector<rtl::OUString>(0))) ,aCellContent ( *(new std::vector<std::vector<OUString> >(0))) - ,aColumns ( *(new std::vector< PColumnModel> (0))) { } }; @@ -409,373 +409,3 @@ using namespace ::com::sun::star::awt::grid; return m_pImpl->aRowHeadersTitle; } -//::com::sun::star::uno::Any UnoControlTableModel::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -//{ -// ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, -// SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridControl*, this ), -// SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridDataListener*, this ), -// //SAL_STATIC_CAST( com::sun::star::lang::XEventListener*, this ), -// //SAL_STATIC_CAST( com::sun::star::awt::XMouseListener*, this ), -// SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) ); -// return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType )); -//} -// -//// ::com::sun::star::lang::XTypeProvider -//IMPL_XTYPEPROVIDER_START( UnoControlTableModel ) -// getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridControl>* ) NULL ), -// getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel>* ) NULL ), -// getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener>* ) NULL ), -// VCLXWindow::getTypes() -//IMPL_XTYPEPROVIDER_END -// -//::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > SAL_CALL UnoControlTableModel::getColumnModel( ) throw (::com::sun::star::uno::RuntimeException) -//{ -// return NULL; -//} -//void SAL_CALL UnoControlTableModel::setColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >& model ) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)model; -//} -//::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > SAL_CALL UnoControlTableModel::getDataModel( ) throw (::com::sun::star::uno::RuntimeException) -//{ -// return NULL; -//} -//void SAL_CALL UnoControlTableModel::setDataModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >& model ) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)model; -//} -//sal_Int32 SAL_CALL UnoControlTableModel::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) -//{ -// TableControl* pTableControl = (TableControl*)GetWindow(); -// return pTableControl->GetCurrentRow( Point(x,y) ); -//} -// -///* -//void SAL_CALL UnoControlTableModel::addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener ) throw(::com::sun::star::uno::RuntimeException) -//{ -// VCLXWindow::addMouseListener( listener ); -//} -// -//void SAL_CALL UnoControlTableModel::removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener ) throw(::com::sun::star::uno::RuntimeException) -//{ -// VCLXWindow::removeMouseListener( listener ); -//} -//*/ -///* -//void SAL_CALL UnoControlTableModel::mousePressed( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException) -//{ -// (void)rEvent; -//} -//void SAL_CALL UnoControlTableModel::mouseReleased( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException) -//{ -// (void)rEvent; -//} -//void SAL_CALL UnoControlTableModel::mouseEntered( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException) -//{ -// (void) rEvent; -//} -//void SAL_CALL UnoControlTableModel::mouseExited( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException) -//{ -// (void) rEvent; -//} -//*/ -//void SAL_CALL UnoControlTableModel::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)listener; -//} -// -//void SAL_CALL UnoControlTableModel::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void) listener; -//} -// -//void UnoControlTableModel::setProperty( const ::rtl::OUString& PropertyName, const Any& aValue) throw(RuntimeException) -//{ -// ::vos::OGuard aGuard( GetMutex() ); -// -// TableControl* pTableControl = (TableControl*)GetWindow(); -// -// switch( GetPropertyId( PropertyName ) ) -// { -// case BASEPROPERTY_GRID_SELECTIONMODE: -// { -// SelectionType eSelectionType; -// if( aValue >>= eSelectionType ) -// { -// SelectionMode eSelMode; -// switch( eSelectionType ) -// { -// case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break; -// case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break; -// case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break; -// // case SelectionType_NONE: -// default: eSelMode = NO_SELECTION; break; -// } -// if( pTableControl->getSelEngine()->GetSelectionMode() != eSelMode ) -// pTableControl->getSelEngine()->SetSelectionMode( eSelMode ); -// } -// break; -// } -// case BASEPROPERTY_HSCROLL: -// { -// sal_Bool bHScroll = true; -// if( aValue >>= bHScroll ) -// { -// m_bHScroll = bHScroll; -// } -// break; -// } -// case BASEPROPERTY_VSCROLL: -// { -// sal_Bool bVScroll = true; -// if( aValue >>= bVScroll ) -// { -// m_bVScroll = bVScroll; -// } -// break; -// } -// case BASEPROPERTY_GRID_SHOWROWHEADER: -// { -// sal_Bool rowHeader = true; -// if( aValue >>= rowHeader ) -// { -// setRowHeaders(rowHeader); -// } -// break; -// } -// -// case BASEPROPERTY_GRID_SHOWCOLUMNHEADER: -// { -// sal_Bool colHeader = true; -// if( aValue >>= colHeader ) -// { -// setColumnHeaders(colHeader); -// } -// break; -// } -// case BASEPROPERTY_GRID_DATAMODEL: -// { -// m_xDataModel = Reference< XGridDataModel >( aValue, UNO_QUERY ); -// Sequence<Sequence< ::rtl::OUString > > cellData = m_xDataModel->getData(); -// Sequence<rtl::OUString> rowData(0); -// for(int i = 0; i< m_xDataModel->getRowCount();++i) -// { -// rowData = cellData[i]; -// std::vector<rtl::OUString> newRow( -// comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rowData)); -// if(newRow.size()<m_pImpl->aColumns.size()) -// newRow.resize(m_pImpl->aColumns.size(),rtl::OUString::createFromAscii("")); -// m_pImpl->aCellContent.push_back(newRow); -// } -// Sequence< ::rtl::OUString > rowHeaders = m_xDataModel->getRowHeaders(); -// std::vector< rtl::OUString > newRow( -// comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rowHeaders)); -// m_pImpl->nRowCount = m_xDataModel->getRowCount(); -// setRowHeaderName(newRow); -// break; -// } -// case BASEPROPERTY_GRID_COLUMNMODEL: -// { -// m_xColumnModel = Reference< XGridColumnModel >( aValue, UNO_QUERY ); -// Sequence<Reference< XGridColumn > > columns = m_xColumnModel->getColumns(); -// std::vector<Reference< XGridColumn > > aNewColumns( -// comphelper::sequenceToContainer<std::vector<Reference< XGridColumn > > >(columns)); -// if(!m_pImpl->aColumns.empty()) -// m_pImpl->aColumns.clear(); -// for ( ::svt::table::ColPos col = 0; col < m_xColumnModel->getColumnCount(); ++col ) -// { -// UnoControlTableColumn* tableColumn = new UnoControlTableColumn(aNewColumns[col]); -// m_pImpl->aColumns.push_back((PColumnModel)tableColumn); -// } -// break; -// } -// default: -// VCLXWindow::setProperty( PropertyName, aValue ); -// break; -// } -//} -// -//Any UnoControlTableModel::getProperty( const ::rtl::OUString& PropertyName ) throw(RuntimeException) -//{ -// ::vos::OGuard aGuard( GetMutex() ); -// -// const sal_uInt16 nPropId = GetPropertyId( PropertyName ); -// TableControl* pTableControl = (TableControl*)GetWindow(); -// if(pTableControl) -// { -// switch(nPropId) -// { -// case BASEPROPERTY_GRID_SELECTIONMODE: -// { -// SelectionType eSelectionType; -// -// SelectionMode eSelMode = pTableControl->getSelEngine()->GetSelectionMode(); -// switch( eSelMode ) -// { -// case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break; -// case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break; -// case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break; -//// case NO_SELECTION: -// default: eSelectionType = SelectionType_NONE; break; -// } -// return Any( eSelectionType ); -// } -// case BASEPROPERTY_GRID_SHOWROWHEADER: -// { -// return Any ((sal_Bool) pTableControl->GetModel()->hasRowHeaders()); -// } -// case BASEPROPERTY_GRID_SHOWCOLUMNHEADER: -// return Any ((sal_Bool) pTableControl->GetModel()->hasColumnHeaders()); -// case BASEPROPERTY_GRID_DATAMODEL: -// return Any ( m_xDataModel ); -// case BASEPROPERTY_GRID_COLUMNMODEL: -// return Any ( m_xColumnModel); -// case BASEPROPERTY_HSCROLL: -// return Any ( m_bHScroll); -// case BASEPROPERTY_VSCROLL: -// return Any ( m_bVScroll); -// } -// } -// return VCLXWindow::getProperty( PropertyName ); -//} -// -//void UnoControlTableModel::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) -//{ -// PushPropertyIds( rIds, -// BASEPROPERTY_GRID_SHOWROWHEADER, -// BASEPROPERTY_GRID_SHOWCOLUMNHEADER, -// BASEPROPERTY_GRID_DATAMODEL, -// BASEPROPERTY_GRID_COLUMNMODEL, -// BASEPROPERTY_GRID_SELECTIONMODE, -// 0); -// VCLXWindow::ImplGetPropertyIds( rIds, true ); -//} -//void SAL_CALL UnoControlTableModel::setVisible( sal_Bool bVisible ) throw(::com::sun::star::uno::RuntimeException) -//{ -// TableControl* pTable = (TableControl*)GetWindow(); -// if ( pTable ) -// { -// pTable->SetModel(PTableModel(this)); -// pTable->Show( bVisible ); -// } -//} -//void SAL_CALL UnoControlTableModel::setFocus() throw(::com::sun::star::uno::RuntimeException) -//{ -// ::vos::OGuard aGuard( GetMutex() ); -// if ( GetWindow()) -// GetWindow()->GrabFocus(); -//} -//void SAL_CALL UnoControlTableModel::rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException) -//{ -// std::vector<OUString> aNewRow( -// comphelper::sequenceToContainer< std::vector<rtl::OUString > >(Event.rowData)); -// if(aNewRow.size()<m_pImpl->aColumns.size()) -// aNewRow.resize(m_pImpl->aColumns.size(),rtl::OUString::createFromAscii("")); -// m_pImpl->aCellContent.push_back(aNewRow); -// if(hasRowHeaders()) -// m_pImpl->aRowHeadersTitle.push_back(Event.headerName); -// m_pImpl->nRowCount=m_pImpl->aCellContent.size(); -// TableControl* pTable = (TableControl*)GetWindow(); -// pTable->InvalidateDataWindow(m_pImpl->nRowCount-1, false); -// //pTable->GrabFocus(); -//} -// -//void SAL_CALL UnoControlTableModel::rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException) -//{ -// TableControl* pTable = (TableControl*)GetWindow(); -// //unsigned int rows =m_pImpl->aCellContent.size()-1; -// if(Event.index == -1) -// { -// if(hasRowHeaders()) -// m_pImpl->aRowHeadersTitle.clear(); -// m_pImpl->aCellContent.clear(); -// } -// else -// { -// pTable->removeSelectedRow(Event.index); -// if(m_pImpl->aCellContent.size()>1) -// { -// if(hasRowHeaders()) -// m_pImpl->aRowHeadersTitle.erase(m_pImpl->aRowHeadersTitle.begin()+Event.index); -// m_pImpl->aCellContent.erase(m_pImpl->aCellContent.begin()+Event.index); -// -// } -// else -// { -// if(hasRowHeaders()) -// m_pImpl->aRowHeadersTitle.clear(); -// m_pImpl->aCellContent.clear(); -// //m_pImpl->nRowCount=0; -// } -// } -// //pTable->InvalidateDataWindow(Event.index, true); -// setRowCount(m_pImpl->aCellContent.size()); -// pTable->InvalidateDataWindow(Event.index, true); -// //pTable->Invalidate(); -//} -// -//void SAL_CALL UnoControlTableModel::dataChanged(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void) Event; -//} -// -// void SAL_CALL UnoControlTableModel::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) -// { -// VCLXWindow::disposing( Source ); -// } -// -//::sal_Int32 SAL_CALL UnoControlTableModel::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException) -//{ -// return 0; -//} -// -//::sal_Int32 SAL_CALL UnoControlTableModel::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException) -//{ -// return 0; -//} -// -//void SAL_CALL UnoControlTableModel::insertIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)length; -// (void)start; -//} -// -//void SAL_CALL UnoControlTableModel::removeIndexIntervall(::sal_Int32 start, ::sal_Int32 end) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)end; -// (void)start; -//} -// -//::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoControlTableModel::getSelection() throw (::com::sun::star::uno::RuntimeException) -//{ -// TableControl* pTable = (TableControl*)GetWindow(); -// std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); -// Sequence<sal_Int32> selectedRowsToSequence(comphelper::containerToSequence(selectedRows)); -// return selectedRowsToSequence; -//} -// -//::sal_Bool SAL_CALL UnoControlTableModel::isCellEditable() throw (::com::sun::star::uno::RuntimeException) -//{ -// return sal_False; -//} -// -//::sal_Bool SAL_CALL UnoControlTableModel::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException) -//{ -// return sal_False; -//} -// -//::sal_Bool SAL_CALL UnoControlTableModel::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)index; -// return sal_False; -//} -// -//void SAL_CALL UnoControlTableModel::selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)y; -//} -// -//void SAL_CALL UnoControlTableModel::selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException) -//{ -// (void)x; -//} |