From bd5206ddbc5510ee880fe82fb4780fd4f53bd6e7 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Fri, 18 Jul 2003 19:52:15 +0000 Subject: [PATCH] Compilation fixes for wxUSE_STL=1. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/docview/doc.cpp | 24 ++++++++++++------------ samples/docview/view.cpp | 2 +- samples/docvwmdi/doc.cpp | 24 ++++++++++++------------ samples/docvwmdi/view.cpp | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp index e442556cba..7bee849656 100644 --- a/samples/docview/doc.cpp +++ b/samples/docview/doc.cpp @@ -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(); diff --git a/samples/docview/view.cpp b/samples/docview/view.cpp index 348d52f5d9..dc01f53b0c 100644 --- a/samples/docview/view.cpp +++ b/samples/docview/view.cpp @@ -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(); diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp index e22f7aec59..19487ad910 100644 --- a/samples/docvwmdi/doc.cpp +++ b/samples/docvwmdi/doc.cpp @@ -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(); diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp index ac439325ff..28bbd9ab50 100644 --- a/samples/docvwmdi/view.cpp +++ b/samples/docvwmdi/view.cpp @@ -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(); -- 2.45.2