diff options
author | Frank Schönheit <fs@openoffice.org> | 2010-03-11 12:20:02 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2010-03-11 12:20:02 +0000 |
commit | 43533b80c9400efef304654a98d3b71b8430421a (patch) | |
tree | e10ea5281905ca6e7fa4240631782b5b2f60fa5f /forms | |
parent | 88df38f41b5f6317d1b9faeafe846bb4c6f8753b (diff) |
dba321a: #i109535# grid columns now returning proper types in getTypes
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Columns.cxx | 20 | ||||
-rw-r--r-- | forms/source/inc/componenttools.hxx | 6 | ||||
-rw-r--r-- | forms/source/misc/componenttools.cxx | 12 |
3 files changed, 31 insertions, 7 deletions
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index ae1cbc2b7a5b..a93d121d4b99 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -32,6 +32,7 @@ #include "property.hrc" #endif #include "property.hxx" +#include "componenttools.hxx" #include "ids.hxx" #include "findpos.hxx" #include <com/sun/star/io/XPersistObject.hpp> @@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce //------------------------------------------------------------------ Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException) { - Reference<XTypeProvider> xProv; - - if (query_aggregation(m_xAggregate, xProv)) - return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); - return OGridColumn_BASE::getTypes(); + TypeBag aTypes( OGridColumn_BASE::getTypes() ); + // erase the types which we do not support + aTypes.removeType( XFormComponent::static_type() ); + aTypes.removeType( XServiceInfo::static_type() ); + aTypes.removeType( XBindableValue::static_type() ); + aTypes.removeType( XPropertyContainer::static_type() ); + // but re-add their base class(es) + aTypes.addType( XChild::static_type() ); + + Reference< XTypeProvider > xProv; + if ( query_aggregation( m_xAggregate, xProv )) + aTypes.addTypes( xProv->getTypes() ); + + return aTypes.getTypes(); } //------------------------------------------------------------------ diff --git a/forms/source/inc/componenttools.hxx b/forms/source/inc/componenttools.hxx index 73771f19783a..e91573c43d2f 100644 --- a/forms/source/inc/componenttools.hxx +++ b/forms/source/inc/componenttools.hxx @@ -48,7 +48,7 @@ namespace frm typedef ::com::sun::star::uno::Type Type; public: - bool operator()( const Type& _rLHS, const Type& _rRHS ) + bool operator()( const Type& _rLHS, const Type& _rRHS ) const { return _rLHS.getTypeName() < _rRHS.getTypeName(); } @@ -85,7 +85,9 @@ namespace frm const TypeSequence& _rTypes3 ); - void addTypes( const TypeSequence& _rTypes ); + void addType( const Type& i_rType ); + void addTypes( const TypeSequence& _rTypes ); + void removeType( const Type& i_rType ); /** returns the types represented by this bag */ diff --git a/forms/source/misc/componenttools.cxx b/forms/source/misc/componenttools.cxx index 80e772dbd0da..bdba7456fa7f 100644 --- a/forms/source/misc/componenttools.cxx +++ b/forms/source/misc/componenttools.cxx @@ -84,6 +84,18 @@ namespace frm } //-------------------------------------------------------------------- + void TypeBag::addType( const Type& i_rType ) + { + m_aTypes.insert( i_rType ); + } + + //-------------------------------------------------------------------- + void TypeBag::removeType( const TypeBag::Type& i_rType ) + { + m_aTypes.erase( i_rType ); + } + + //-------------------------------------------------------------------- TypeBag::TypeSequence TypeBag::getTypes() const { TypeSequence aTypes( m_aTypes.size() ); |