diff --git a/utils/ifacecheck/src/xmlparser.cpp b/utils/ifacecheck/src/xmlparser.cpp index c91695a4bd..1f2b35da79 100644 --- a/utils/ifacecheck/src/xmlparser.cpp +++ b/utils/ifacecheck/src/xmlparser.cpp @@ -74,6 +74,15 @@ void wxType::SetTypeFromString(const wxString& t) m_strType.Replace(" ,", ","); m_strType = m_strType.Strip(wxString::both); + + // now set the clean version + m_strTypeClean = m_strType; + m_strTypeClean.Replace("const", ""); + m_strTypeClean.Replace("static", ""); + m_strTypeClean.Replace("*", ""); + m_strTypeClean.Replace("&", ""); + m_strTypeClean.Replace("[]", ""); + m_strTypeClean = m_strTypeClean.Strip(wxString::both); } bool wxType::IsOk() const @@ -82,25 +91,14 @@ bool wxType::IsOk() const // "reverse_iterator_impl" type // It can also contain commas, * and & operators etc - return !GetClean().IsEmpty(); -} - -wxString wxType::GetClean() const -{ - wxString ret(m_strType); - ret.Replace("const", ""); - ret.Replace("static", ""); - ret.Replace("*", ""); - ret.Replace("&", ""); - ret.Replace("[]", ""); - return ret.Strip(wxString::both); + return !m_strTypeClean.IsEmpty(); } bool wxType::operator==(const wxType& m) const { // brain-dead comparison: - if (GetClean() == m.GetClean() && + if (m_strTypeClean == m.m_strTypeClean && IsConst() == m.IsConst() && IsStatic() == m.IsStatic() && IsPointer() == m.IsPointer() && diff --git a/utils/ifacecheck/src/xmlparser.h b/utils/ifacecheck/src/xmlparser.h index acf2ca7d72..f160c79b3f 100644 --- a/utils/ifacecheck/src/xmlparser.h +++ b/utils/ifacecheck/src/xmlparser.h @@ -55,10 +55,9 @@ public: bool IsOk() const; protected: - wxString m_strType; - - // utility for doing comparisons - wxString GetClean() const; + wxString m_strType, + m_strTypeClean; // m_strType "cleaned" of its attributes + // (only for internal use) }; extern wxType wxEmptyType;