X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fe30bceff0445f540e639d2b6d3977d56b34020..5938a184a568873b48c1e59bf5c4ed5a9528d7f4:/utils/configtool/src/htmlparser.cpp diff --git a/utils/configtool/src/htmlparser.cpp b/utils/configtool/src/htmlparser.cpp index 9eba43650b..1552216137 100644 --- a/utils/configtool/src/htmlparser.cpp +++ b/utils/configtool/src/htmlparser.cpp @@ -12,22 +12,17 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "htmlparser.h" -#endif -#include "wx/wx.h" +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif -#include "wx/textfile.h" #include "wx/wfstream.h" +#include "wx/textfile.h" #include "wx/txtstrm.h" - -#include - #include "htmlparser.h" /// Useful insertion operators for wxOutputStream. @@ -121,7 +116,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str) bool bResult = ParseHtml(m_topLevel); - wxASSERT(bResult); // Failed to parse the TAGs. + wxASSERT(bResult); // Failed to parse the TAGs. // Hint: Check if every open tag has a close tag! return bResult; @@ -166,7 +161,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) } else parent->AppendTag(tag); - } + } } else if (IsTagStartBracket(GetChar(m_pos))) { @@ -191,7 +186,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) if(parent->GetParent()) parent->GetParent()->AppendTag(tag); else - parent->AppendTag(tag); // When this occurs it is probably the + parent->AppendTag(tag); // When this occurs it is probably the // empty lines at the end of the file... } } @@ -203,7 +198,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text) { while (!Eof() && GetChar(m_pos) != wxT('<')) { - text += GetChar(m_pos); + text += (wxChar)GetChar(m_pos); m_pos ++; } DecodeSpecialChars(text); @@ -443,7 +438,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt) while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('=')) { - str += GetChar(pos); + str += (wxChar)GetChar(pos); pos ++; } if (eatIt) @@ -526,7 +521,7 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name) // See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp /* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value) { - // XML translation + // XML translation value.Replace(wxT(">"), wxT(">"), true); value.Replace(wxT("<"), wxT("<"), true); value.Replace(wxT("""), wxT("\""), true); @@ -538,13 +533,13 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name) { wxString newvalue = value; - // XML translation + // XML translation newvalue.Replace(wxT("&"), wxT("&"), true); // Note: do this as first to prevent replace problems. newvalue.Replace(wxT(">"), wxT(">"), true); newvalue.Replace(wxT("<"), wxT("<"), true); newvalue.Replace(wxT("\""),wxT("""), true); newvalue.Replace(wxT("'"), wxT("'"), true); - + return newvalue; } @@ -697,7 +692,7 @@ void wxSimpleHtmlTag::RemoveChild(wxSimpleHtmlTag *remove) { child->m_next = NULL; delete child; - + if (prev != NULL) prev->m_next = next; else @@ -723,7 +718,7 @@ void wxSimpleHtmlTag::AppendTag(wxSimpleHtmlTag* tag) while (last->m_next) last = last->m_next; - last->m_next = tag; + last->m_next = tag; } else { @@ -825,7 +820,7 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam return false; } -// Search forward from this tag until we find a tag with this name & attribute +// Search forward from this tag until we find a tag with this name & attribute wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName) { wxSimpleHtmlTag* tag = m_next; @@ -904,10 +899,10 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream) attr->Write(stream); if (i < GetAttributeCount() - 1) stream << wxT(" "); - } + } if(!m_children) { - sbUseTab = false; // We're putting the open a close tag on the same line, + sbUseTab = false; // We're putting the open a close tag on the same line, // so we don't wan't any tabs stream << wxT(">"); }