From c131a4bba9e1c09c8e82731b36896451981cd9aa Mon Sep 17 00:00:00 2001 From: Mihaela Kedikova Date: Tue, 3 Nov 2009 14:01:51 +0000 Subject: fixes for i106470 --- svtools/source/uno/unocontroltablemodel.cxx | 374 +--------------------------- svtools/source/uno/unocontroltablemodel.hxx | 50 ---- 2 files changed, 2 insertions(+), 422 deletions(-) (limited to 'svtools') 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 >& 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(0))) ,aCellContent ( *(new std::vector >(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 > cellData = m_xDataModel->getData(); -// Sequence rowData(0); -// for(int i = 0; i< m_xDataModel->getRowCount();++i) -// { -// rowData = cellData[i]; -// std::vector newRow( -// comphelper::sequenceToContainer< std::vector >(rowData)); -// if(newRow.size()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 >(rowHeaders)); -// m_pImpl->nRowCount = m_xDataModel->getRowCount(); -// setRowHeaderName(newRow); -// break; -// } -// case BASEPROPERTY_GRID_COLUMNMODEL: -// { -// m_xColumnModel = Reference< XGridColumnModel >( aValue, UNO_QUERY ); -// Sequence > columns = m_xColumnModel->getColumns(); -// std::vector > aNewColumns( -// comphelper::sequenceToContainer > >(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 aNewRow( -// comphelper::sequenceToContainer< std::vector >(Event.rowData)); -// if(aNewRow.size()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& selectedRows = pTable->GetSelectedRows(); -// Sequence 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; -//} diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx index 6b431cc8fb1f..fe3d1f28e9ed 100644 --- a/svtools/source/uno/unocontroltablemodel.hxx +++ b/svtools/source/uno/unocontroltablemodel.hxx @@ -139,56 +139,6 @@ class UnoControlTableColumn : public IColumnModel virtual std::vector >& getCellContent(); virtual void setRowHeaderName(std::vector cellColumnContent); virtual std::vector& getRowHeaderName(); - - // //XGridDataListener overridables - // virtual void SAL_CALL rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event) throw (::com::sun::star::uno::RuntimeException); - // virtual void SAL_CALL rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException); - // virtual void SAL_CALL dataChanged(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException); - // virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); - - //::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - //void SAL_CALL acquire() throw() { VCLXWindow::acquire(); } - //void SAL_CALL release() throw() { VCLXWindow::release(); } - - // // ::com::sun::star::lang::XTypeProvider - //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - //::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - - ////::com::sun::star::awt::grid::XGridControl - //::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > SAL_CALL getColumnModel( ) throw (::com::sun::star::uno::RuntimeException); - // void SAL_CALL setColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >& model ) throw (::com::sun::star::uno::RuntimeException); - // ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > SAL_CALL getDataModel( ) throw (::com::sun::star::uno::RuntimeException); - // void SAL_CALL setDataModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >& model ) throw (::com::sun::star::uno::RuntimeException); - - //virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException); - //virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL insertIndexIntervall(::sal_Int32 start, ::sal_Int32 length) throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL removeIndexIntervall(::sal_Int32 start, ::sal_Int32 end) throw (::com::sun::star::uno::RuntimeException); - //virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException); - //virtual ::sal_Bool SAL_CALL isCellEditable() throw (::com::sun::star::uno::RuntimeException); - //virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException); - //virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); - //virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); - - ////void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener ) throw(::com::sun::star::uno::RuntimeException); - ////void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & listener ) throw(::com::sun::star::uno::RuntimeException); - ////::com::sun::star::awt::XMouseListener - ///* - //virtual void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); - //virtual void SAL_CALL mouseExited( const ::com::sun::star::awt::MouseEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); - //*/ - - // void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); - //static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); - //void SAL_CALL setVisible(sal_Bool bVisible) throw(::com::sun::star::uno::RuntimeException); - //void SAL_CALL setFocus() throw(::com::sun::star::uno::RuntimeException); }; inline void UnoControlTableModel::SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM ) -- cgit