wxVariant::wxVariant()
{
- m_data = (wxVariantData*) NULL;
+ m_data = NULL;
}
bool wxVariant::IsNull() const
{
- return (m_data == (wxVariantData*) NULL);
+ return (m_data == NULL);
}
void wxVariant::MakeNull()
wxVariant::wxVariant(const wxVariant& variant)
: wxObject()
{
- m_data = (wxVariantData*) NULL;
+ m_data = NULL;
if (!variant.IsNull())
Ref(variant);
void* wxVariant::GetVoidPtr() const
{
- wxASSERT( (GetType() == wxT("void*")) );
+ // handling this specially is convenient when working with COM, see #9873
+ if ( IsNull() )
+ return NULL;
+
+ wxASSERT( GetType() == wxT("void*") );
return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue();
}