]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxVector<T> instead of OBJARRAY macros for wxHtmlTextPieces (slightly better...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Aug 2007 15:21:46 +0000 (15:21 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Aug 2007 15:21:46 +0000 (15:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlpars.cpp

index 001e547fa28b312dbddc597673bffe179d24c116..c51181a3fa53682b30559f464159b0f2b3b46836 100644 (file)
@@ -29,7 +29,7 @@
 #include "wx/fontmap.h"
 #include "wx/html/htmldefs.h"
 #include "wx/html/htmlpars.h"
-#include "wx/arrimpl.cpp"
+#include "wx/vector.h"
 
 #ifdef __WXWINCE__
     #include "wx/msw/wince/missing.h"       // for bsearch()
@@ -47,12 +47,15 @@ const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug");
 class wxHtmlTextPiece
 {
 public:
+    wxHtmlTextPiece() {}
     wxHtmlTextPiece(int pos, int lng) : m_pos(pos), m_lng(lng) {}
     int m_pos, m_lng;
 };
 
-WX_DECLARE_OBJARRAY(wxHtmlTextPiece, wxHtmlTextPieces);
-WX_DEFINE_OBJARRAY(wxHtmlTextPieces)
+// NB: this is an empty class and not typedef because of forward declaration
+class wxHtmlTextPieces : public wxVector<wxHtmlTextPiece>
+{
+};
 
 class wxHtmlParserState
 {
@@ -168,7 +171,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur,
         {
             // add text to m_TextPieces:
             if (i - textBeginning > 0)
-                m_TextPieces->Add(
+                m_TextPieces->push_back(
                     wxHtmlTextPiece(textBeginning, i - textBeginning));
 
             // if it is a comment, skip it:
@@ -230,7 +233,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur,
 
     // add remaining text to m_TextPieces:
     if (end_pos - textBeginning > 0)
-        m_TextPieces->Add(
+        m_TextPieces->push_back(
             wxHtmlTextPiece(textBeginning, end_pos - textBeginning));
 }
 
@@ -262,7 +265,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
     if (end_pos <= begin_pos) return;
 
     wxHtmlTextPieces& pieces = *m_TextPieces;
-    size_t piecesCnt = pieces.GetCount();
+    size_t piecesCnt = pieces.size();
 
     while (begin_pos < end_pos)
     {