Kaydet (Commit) 43533b80 authored tarafından Frank Schönheit's avatar Frank Schönheit

dba321a: #i109535# grid columns now returning proper types in getTypes

üst 88df38f4
......@@ -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();
}
//------------------------------------------------------------------
......
......@@ -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
*/
......
......@@ -83,6 +83,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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment