Avoid using wxHtmlTag::HasParam() unnecessarily.
Use GetParamAsXXX() accessors instead as they combine the calls to HasParam() and GetParam() and make the code shorter and avoid the duplication of the tag name. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -918,11 +918,13 @@ bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tag.HasParam(wxT("HTTP-EQUIV")) &&
|
||||
tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) &&
|
||||
tag.HasParam(wxT("CONTENT")))
|
||||
wxString httpEquiv,
|
||||
content;
|
||||
if (tag.GetParamAsString(wxT("HTTP-EQUIV"), &httpEquiv) &&
|
||||
httpEquiv.IsSameAs(wxT("Content-Type"), false) &&
|
||||
tag.GetParamAsString(wxT("CONTENT"), &content))
|
||||
{
|
||||
wxString content = tag.GetParam(wxT("CONTENT")).Lower();
|
||||
content.MakeLower();
|
||||
if (content.Left(19) == wxT("text/html; charset="))
|
||||
{
|
||||
*m_retval = content.Mid(19);
|
||||
|
||||
Reference in New Issue
Block a user