]> git.saurik.com Git - wxWidgets.git/commitdiff
Compilation fixes for wxUSE_STL=1.
authorMattia Barbon <mbarbon@cpan.org>
Fri, 18 Jul 2003 19:52:15 +0000 (19:52 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Fri, 18 Jul 2003 19:52:15 +0000 (19:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/docview/doc.cpp
samples/docview/view.cpp
samples/docvwmdi/doc.cpp
samples/docvwmdi/view.cpp

index e442556cba6cb150a96c2ab027b5f2ea8e9127b6..7bee8496561806681d1d6c2b83088f8c14dde873 100644 (file)
@@ -42,7 +42,7 @@ DrawingDocument::DrawingDocument(void)
 
 DrawingDocument::~DrawingDocument(void)
 {
-    doodleSegments.DeleteContents(TRUE);
+    WX_CLEAR_LIST(wxList, doodleSegments);
 }
 
 #if wxUSE_STD_IOSTREAM
@@ -53,7 +53,7 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
     wxInt32 n = doodleSegments.GetCount();
     stream << n << '\n';
     
-    wxNode *node = doodleSegments.GetFirst();
+    wxList::compatibility_iterator node = doodleSegments.GetFirst();
     while (node)
     {
         DoodleSegment *segment = (DoodleSegment *)node->GetData();
@@ -75,7 +75,7 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
     wxInt32 n = doodleSegments.GetCount();
     text_stream << n << '\n';
     
-    wxNode *node = doodleSegments.GetFirst();
+    wxList::compatibility_iterator node = doodleSegments.GetFirst();
     while (node)
     {
         DoodleSegment *segment = (DoodleSegment *)node->GetData();
@@ -133,7 +133,7 @@ DoodleSegment::DoodleSegment(void)
 
 DoodleSegment::DoodleSegment(DoodleSegment& seg)
 {
-    wxNode *node = seg.lines.GetFirst();
+    wxList::compatibility_iterator node = seg.lines.GetFirst();
     while (node)
     {
         DoodleLine *line = (DoodleLine *)node->GetData();
@@ -151,7 +151,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
 
 DoodleSegment::~DoodleSegment(void)
 {
-    lines.DeleteContents(TRUE);
+    WX_CLEAR_LIST(wxList, lines);
 }
 
 #if wxUSE_STD_IOSTREAM
@@ -160,7 +160,7 @@ wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
     wxInt32 n = lines.GetCount();
     stream << n << '\n';
     
-    wxNode *node = lines.GetFirst();
+    wxList::compatibility_iterator node = lines.GetFirst();
     while (node)
     {
         DoodleLine *line = (DoodleLine *)node->GetData();
@@ -181,7 +181,7 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
     wxInt32 n = lines.GetCount();
     text_stream << n << _T('\n');
     
-    wxNode *node = lines.GetFirst();
+    wxList::compatibility_iterator node = lines.GetFirst();
     while (node)
     {
         DoodleLine *line = (DoodleLine *)node->GetData();
@@ -238,7 +238,7 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
 
 void DoodleSegment::Draw(wxDC *dc)
 {
-    wxNode *node = lines.GetFirst();
+    wxList::compatibility_iterator node = lines.GetFirst();
     while (node)
     {
         DoodleLine *line = (DoodleLine *)node->GetData();
@@ -274,12 +274,12 @@ bool DrawingCommand::Do(void)
             // Cut the last segment
             if (doc->GetDoodleSegments().GetCount() > 0)
             {
-                wxNode *node = doc->GetDoodleSegments().GetLast();
+                wxList::compatibility_iterator node = doc->GetDoodleSegments().GetLast();
                 if (segment)
                     delete segment;
                 
                 segment = (DoodleSegment *)node->GetData();
-                delete node;
+                doc->GetDoodleSegments().Erase(node);
                 
                 doc->Modify(TRUE);
                 doc->UpdateAllViews();
@@ -320,10 +320,10 @@ bool DrawingCommand::Undo(void)
             // Cut the last segment
             if (doc->GetDoodleSegments().GetCount() > 0)
             {
-                wxNode *node = doc->GetDoodleSegments().GetLast();
+                wxList::compatibility_iterator node = doc->GetDoodleSegments().GetLast();
                 DoodleSegment *seg = (DoodleSegment *)node->GetData();
                 delete seg;
-                delete node;
+                doc->GetDoodleSegments().Erase(node);
                 
                 doc->Modify(TRUE);
                 doc->UpdateAllViews();
index 348d52f5d99b4ef64754efcb10810a873f514115..dc01f53b0c4e02a7f1b5b5da46e6afc50f96a5a0 100644 (file)
@@ -90,7 +90,7 @@ void DrawingView::OnDraw(wxDC *dc)
     dc->SetFont(*wxNORMAL_FONT);
     dc->SetPen(*wxBLACK_PEN);
     
-    wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
+    wxList::compatibility_iterator node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
     while (node)
     {
         DoodleSegment *seg = (DoodleSegment *)node->GetData();
index e22f7aec597a52c930e02981e8a5dc227ed8ae46..19487ad910483824f280d6700d4da59a13ed4b56 100644 (file)
@@ -40,7 +40,7 @@ DrawingDocument::DrawingDocument(void)
 
 DrawingDocument::~DrawingDocument(void)
 {
-  doodleSegments.DeleteContents(TRUE);
+  WX_CLEAR_LIST(wxList, doodleSegments);
 }
 
 #if wxUSE_STD_IOSTREAM
@@ -51,7 +51,7 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream)
   wxInt32 n = doodleSegments.GetCount();
   stream << n << _T('\n');
   
-  wxNode *node = doodleSegments.GetFirst();
+  wxList::compatibility_iterator node = doodleSegments.GetFirst();
   while (node)
   {
     DoodleSegment *segment = (DoodleSegment *)node->GetData();
@@ -73,7 +73,7 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
   wxInt32 n = doodleSegments.GetCount();
   text_stream << n << _T('\n');
   
-  wxNode *node = doodleSegments.GetFirst();
+  wxList::compatibility_iterator node = doodleSegments.GetFirst();
   while (node)
   {
     DoodleSegment *segment = (DoodleSegment *)node->GetData();
@@ -130,7 +130,7 @@ DoodleSegment::DoodleSegment(void)
 
 DoodleSegment::DoodleSegment(DoodleSegment& seg)
 {
-  wxNode *node = seg.lines.GetFirst();
+  wxList::compatibility_iterator node = seg.lines.GetFirst();
   while (node)
   {
     DoodleLine *line = (DoodleLine *)node->GetData();
@@ -148,7 +148,7 @@ DoodleSegment::DoodleSegment(DoodleSegment& seg)
 
 DoodleSegment::~DoodleSegment(void)
 {
-  lines.DeleteContents(TRUE);
+  WX_CLEAR_LIST(wxList, lines);
 }
 
 #if wxUSE_STD_IOSTREAM
@@ -157,7 +157,7 @@ wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream)
   wxInt32 n = lines.GetCount();
   stream << n << _T('\n');
   
-  wxNode *node = lines.GetFirst();
+  wxList::compatibility_iterator node = lines.GetFirst();
   while (node)
   {
     DoodleLine *line = (DoodleLine *)node->GetData();
@@ -178,7 +178,7 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
   wxInt32 n = lines.GetCount();
   text_stream << n << _T('\n');
   
-  wxNode *node = lines.GetFirst();
+  wxList::compatibility_iterator node = lines.GetFirst();
   while (node)
   {
     DoodleLine *line = (DoodleLine *)node->GetData();
@@ -234,7 +234,7 @@ wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
 #endif
 void DoodleSegment::Draw(wxDC *dc)
 {
-  wxNode *node = lines.GetFirst();
+  wxList::compatibility_iterator node = lines.GetFirst();
   while (node)
   {
     DoodleLine *line = (DoodleLine *)node->GetData();
@@ -270,12 +270,12 @@ bool DrawingCommand::Do(void)
       // Cut the last segment
       if (doc->GetDoodleSegments().GetCount() > 0)
       {
-        wxNode *node = doc->GetDoodleSegments().GetLast();
+        wxList::compatibility_iterator node = doc->GetDoodleSegments().GetLast();
         if (segment)
           delete segment;
           
         segment = (DoodleSegment *)node->GetData();
-        delete node;
+        doc->GetDoodleSegments().Erase(node);
 
         doc->Modify(TRUE);
         doc->UpdateAllViews();
@@ -316,10 +316,10 @@ bool DrawingCommand::Undo(void)
       // Cut the last segment
       if (doc->GetDoodleSegments().GetCount() > 0)
       {
-        wxNode *node = doc->GetDoodleSegments().GetLast();
+        wxList::compatibility_iterator node = doc->GetDoodleSegments().GetLast();
         DoodleSegment *seg = (DoodleSegment *)node->GetData();
         delete seg;
-        delete node;
+        doc->GetDoodleSegments().Erase(node);
 
         doc->Modify(TRUE);
         doc->UpdateAllViews();
index ac439325ff851d3666c17a46d958b5ecdfe62627..28bbd9ab5097d13a632139f532091b30293e1cf7 100644 (file)
@@ -69,7 +69,7 @@ void DrawingView::OnDraw(wxDC *dc)
   dc->SetFont(*wxNORMAL_FONT);
   dc->SetPen(*wxBLACK_PEN);
 
-  wxNode *node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
+  wxList::compatibility_iterator node = ((DrawingDocument *)GetDocument())->GetDoodleSegments().GetFirst();
   while (node)
   {
     DoodleSegment *seg = (DoodleSegment *)node->GetData();