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:
Vadim Zeitlin
2013-09-30 23:48:46 +00:00
parent 6d2190fcb4
commit 534f87c6c4
7 changed files with 81 additions and 127 deletions

View File

@@ -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);