From 243db82c282740c690d8f4f5673683f7db399a04 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 29 Sep 2016 23:46:27 +0200 Subject: [PATCH] Use wxVariant::IsType() function to check the type of variant values Since there is a dedicated function to check the type of variant then there is not necessary to call wxVariant::GetType() and perform explicit comparisons of returned strings. --- src/msw/ole/access.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/msw/ole/access.cpp b/src/msw/ole/access.cpp index e6ed106c68..6036317d96 100644 --- a/src/msw/ole/access.cpp +++ b/src/msw/ole/access.cpp @@ -113,7 +113,7 @@ STDMETHODIMP wxIEnumVARIANT::Next(ULONG celt, return S_FALSE; } - if (m_variant.GetType() != wxT("list")) + if ( !m_variant.IsType(wxS("list")) ) return S_FALSE; if ( m_nCurrent < (int) m_variant.GetList().GetCount() ) { @@ -137,7 +137,7 @@ STDMETHODIMP wxIEnumVARIANT::Skip(ULONG celt) { wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumVARIANT::Skip")); - if (m_variant.GetType() != wxT("list")) + if ( !m_variant.IsType(wxS("list")) ) return S_FALSE; m_nCurrent += celt; @@ -1509,14 +1509,14 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren) return S_OK; } - else if (selections.GetType() == wxT("long")) + else if ( selections.IsType(wxS("long")) ) { pVarChildren->vt = VT_I4; pVarChildren->lVal = selections.GetLong(); return S_OK; } - else if (selections.GetType() == wxT("void*")) + else if ( selections.IsType(wxS("void*")) ) { wxAccessible* childObject = (wxAccessible*) selections.GetVoidPtr(); wxIAccessible* childIA = childObject->GetIAccessible(); @@ -1530,7 +1530,7 @@ STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren) return S_OK; } - else if (selections.GetType() == wxT("list")) + else if ( selections.IsType(wxS("list")) ) { wxASSERT_MSG( selections.GetCount() > 1, wxS("Multiple child objects should be selected") );