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 @@ ...@@ -32,6 +32,7 @@
#include "property.hrc" #include "property.hrc"
#endif #endif
#include "property.hxx" #include "property.hxx"
#include "componenttools.hxx"
#include "ids.hxx" #include "ids.hxx"
#include "findpos.hxx" #include "findpos.hxx"
#include <com/sun/star/io/XPersistObject.hpp> #include <com/sun/star/io/XPersistObject.hpp>
...@@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce ...@@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce
//------------------------------------------------------------------ //------------------------------------------------------------------
Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException) Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException)
{ {
Reference<XTypeProvider> xProv; TypeBag aTypes( OGridColumn_BASE::getTypes() );
// erase the types which we do not support
if (query_aggregation(m_xAggregate, xProv)) aTypes.removeType( XFormComponent::static_type() );
return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes()); aTypes.removeType( XServiceInfo::static_type() );
return OGridColumn_BASE::getTypes(); 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 ...@@ -48,7 +48,7 @@ namespace frm
typedef ::com::sun::star::uno::Type Type; typedef ::com::sun::star::uno::Type Type;
public: public:
bool operator()( const Type& _rLHS, const Type& _rRHS ) bool operator()( const Type& _rLHS, const Type& _rRHS ) const
{ {
return _rLHS.getTypeName() < _rRHS.getTypeName(); return _rLHS.getTypeName() < _rRHS.getTypeName();
} }
...@@ -85,7 +85,9 @@ namespace frm ...@@ -85,7 +85,9 @@ namespace frm
const TypeSequence& _rTypes3 const TypeSequence& _rTypes3
); );
void addType( const Type& i_rType );
void addTypes( const TypeSequence& _rTypes ); void addTypes( const TypeSequence& _rTypes );
void removeType( const Type& i_rType );
/** returns the types represented by this bag /** returns the types represented by this bag
*/ */
......
...@@ -83,6 +83,18 @@ namespace frm ...@@ -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 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