X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..5778dedc92f6d31435aa1cda6846979a0e9ad35b:/src/html/htmlpars.cpp diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 3f0d762d42..2076129925 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -250,8 +250,7 @@ void wxHtmlParser::DestroyDOMTree() } m_Tags = m_CurTag = NULL; - delete m_TextPieces; - m_TextPieces = NULL; + wxDELETE(m_TextPieces); } void wxHtmlParser::DoParsing() @@ -433,7 +432,7 @@ void wxHtmlTagHandler::ParseInnerSource(const wxString& source) IMPLEMENT_DYNAMIC_CLASS(wxHtmlEntitiesParser,wxObject) wxHtmlEntitiesParser::wxHtmlEntitiesParser() -#if wxUSE_WCHAR_T && !wxUSE_UNICODE +#if !wxUSE_UNICODE : m_conv(NULL), m_encoding(wxFONTENCODING_SYSTEM) #endif { @@ -441,14 +440,14 @@ wxHtmlEntitiesParser::wxHtmlEntitiesParser() wxHtmlEntitiesParser::~wxHtmlEntitiesParser() { -#if wxUSE_WCHAR_T && !wxUSE_UNICODE +#if !wxUSE_UNICODE delete m_conv; #endif } +#if !wxUSE_UNICODE void wxHtmlEntitiesParser::SetEncoding(wxFontEncoding encoding) { -#if wxUSE_WCHAR_T && !wxUSE_UNICODE if (encoding == m_encoding) return; @@ -459,10 +458,8 @@ void wxHtmlEntitiesParser::SetEncoding(wxFontEncoding encoding) m_conv = NULL; else m_conv = new wxCSConv(wxFontMapper::GetEncodingName(m_encoding)); -#else - (void) encoding; -#endif } +#endif // !wxUSE_UNICODE wxString wxHtmlEntitiesParser::Parse(const wxString& input) const { @@ -523,7 +520,6 @@ wxString wxHtmlEntitiesParser::Parse(const wxString& input) const #if !wxUSE_UNICODE wxChar wxHtmlEntitiesParser::GetCharForCode(unsigned code) const { -#if wxUSE_WCHAR_T char buf[2]; wchar_t wbuf[2]; wbuf[0] = (wchar_t)code; @@ -532,9 +528,6 @@ wxChar wxHtmlEntitiesParser::GetCharForCode(unsigned code) const if (conv->WC2MB(buf, wbuf, 2) == (size_t)-1) return '?'; return buf[0]; -#else - return (code < 256) ? (wxChar)code : '?'; -#endif } #endif @@ -655,6 +648,7 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const ENTITY("amp", 38), ENTITY("and", 8743), ENTITY("ang", 8736), + ENTITY("apos", 39), ENTITY("aring", 229), ENTITY("asymp", 8776), ENTITY("atilde", 227),