X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d62edfb07f3f5d359d5ab231df7094e16e9df78..991dd5beb9feb764adc5c1e6a913186d2c17747e:/include/wx/unichar.h diff --git a/include/wx/unichar.h b/include/wx/unichar.h index 8c61a2c898..584b85cb4b 100644 --- a/include/wx/unichar.h +++ b/include/wx/unichar.h @@ -92,14 +92,14 @@ public: operator char() const { return To8bit(m_value); } operator unsigned char() const { return (unsigned char)To8bit(m_value); } #if wxWCHAR_T_IS_SEPARATE_TYPE - operator wchar_t() const { return m_value; } + operator wchar_t() const { return (wchar_t)m_value; } #endif - operator int() const { return m_value; } - operator unsigned int() const { return m_value; } - operator long int() const { return m_value; } - operator unsigned long int() const { return m_value; } - operator short int() const { return m_value; } - operator unsigned short int() const { return m_value; } + operator int() const { return (int)m_value; } + operator unsigned int() const { return (unsigned int)m_value; } + operator long int() const { return (long int)m_value; } + operator unsigned long int() const { return (unsigned long)m_value; } + operator short int() const { return (short int)m_value; } + operator unsigned short int() const { return (unsigned short int)m_value; } // We need this operator for the "*p" part of expressions like "for ( // const_iterator p = begin() + nStart; *p; ++p )". In this case, @@ -115,6 +115,7 @@ public: // Assignment operators: wxUniChar& operator=(const wxUniChar& c) { m_value = c.m_value; return *this; } + wxUniChar& operator=(const wxUniCharRef& c); wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; } wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; } #if wxWCHAR_T_IS_SEPARATE_TYPE @@ -287,6 +288,12 @@ inline wxUniChar::wxUniChar(const wxUniCharRef& c) m_value = c.UniChar().m_value; } +inline wxUniChar& wxUniChar::operator=(const wxUniCharRef& c) +{ + m_value = c.UniChar().m_value; + return *this; +} + // Comparison operators for the case when wxUniChar(Ref) is the second operand // implemented in terms of member comparison functions