]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlpars.cpp
cleaned up the waitpid() result processing mess
[wxWidgets.git] / src / html / htmlpars.cpp
index 64054fc2d2f246bdf211e123bd3d607688c28cc0..cf6897d33580cc372d237a006c45c7a7825f4f4c 100644 (file)
@@ -80,8 +80,9 @@ wxHtmlParser::wxHtmlParser()
 
 wxHtmlParser::~wxHtmlParser()
 {
 
 wxHtmlParser::~wxHtmlParser()
 {
-    while (RestoreState())
-        DestroyDOMTree();
+    while (RestoreState()) {}
+    DestroyDOMTree();
+    
     delete m_HandlersStack;
     m_HandlersHash.Clear();
     m_HandlersList.DeleteContents(TRUE);
     delete m_HandlersStack;
     m_HandlersHash.Clear();
     m_HandlersList.DeleteContents(TRUE);
@@ -271,8 +272,9 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
              pieces[m_CurTextPiece].m_pos < m_CurTag->GetBeginPos()))
         {
             // Add text:
              pieces[m_CurTextPiece].m_pos < m_CurTag->GetBeginPos()))
         {
             // Add text:
-            AddText(m_Source.Mid(pieces[m_CurTextPiece].m_pos,
-                                 pieces[m_CurTextPiece].m_lng));
+            AddText(GetEntitiesParser()->Parse(
+                       m_Source.Mid(pieces[m_CurTextPiece].m_pos,
+                                    pieces[m_CurTextPiece].m_lng)));
             begin_pos = pieces[m_CurTextPiece].m_pos +
                         pieces[m_CurTextPiece].m_lng;
             m_CurTextPiece++;
             begin_pos = pieces[m_CurTextPiece].m_pos +
                         pieces[m_CurTextPiece].m_lng;
             m_CurTextPiece++;
@@ -385,6 +387,8 @@ bool wxHtmlParser::RestoreState()
 {
     if (!m_SavedStates) return FALSE;
 
 {
     if (!m_SavedStates) return FALSE;
 
+    DestroyDOMTree();
+
     wxHtmlParserState *s = m_SavedStates;
     m_SavedStates = s->m_nextState;
 
     wxHtmlParserState *s = m_SavedStates;
     m_SavedStates = s->m_nextState;