X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5dc103fd4afb197f48d6a87f67f6b82dd7f56fe..cbc9145c04bd3ea0a228906c8363fa8f47e3acf9:/src/common/variant.cpp?ds=sidebyside diff --git a/src/common/variant.cpp b/src/common/variant.cpp index a06ac80606..b17b2c1f66 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1628,6 +1628,23 @@ void wxVariant::operator= (void* value) } } +bool wxVariant::operator== (wxObject* value) const +{ + return (value == ((wxVariantDataWxObjectPtr*)GetData())->GetValue()); +} + +bool wxVariant::operator!= (wxObject* value) const +{ + return (!((*this) == (void*) value)); +} + +void wxVariant::operator= (wxObject* value) +{ + if (m_data) + delete m_data; + m_data = new wxVariantDataWxObjectPtr(value); +} + #if wxUSE_DATETIME bool wxVariant::operator== (const wxDateTime& value) const { @@ -1894,7 +1911,7 @@ void* wxVariant::GetVoidPtr() const return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue(); } -wxObject* wxVariant::GetWxObjectPtr() +wxObject* wxVariant::GetWxObjectPtr() const { wxASSERT(wxIsKindOf(m_data, wxVariantDataWxObjectPtr)); return (wxObject*) ((wxVariantDataWxObjectPtr*) m_data)->GetValue();