X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1d4dd7add411ebff1ce4a8d1d992e0e43ee26b1..102e2b26c00f2361df4f57b834be26cd04a27240:/samples/docvwmdi/doc.cpp?ds=sidebyside diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp index 5f620dbe38..19487ad910 100644 --- a/samples/docvwmdi/doc.cpp +++ b/samples/docvwmdi/doc.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -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();