]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/benchmarks/htmlparser/htmlpars.cpp
Extract compiler-specific macro definitions in a new wx/compiler.h.
[wxWidgets.git] / tests / benchmarks / htmlparser / htmlpars.cpp
index 541fb80650051cb2bf7e406a1c5da4eab40e1a21..7cb3b223621d49b088b259557a30a8c04d3c1c47 100644 (file)
@@ -36,7 +36,7 @@
 // DLL options compatibility check:
 WX_CHECK_BUILD_OPTIONS("wxHTML")
 
-const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug");
+const wxChar *wxTRACE_HTML_DEBUG = wxT("htmldebug");
 
 //-----------------------------------------------------------------------------
 // wx28HtmlParser helpers
@@ -295,7 +295,7 @@ void wx28HtmlParser::DoParsing(int begin_pos, int end_pos)
             // Add text:
             AddText(GetEntitiesParser()->Parse(
                        m_Source.Mid(pieces[m_CurTextPiece].m_pos,
-                                    pieces[m_CurTextPiece].m_lng)));
+                                    pieces[m_CurTextPiece].m_lng)).t_str());
             begin_pos = pieces[m_CurTextPiece].m_pos +
                         pieces[m_CurTextPiece].m_lng;
             m_CurTextPiece++;
@@ -459,7 +459,7 @@ void wx28HtmlTagHandler::ParseInnerSource(const wxString& source)
 IMPLEMENT_DYNAMIC_CLASS(wx28HtmlEntitiesParser,wxObject)
 
 wx28HtmlEntitiesParser::wx28HtmlEntitiesParser()
-#if wxUSE_WCHAR_T && !wxUSE_UNICODE
+#if !wxUSE_UNICODE
     : m_conv(NULL), m_encoding(wxFONTENCODING_SYSTEM)
 #endif
 {
@@ -467,14 +467,14 @@ wx28HtmlEntitiesParser::wx28HtmlEntitiesParser()
 
 wx28HtmlEntitiesParser::~wx28HtmlEntitiesParser()
 {
-#if wxUSE_WCHAR_T && !wxUSE_UNICODE
+#if !wxUSE_UNICODE
     delete m_conv;
 #endif
 }
 
 void wx28HtmlEntitiesParser::SetEncoding(wxFontEncoding encoding)
 {
-#if wxUSE_WCHAR_T && !wxUSE_UNICODE
+#if !wxUSE_UNICODE
     if (encoding == m_encoding)
         return;
 
@@ -552,7 +552,6 @@ extern "C" int LINKAGEMODE wx28HtmlEntityCompare(const void *key, const void *it
 #if !wxUSE_UNICODE
 wxChar wx28HtmlEntitiesParser::GetCharForCode(unsigned code)
 {
-#if wxUSE_WCHAR_T
     char buf[2];
     wchar_t wbuf[2];
     wbuf[0] = (wchar_t)code;
@@ -561,9 +560,6 @@ wxChar wx28HtmlEntitiesParser::GetCharForCode(unsigned code)
     if (conv->WC2MB(buf, wbuf, 2) == (size_t)-1)
         return '?';
     return buf[0];
-#else
-    return (code < 256) ? (wxChar)code : '?';
-#endif
 }
 #endif
 
@@ -918,18 +914,18 @@ private:
 
 bool wxMetaTagHandler::HandleTag(const wx28HtmlTag& tag)
 {
-    if (tag.GetName() == _T("BODY"))
+    if (tag.GetName() == wxT("BODY"))
     {
         m_Parser->StopParsing();
         return false;
     }
 
-    if (tag.HasParam(_T("HTTP-EQUIV")) &&
-        tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) &&
-        tag.HasParam(_T("CONTENT")))
+    if (tag.HasParam(wxT("HTTP-EQUIV")) &&
+        tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) &&
+        tag.HasParam(wxT("CONTENT")))
     {
-        wxString content = tag.GetParam(_T("CONTENT")).Lower();
-        if (content.Left(19) == _T("text/html; charset="))
+        wxString content = tag.GetParam(wxT("CONTENT")).Lower();
+        if (content.Left(19) == wxT("text/html; charset="))
         {
             *m_retval = content.Mid(19);
             m_Parser->StopParsing();