From a0157b37f2c16cdc98d672fdc8df22a81713a3be Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 10 May 2015 20:19:03 +0200 Subject: [PATCH] Use wxVariant::IsType() function to check the type of variant values in propgrid sample. Use this dedicated function to check the type of variant value instead of calling wxVariant::GetType() function and performing explicit comparisons of returned string. --- samples/propgrid/propgrid.cpp | 2 +- samples/propgrid/sampleprops.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index d159170cfb..d862664ba0 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2989,7 +2989,7 @@ void FormMain::OnMisc ( wxCommandEvent& event ) } else if ( id == ID_SETVALUES ) { - if ( m_storedValues.GetType() == wxT("list") ) + if ( m_storedValues.IsType(wxT("list")) ) { m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues); } diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index bfeb9f8002..56231ed112 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { } void wxFontDataProperty::OnSetValue() { - if ( m_value.GetType() != wxT("wxFontData") ) + if ( !m_value.IsType(wxT("wxFontData")) ) { - if ( m_value.GetType() == wxT("wxFont") ) + if ( m_value.IsType(wxT("wxFont")) ) { wxFont font; font << m_value;