mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Properties: Fixed INSPECTABLE::Get<T>()
The code was not correct as it returned either wxAny or type T.
This commit is contained in:
parent
b7a734ad61
commit
82b8014a34
@ -92,9 +92,12 @@ public:
|
||||
T Get( PROPERTY_BASE* aProperty ) const
|
||||
{
|
||||
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
|
||||
TYPE_ID thisType = TYPE_HASH( *this );
|
||||
void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
|
||||
return object ? aProperty->get<T>( object ) : T();
|
||||
const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() );
|
||||
|
||||
if( !object )
|
||||
throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" );
|
||||
|
||||
return aProperty->get<T>( object );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
Loading…
x
Reference in New Issue
Block a user