summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-16 22:18:58 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-16 22:18:58 +0100
commit70315564786969decd1ee9eeb2549ce6545be1f3 (patch)
treea0094e8e5d9a13714a9917c72f4999947d821970 /toolkit
parent00abb7e08b1a2de2200878ec58c968bc8717565a (diff)
gridsort: made the row title a row heading, being an Any instead of a string
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx22
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.hxx14
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.cxx4
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.hxx2
4 files changed, 21 insertions, 21 deletions
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index ab0ba1734e53..d113415ccf79 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -163,7 +163,7 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- ::rtl::OUString SAL_CALL DefaultGridDataModel::getRowTitle( ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ Any SAL_CALL DefaultGridDataModel::getRowHeading( ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
{
::comphelper::ComponentGuard aGuard( *this, rBHelper );
@@ -174,14 +174,14 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- void SAL_CALL DefaultGridDataModel::addRow( const ::rtl::OUString& i_title, const Sequence< Any >& i_data ) throw (RuntimeException)
+ void SAL_CALL DefaultGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException)
{
::comphelper::ComponentGuard aGuard( *this, rBHelper );
sal_Int32 const columnCount = i_data.getLength();
// store header name
- m_aRowHeaders.push_back( i_title );
+ m_aRowHeaders.push_back( i_heading );
// store row m_aData
impl_addRow( i_data );
@@ -213,14 +213,14 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- void SAL_CALL DefaultGridDataModel::addRows( const Sequence< ::rtl::OUString >& i_titles, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
+ void SAL_CALL DefaultGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
{
- if ( i_titles.getLength() != i_data.getLength() )
+ if ( i_headings.getLength() != i_data.getLength() )
throw IllegalArgumentException( ::rtl::OUString(), *this, -1 );
::comphelper::ComponentGuard aGuard( *this, rBHelper );
- sal_Int32 const rowCount = i_titles.getLength();
+ sal_Int32 const rowCount = i_headings.getLength();
if ( rowCount == 0 )
return;
@@ -235,7 +235,7 @@ namespace toolkit
for ( sal_Int32 row=0; row<rowCount; ++row )
{
- m_aRowHeaders.push_back( i_titles[row] );
+ m_aRowHeaders.push_back( i_headings[row] );
impl_addRow( i_data[row], maxColCount );
}
@@ -339,18 +339,18 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- void SAL_CALL DefaultGridDataModel::setRowTitle( ::sal_Int32 i_rowIndex, const ::rtl::OUString& i_title ) throw (IndexOutOfBoundsException, RuntimeException)
+ void SAL_CALL DefaultGridDataModel::setRowHeading( ::sal_Int32 i_rowIndex, const Any& i_heading ) throw (IndexOutOfBoundsException, RuntimeException)
{
::comphelper::ComponentGuard aGuard( *this, rBHelper );
if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aRowHeaders.size() ) )
throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
- m_aRowHeaders[ i_rowIndex ] = i_title;
+ m_aRowHeaders[ i_rowIndex ] = i_heading;
broadcast(
GridDataEvent( *this, -1, -1, i_rowIndex, i_rowIndex ),
- &XGridDataListener::rowTitleChanged,
+ &XGridDataListener::rowHeadingChanged,
aGuard
);
}
@@ -395,7 +395,7 @@ namespace toolkit
GridData aEmptyData;
m_aData.swap( aEmptyData );
- ::std::vector< ::rtl::OUString > aEmptyRowHeaders;
+ ::std::vector< Any > aEmptyRowHeaders;
m_aRowHeaders.swap( aEmptyRowHeaders );
m_nColumnCount = 0;
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
index 7f87aa16cfa7..13a31277e533 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
@@ -63,13 +63,13 @@ public:
virtual ~DefaultGridDataModel();
// XMutableGridDataModel
- virtual void SAL_CALL addRow( const ::rtl::OUString& Title, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& Titles, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRow( const Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateRowData( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& ColumnIndexes, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRowTitle( ::sal_Int32 RowIndex, const ::rtl::OUString& Title ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRowHeading( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Heading ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateCellToolTip( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateRowToolTip( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
@@ -80,7 +80,7 @@ public:
virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getRowTitle( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
// OComponentHelper
virtual void SAL_CALL disposing();
@@ -110,9 +110,9 @@ private:
CellData& impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex );
RowData& impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount );
- GridData m_aData;
- ::std::vector< ::rtl::OUString > m_aRowHeaders;
- sal_Int32 m_nColumnCount;
+ GridData m_aData;
+ ::std::vector< ::com::sun::star::uno::Any > m_aRowHeaders;
+ sal_Int32 m_nColumnCount;
};
}
diff --git a/toolkit/source/controls/grid/grideventforwarder.cxx b/toolkit/source/controls/grid/grideventforwarder.cxx
index 68293025bd4e..c3760b8315a3 100755
--- a/toolkit/source/controls/grid/grideventforwarder.cxx
+++ b/toolkit/source/controls/grid/grideventforwarder.cxx
@@ -105,11 +105,11 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- void SAL_CALL GridEventForwarder::rowTitleChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ void SAL_CALL GridEventForwarder::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
if ( xPeer.is() )
- xPeer->rowTitleChanged( i_event );
+ xPeer->rowHeadingChanged( i_event );
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/toolkit/source/controls/grid/grideventforwarder.hxx b/toolkit/source/controls/grid/grideventforwarder.hxx
index 0abdcc59fd85..5a8b03f57037 100755
--- a/toolkit/source/controls/grid/grideventforwarder.hxx
+++ b/toolkit/source/controls/grid/grideventforwarder.hxx
@@ -64,7 +64,7 @@ namespace toolkit
virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL rowsRemoved( 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 rowTitleChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
// XContainerListener
virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);