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 | |
parent | e1c80401419cf94b34706c4fa7fdd929665c640e (diff) |
gridsort: RowHeaderWidth/ColumnHeaderHeight do not belong to the GridData/ColumnModel, but to the GridControlModel
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/toolkit/helper/property.hxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/grid/defaultgridcolumnmodel.cxx | 20 | ||||
-rw-r--r-- | toolkit/source/controls/grid/defaultgridcolumnmodel.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/controls/grid/defaultgriddatamodel.cxx | 17 | ||||
-rw-r--r-- | toolkit/source/controls/grid/defaultgriddatamodel.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/controls/grid/gridcontrol.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/helper/property.cxx | 6 |
7 files changed, 14 insertions, 43 deletions
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx index 837d283f4e8c..164071f5a39b 100644 --- a/toolkit/inc/toolkit/helper/property.hxx +++ b/toolkit/inc/toolkit/helper/property.hxx @@ -202,6 +202,8 @@ namespace rtl { #define BASEPROPERTY_GRID_ROW_BACKGROUND 151 #define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152 #define BASEPROPERTY_ITEM_SEPARATOR_POS 153 +#define BASEPROPERTY_ROW_HEADER_WIDTH 154 +#define BASEPROPERTY_COLUMN_HEADER_HEIGHT 155 // Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen. 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: diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 1b08c33a9219..0f91dcd3e9cf 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -276,8 +276,10 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ), - DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "RowHeaderWidth", ROW_HEADER_WIDTH, sal_Int32, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_3 ( "ColumnHeaderHeight", COLUMN_HEADER_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_1 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND ), DECL_PROP_1 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND ), DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ), |