wxHTML src code indentation now conforms (more) to wxWin coding style

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-11-05 14:59:59 +00:00
parent 1da7aa8c4a
commit 4f9297b0ee
23 changed files with 1437 additions and 1115 deletions

View File

@@ -82,19 +82,23 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
templen = 0;
i = begin_pos;
while (i < end_pos) {
while (i < end_pos)
{
c = m_Source[(unsigned int) i];
// continue building word:
if (c != '<') {
if (c != '<')
{
temp[templen++] = c;
i++;
}
else if (c == '<') {
else if (c == '<')
{
wxHtmlTag tag(m_Source, i, end_pos, m_Cache);
if (templen) {
if (templen)
{
temp[templen] = 0;
AddText(temp);
templen = 0;
@@ -105,7 +109,8 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
}
}
if (templen) { // last word of block :-(
if (templen)
{ // last word of block :-(
temp[templen] = 0;
AddText(temp);
}
@@ -121,8 +126,9 @@ void wxHtmlParser::AddTag(const wxHtmlTag& tag)
h = (wxHtmlTagHandler*) m_HandlersHash.Get(tag.GetName());
if (h)
inner = h -> HandleTag(tag);
if (!inner) {
inner = h->HandleTag(tag);
if (!inner)
{
if (tag.HasEnding())
DoParsing(tag.GetBeginPos(), tag.GetEndPos1());
}
@@ -132,7 +138,7 @@ void wxHtmlParser::AddTag(const wxHtmlTag& tag)
void wxHtmlParser::AddTagHandler(wxHtmlTagHandler *handler)
{
wxString s(handler -> GetSupportedTags());
wxString s(handler->GetSupportedTags());
wxStringTokenizer tokenizer(s, ", ");
while (tokenizer.HasMoreTokens())
@@ -141,7 +147,7 @@ void wxHtmlParser::AddTagHandler(wxHtmlTagHandler *handler)
if (m_HandlersList.IndexOf(handler) == wxNOT_FOUND)
m_HandlersList.Append(handler);
handler -> SetParser(this);
handler->SetParser(this);
}
@@ -151,14 +157,16 @@ void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
wxStringTokenizer tokenizer(tags, ", ");
wxString key;
if (m_HandlersStack == NULL) {
if (m_HandlersStack == NULL)
{
m_HandlersStack = new wxList;
m_HandlersStack -> DeleteContents(TRUE);
m_HandlersStack->DeleteContents(TRUE);
}
m_HandlersStack -> Insert(new wxHashTable(m_HandlersHash));
m_HandlersStack->Insert(new wxHashTable(m_HandlersHash));
while (tokenizer.HasMoreTokens()) {
while (tokenizer.HasMoreTokens())
{
key = tokenizer.NextToken();
m_HandlersHash.Delete(key);
m_HandlersHash.Put(key, handler);
@@ -172,13 +180,13 @@ void wxHtmlParser::PopTagHandler()
wxNode *first;
if (m_HandlersStack == NULL ||
(first = m_HandlersStack -> GetFirst()) == NULL)
(first = m_HandlersStack->GetFirst()) == NULL)
{
wxLogWarning(_("Warning: attempt to remove HTML tag handler from empty stack."));
return;
}
m_HandlersHash = *((wxHashTable*) first -> GetData());
m_HandlersStack -> DeleteNode(first);
m_HandlersHash = *((wxHashTable*) first->GetData());
m_HandlersStack->DeleteNode(first);
}