diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-07 10:31:19 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-07 10:31:19 +0100 |
commit | 9cb54ddb6ee986202829eab834cb856a4df5c45f (patch) | |
tree | 7e8992a366169f7da622443d5d8b20333f6e0046 /toolkit/source/controls | |
parent | e1c80401419cf94b34706c4fa7fdd929665c640e (diff) |
gridsort: RowHeaderWidth/ColumnHeaderHeight do not belong to the GridData/ColumnModel, but to the GridControlModel
Diffstat (limited to 'toolkit/source/controls')
5 files changed, 8 insertions, 41 deletions
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx index 7383fc958dae..00bbbf9d6c1b 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx @@ -71,7 +71,6 @@ namespace toolkit ,m_aContext( i_factory ) ,m_aContainerListeners( m_aMutex ) ,m_aColumns() - ,m_nColumnHeaderHeight(0) { } @@ -82,7 +81,6 @@ namespace toolkit ,m_aContext( i_copySource.m_aContext ) ,m_aContainerListeners( m_aMutex ) ,m_aColumns() - ,m_nColumnHeaderHeight( i_copySource.m_nColumnHeaderHeight ) { Columns aColumns; aColumns.reserve( i_copySource.m_aColumns.size() ); @@ -139,14 +137,14 @@ namespace toolkit //------------------------------------------------------------------------------------------------------------------ Sequence< Reference< XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (RuntimeException) { - ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); + ::osl::MutexGuard aGuard( m_aMutex ); return ::comphelper::containerToSequence( m_aColumns ); } //------------------------------------------------------------------------------------------------------------------ Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (IndexOutOfBoundsException, RuntimeException) { - ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); + ::osl::MutexGuard aGuard( m_aMutex ); if ( index >=0 && index < ((sal_Int32)m_aColumns.size())) return m_aColumns[index]; @@ -155,20 +153,6 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ - void SAL_CALL DefaultGridColumnModel::setColumnHeaderHeight(sal_Int32 _value) throw (RuntimeException) - { - ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); - m_nColumnHeaderHeight = _value; - } - - //------------------------------------------------------------------------------------------------------------------ - sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnHeaderHeight() throw (RuntimeException) - { - ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex ); - return m_nColumnHeaderHeight; - } - - //------------------------------------------------------------------------------------------------------------------ void SAL_CALL DefaultGridColumnModel::setDefaultColumns(sal_Int32 rowElements) throw (RuntimeException) { ::std::vector< ContainerEvent > aRemovedColumns; diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx index 118d6bbf3240..102da190486e 100644 --- a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx +++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx @@ -62,8 +62,6 @@ public: virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL getColumns() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setColumnHeaderHeight( sal_Int32 _value) throw (com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getColumnHeaderHeight() throw (com::sun::star::uno::RuntimeException); virtual void SAL_CALL setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException); // XServiceInfo @@ -87,7 +85,6 @@ private: ::comphelper::ComponentContext m_aContext; ::cppu::OInterfaceContainerHelper m_aContainerListeners; Columns m_aColumns; - sal_Int32 m_nColumnHeaderHeight; }; } diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index c2fca18dee61..ed6d124b4c8b 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -43,7 +43,6 @@ using namespace ::com::sun::star::lang; #define ROWHEADERS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" )) #define CELLUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellUpdated" )) #define ROWUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" )) -#define ROWHEADERWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" )) //...................................................................................................................... namespace toolkit @@ -71,7 +70,6 @@ namespace toolkit ,MutexAndBroadcastHelper() ,m_nRowHeight(0) ,m_aRowHeaders() - ,m_nRowHeaderWidth(10) { } @@ -82,7 +80,6 @@ namespace toolkit ,m_nRowHeight( i_copySource.m_nRowHeight ) ,m_aData( i_copySource.m_aData ) ,m_aRowHeaders( i_copySource.m_aRowHeaders ) - ,m_nRowHeaderWidth( i_copySource.m_nRowHeaderWidth ) { } @@ -266,20 +263,6 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ - void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException) - { - sal_Int32 oldValue = m_nRowHeaderWidth; - m_nRowHeaderWidth = _value; - broadcast_changed( ROWHEADERWIDTH, 0, Any(oldValue), Any(_value) ); - } - - //------------------------------------------------------------------------------------------------------------------ - sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException) - { - return m_nRowHeaderWidth; - } - - //------------------------------------------------------------------------------------------------------------------ void SAL_CALL DefaultGridDataModel::updateCell(::sal_Int32 row, ::sal_Int32 column, const Any& value) throw (::com::sun::star::uno::RuntimeException) { if(row >= 0 && row < (signed)m_aData.size()) diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx index 66260d49ae6d..6d0afb15bd87 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx @@ -74,8 +74,6 @@ public: virtual void SAL_CALL addGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException); virtual void SAL_CALL removeGridDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException); virtual void SAL_CALL removeAll() throw (RuntimeException); - virtual void SAL_CALL setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL updateCell( ::sal_Int32 row, ::sal_Int32 column, const ::com::sun::star::uno::Any& value ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL updateRow( ::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& values ) throw (::com::sun::star::uno::RuntimeException); @@ -102,7 +100,6 @@ private: sal_Int32 m_nRowHeight; std::vector< std::vector < Any > > m_aData; std::vector< ::rtl::OUString > m_aRowHeaders; - sal_Int32 m_nRowHeaderWidth; }; } diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index fe8e894a65ed..8194536544b1 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -75,7 +75,9 @@ UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun:: ImplRegisterProperty( BASEPROPERTY_VSCROLL ); ImplRegisterProperty( BASEPROPERTY_TABSTOP ); ImplRegisterProperty( BASEPROPERTY_GRID_SHOWROWHEADER ); + ImplRegisterProperty( BASEPROPERTY_ROW_HEADER_WIDTH ); ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER ); + ImplRegisterProperty( BASEPROPERTY_COLUMN_HEADER_HEIGHT ); ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( maContext.createComponent( "com.sun.star.awt.grid.DefaultGridDataModel" ) ) ); ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( maContext.createComponent( "com.sun.star.awt.grid.DefaultGridColumnModel" ) ) ); ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE ); @@ -196,8 +198,12 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const return uno::makeAny( SelectionType(1) ); case BASEPROPERTY_GRID_SHOWROWHEADER: return uno::makeAny( (sal_Bool)sal_False ); + case BASEPROPERTY_ROW_HEADER_WIDTH: + return uno::makeAny( sal_Int32( 10 ) ); case BASEPROPERTY_GRID_SHOWCOLUMNHEADER: return uno::makeAny( (sal_Bool)sal_True ); + case BASEPROPERTY_COLUMN_HEADER_HEIGHT: + return Any(); case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND: return uno::makeAny( com::sun::star::util::Color( COL_TRANSPARENT ) ); case BASEPROPERTY_GRID_HEADER_BACKGROUND: |