wxUSE_STL fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-07-22 19:07:59 +00:00
parent b02a6dc2b6
commit 36ca94a260
10 changed files with 73 additions and 73 deletions

View File

@@ -424,7 +424,7 @@ bool DiagramCommand::Undo(void)
// Remove each individual line connected to a shape by sending a command. // Remove each individual line connected to a shape by sending a command.
void DiagramCommand::RemoveLines(wxShape *shape) void DiagramCommand::RemoveLines(wxShape *shape)
{ {
wxNode *node = shape->GetLines().GetFirst(); wxObjectList::compatibility_iterator node = shape->GetLines().GetFirst();
while (node) while (node)
{ {
wxLineShape *line = (wxLineShape *)node->GetData(); wxLineShape *line = (wxLineShape *)node->GetData();
@@ -455,7 +455,7 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
{ {
// Ensure no other shape is selected, to simplify Undo/Redo code // Ensure no other shape is selected, to simplify Undo/Redo code
bool redraw = false; bool redraw = false;
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->GetData(); wxShape *eachShape = (wxShape *)node->GetData();

View File

@@ -127,7 +127,7 @@ void DiagramView::OnDraw(wxDC *dc)
if (diagram_p->GetShapeList()) if (diagram_p->GetShapeList())
{ {
/* wxCursor *old_cursor = NULL; */ /* wxCursor *old_cursor = NULL; */
wxNode *current = diagram_p->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator current = diagram_p->GetShapeList()->GetFirst();
while (current) // Loop through the entire list of shapes while (current) // Loop through the entire list of shapes
{ {
@@ -177,7 +177,7 @@ wxShape *DiagramView::FindSelectedShape(void)
{ {
DiagramDocument *doc = (DiagramDocument *)GetDocument(); DiagramDocument *doc = (DiagramDocument *)GetDocument();
wxShape *theShape = NULL; wxShape *theShape = NULL;
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->GetData(); wxShape *eachShape = (wxShape *)node->GetData();

View File

@@ -120,7 +120,7 @@ csDiagramCommand::csDiagramCommand(const wxString& name, csDiagramDocument *doc,
csDiagramCommand::~csDiagramCommand() csDiagramCommand::~csDiagramCommand()
{ {
wxNode* node = m_states.GetFirst(); wxObjectList::compatibility_iterator node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->GetData(); csCommandState* state = (csCommandState*) node->GetData();
@@ -147,14 +147,14 @@ void csDiagramCommand::InsertState(csCommandState* state)
// Schedule all lines connected to the states to be cut. // Schedule all lines connected to the states to be cut.
void csDiagramCommand::RemoveLines() void csDiagramCommand::RemoveLines()
{ {
wxNode* node = m_states.GetFirst(); wxObjectList::compatibility_iterator node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->GetData(); csCommandState* state = (csCommandState*) node->GetData();
wxShape* shape = state->GetShapeOnCanvas(); wxShape* shape = state->GetShapeOnCanvas();
wxASSERT( (shape != NULL) ); wxASSERT( (shape != NULL) );
wxNode *node1 = shape->GetLines().GetFirst(); wxObjectList::compatibility_iterator node1 = shape->GetLines().GetFirst();
while (node1) while (node1)
{ {
wxLineShape *line = (wxLineShape *)node1->GetData(); wxLineShape *line = (wxLineShape *)node1->GetData();
@@ -172,7 +172,7 @@ void csDiagramCommand::RemoveLines()
csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape) csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape)
{ {
wxNode* node = m_states.GetFirst(); wxObjectList::compatibility_iterator node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->GetData(); csCommandState* state = (csCommandState*) node->GetData();
@@ -185,7 +185,7 @@ csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape)
bool csDiagramCommand::Do() bool csDiagramCommand::Do()
{ {
wxNode* node = m_states.GetFirst(); wxObjectList::compatibility_iterator node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->GetData(); csCommandState* state = (csCommandState*) node->GetData();
@@ -200,7 +200,7 @@ bool csDiagramCommand::Undo()
{ {
// Undo in reverse order, so e.g. shapes get added // Undo in reverse order, so e.g. shapes get added
// back before the lines do. // back before the lines do.
wxNode* node = m_states.GetLast(); wxObjectList::compatibility_iterator node = m_states.GetLast();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->GetData(); csCommandState* state = (csCommandState*) node->GetData();

View File

@@ -301,7 +301,7 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes // Draw bounding box for other selected shapes
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->GetData(); wxShape* shape = (wxShape*) node->GetData();
@@ -360,7 +360,7 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment)
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes // Draw bounding box for other selected shapes
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->GetData(); wxShape* shape = (wxShape*) node->GetData();
@@ -415,7 +415,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
new csCommandState(ID_CS_MOVE, newShape, GetShape())); new csCommandState(ID_CS_MOVE, newShape, GetShape()));
// Move line points // Move line points
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->GetData(); wxShape* shape = (wxShape*) node->GetData();
@@ -429,7 +429,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
{ {
wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy(); wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy();
wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst(); wxObjectList::compatibility_iterator node1 = newLineShape->GetLineControlPoints()->GetFirst();
while (node1) while (node1)
{ {
wxRealPoint *point = (wxRealPoint *)node1->GetData(); wxRealPoint *point = (wxRealPoint *)node1->GetData();

View File

@@ -74,7 +74,7 @@ void csSymbolDatabase::AddSymbol(csSymbol* symbol)
void csSymbolDatabase::ClearSymbols() void csSymbolDatabase::ClearSymbols()
{ {
wxNode* node = m_symbols.GetFirst(); wxObjectList::compatibility_iterator node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->GetData(); csSymbol* symbol = (csSymbol*) node->GetData();
@@ -87,7 +87,7 @@ void csSymbolDatabase::ClearSymbols()
csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const
{ {
wxNode* node = m_symbols.GetFirst(); wxObjectList::compatibility_iterator node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->GetData(); csSymbol* symbol = (csSymbol*) node->GetData();
@@ -101,7 +101,7 @@ csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const
csSymbol* csSymbolDatabase::FindSymbol(int toolId) const csSymbol* csSymbolDatabase::FindSymbol(int toolId) const
{ {
wxNode* node = m_symbols.GetFirst(); wxObjectList::compatibility_iterator node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->GetData(); csSymbol* symbol = (csSymbol*) node->GetData();

View File

@@ -199,7 +199,7 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxShape *theShape = NULL; wxShape *theShape = NULL;
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->GetData(); wxShape *eachShape = (wxShape *)node->GetData();
@@ -216,7 +216,7 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind) void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind)
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->GetData(); wxShape *eachShape = (wxShape *)node->GetData();
@@ -331,7 +331,7 @@ void csDiagramView::DoCut(wxList& shapes)
{ {
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
wxNode* node = shapes.GetFirst(); wxObjectList::compatibility_iterator node = shapes.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->GetData(); wxShape *theShape = (wxShape*) node->GetData();
@@ -363,8 +363,8 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt
{ {
csDiagramCommand* command = new csDiagramCommand(op, doc); csDiagramCommand* command = new csDiagramCommand(op, doc);
wxNode* node = shapes.GetFirst(); wxObjectList::compatibility_iterator node = shapes.GetFirst();
wxNode* node1 = oldShapes.GetFirst(); wxObjectList::compatibility_iterator node1 = oldShapes.GetFirst();
while (node && node1) while (node && node1)
{ {
wxShape *theShape = (wxShape*) node->GetData(); wxShape *theShape = (wxShape*) node->GetData();
@@ -410,7 +410,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
wxNode* node = selections.GetFirst(); wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->GetData(); wxShape *theShape = (wxShape*) node->GetData();
@@ -479,7 +479,7 @@ void csDiagramView::ApplyPointSize(int pointSize)
{ {
csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc);
wxNode* node = selections.GetFirst(); wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->GetData(); wxShape *theShape = (wxShape*) node->GetData();
@@ -531,7 +531,7 @@ void csDiagramView::SelectAll(bool select)
wxList selections; wxList selections;
FindSelectedShapes(selections); FindSelectedShapes(selections);
wxNode* node = selections.GetFirst(); wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->GetData(); wxShape *theShape = (wxShape*) node->GetData();
@@ -544,7 +544,7 @@ void csDiagramView::SelectAll(bool select)
else else
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->GetData(); wxShape *eachShape = (wxShape *)node->GetData();

View File

@@ -224,8 +224,8 @@ void MyFrame::OnClose(wxCloseEvent& event)
return ; return ;
} }
// now try the children // now try the children
wxNode * pNode = m_children.GetFirst (); wxObjectList::compatibility_iterator pNode = m_children.GetFirst ();
wxNode * pNext ; wxObjectList::compatibility_iterator pNext ;
MyChild * pChild ; MyChild * pChild ;
while ( pNode ) while ( pNode )
{ {
@@ -233,7 +233,7 @@ void MyFrame::OnClose(wxCloseEvent& event)
pChild = (MyChild*) pNode -> GetData (); pChild = (MyChild*) pNode -> GetData ();
if (pChild -> Close ()) if (pChild -> Close ())
{ {
delete pNode ; m_children.Erase(pNode) ;
} }
else else
{ {

View File

@@ -76,7 +76,7 @@ wxPropertyValue::wxPropertyValue(const wxString& val)
m_modifiedFlag = FALSE; m_modifiedFlag = FALSE;
m_type = wxPropertyValueString; m_type = wxPropertyValueString;
m_value.string = copystring((const wxChar *)val); m_value.string = copystring(val.c_str());
m_clientData = NULL; m_clientData = NULL;
m_next = NULL; m_next = NULL;
m_last = NULL; m_last = NULL;
@@ -165,7 +165,7 @@ wxPropertyValue::wxPropertyValue(wxList *the_list)
m_last = NULL; m_last = NULL;
m_value.first = NULL; m_value.first = NULL;
wxNode *node = the_list->GetFirst(); wxObjectList::compatibility_iterator node = the_list->GetFirst();
while (node) while (node)
{ {
wxPropertyValue *expr = (wxPropertyValue *)node->GetData(); wxPropertyValue *expr = (wxPropertyValue *)node->GetData();
@@ -184,10 +184,10 @@ wxPropertyValue::wxPropertyValue(wxStringList *the_list)
m_last = NULL; m_last = NULL;
m_value.first = NULL; m_value.first = NULL;
wxStringList::Node *node = the_list->GetFirst(); wxStringList::compatibility_iterator node = the_list->GetFirst();
while (node) while (node)
{ {
wxChar *s = node->GetData(); wxString s = node->GetData();
Append(new wxPropertyValue(s)); Append(new wxPropertyValue(s));
node = node->GetNext(); node = node->GetNext();
} }
@@ -945,7 +945,7 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property)
if (property->GetValidator()) if (property->GetValidator())
return property->GetValidator(); return property->GetValidator();
wxNode *node = m_validatorRegistryList.GetFirst(); wxObjectList::compatibility_iterator node = m_validatorRegistryList.GetFirst();
while (node) while (node)
{ {
wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->GetData(); wxPropertyValidatorRegistry *registry = (wxPropertyValidatorRegistry *)node->GetData();
@@ -991,7 +991,7 @@ void wxPropertySheet::AddProperty(wxProperty *property)
// Get property by name // Get property by name
wxProperty *wxPropertySheet::GetProperty(const wxString& name) const wxProperty *wxPropertySheet::GetProperty(const wxString& name) const
{ {
wxNode *node = m_properties.Find((const wxChar*) name); wxObjectList::compatibility_iterator node = m_properties.Find((const wxChar*) name);
if (!node) if (!node)
return NULL; return NULL;
else else
@@ -1011,12 +1011,12 @@ bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& v
void wxPropertySheet::RemoveProperty(const wxString& name) void wxPropertySheet::RemoveProperty(const wxString& name)
{ {
wxNode *node = m_properties.Find(name); wxObjectList::compatibility_iterator node = m_properties.Find(name);
if(node) if(node)
{ {
wxProperty *prop = (wxProperty *)node->GetData(); wxProperty *prop = (wxProperty *)node->GetData();
delete prop; delete prop;
m_properties.DeleteNode(node); m_properties.Erase(node);
} }
} }
@@ -1028,11 +1028,11 @@ bool wxPropertySheet::HasProperty(const wxString& name) const
// Clear all properties // Clear all properties
void wxPropertySheet::Clear(void) void wxPropertySheet::Clear(void)
{ {
wxNode *node = m_properties.GetFirst(); wxObjectList::compatibility_iterator node = m_properties.GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->GetData(); wxProperty *prop = (wxProperty *)node->GetData();
wxNode *next = node->GetNext(); wxObjectList::compatibility_iterator next = node->GetNext();
delete prop; delete prop;
delete node; delete node;
node = next; node = next;
@@ -1042,7 +1042,7 @@ void wxPropertySheet::Clear(void)
// Sets/clears the modified flag for each property value // Sets/clears the modified flag for each property value
void wxPropertySheet::SetAllModified(bool flag) void wxPropertySheet::SetAllModified(bool flag)
{ {
wxNode *node = m_properties.GetFirst(); wxObjectList::compatibility_iterator node = m_properties.GetFirst();
while (node) while (node)
{ {
wxProperty *prop = (wxProperty *)node->GetData(); wxProperty *prop = (wxProperty *)node->GetData();

View File

@@ -75,7 +75,7 @@ void wxPolygonShape::Create(wxList *the_points)
// Duplicate the list of points // Duplicate the list of points
m_points = new wxList; m_points = new wxList;
wxNode *node = the_points->GetFirst(); wxObjectList::compatibility_iterator node = the_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -99,12 +99,12 @@ void wxPolygonShape::ClearPoints()
{ {
if (m_points) if (m_points)
{ {
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; m_points->Erase(node);
node = m_points->GetFirst(); node = m_points->GetFirst();
} }
delete m_points; delete m_points;
@@ -112,12 +112,12 @@ void wxPolygonShape::ClearPoints()
} }
if (m_originalPoints) if (m_originalPoints)
{ {
wxNode *node = m_originalPoints->GetFirst(); wxObjectList::compatibility_iterator node = m_originalPoints->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; m_originalPoints->Erase(node);
node = m_originalPoints->GetFirst(); node = m_originalPoints->GetFirst();
} }
delete m_originalPoints; delete m_originalPoints;
@@ -141,7 +141,7 @@ void wxPolygonShape::CalculateBoundingBox()
double top = 10000; double top = 10000;
double bottom = -10000; double bottom = -10000;
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -169,7 +169,7 @@ void wxPolygonShape::CalculatePolygonCentre()
double top = 10000; double top = 10000;
double bottom = -10000; double bottom = -10000;
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -260,7 +260,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
int np = m_points->GetCount(); int np = m_points->GetCount();
double *xpoints = new double[np]; double *xpoints = new double[np];
double *ypoints = new double[np]; double *ypoints = new double[np];
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
@@ -328,8 +328,8 @@ void wxPolygonShape::SetSize(double new_width, double new_height, bool WXUNUSED(
double x_proportion = (double)(fabs(new_width/m_originalWidth)); double x_proportion = (double)(fabs(new_width/m_originalWidth));
double y_proportion = (double)(fabs(new_height/m_originalHeight)); double y_proportion = (double)(fabs(new_height/m_originalHeight));
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
wxNode *original_node = m_originalPoints->GetFirst(); wxObjectList::compatibility_iterator original_node = m_originalPoints->GetFirst();
while (node && original_node) while (node && original_node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -352,18 +352,18 @@ void wxPolygonShape::SetSize(double new_width, double new_height, bool WXUNUSED(
void wxPolygonShape::UpdateOriginalPoints() void wxPolygonShape::UpdateOriginalPoints()
{ {
if (!m_originalPoints) m_originalPoints = new wxList; if (!m_originalPoints) m_originalPoints = new wxList;
wxNode *original_node = m_originalPoints->GetFirst(); wxObjectList::compatibility_iterator original_node = m_originalPoints->GetFirst();
while (original_node) while (original_node)
{ {
wxNode *next_node = original_node->GetNext(); wxObjectList::compatibility_iterator next_node = original_node->GetNext();
wxRealPoint *original_point = (wxRealPoint *)original_node->GetData(); wxRealPoint *original_point = (wxRealPoint *)original_node->GetData();
delete original_point; delete original_point;
delete original_node; m_originalPoints->Erase(original_node);
original_node = next_node; original_node = next_node;
} }
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -379,11 +379,11 @@ void wxPolygonShape::UpdateOriginalPoints()
void wxPolygonShape::AddPolygonPoint(int pos) void wxPolygonShape::AddPolygonPoint(int pos)
{ {
wxNode *node = m_points->Item(pos); wxObjectList::compatibility_iterator node = m_points->Item(pos);
if (!node) node = m_points->GetFirst(); if (!node) node = m_points->GetFirst();
wxRealPoint *firstPoint = (wxRealPoint *)node->GetData(); wxRealPoint *firstPoint = (wxRealPoint *)node->GetData();
wxNode *node2 = m_points->Item(pos + 1); wxObjectList::compatibility_iterator node2 = m_points->Item(pos + 1);
if (!node2) node2 = m_points->GetFirst(); if (!node2) node2 = m_points->GetFirst();
wxRealPoint *secondPoint = (wxRealPoint *)node2->GetData(); wxRealPoint *secondPoint = (wxRealPoint *)node2->GetData();
@@ -407,12 +407,12 @@ void wxPolygonShape::AddPolygonPoint(int pos)
void wxPolygonShape::DeletePolygonPoint(int pos) void wxPolygonShape::DeletePolygonPoint(int pos)
{ {
wxNode *node = m_points->Item(pos); wxObjectList::compatibility_iterator node = m_points->Item(pos);
if (node) if (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
delete point; delete point;
delete node; m_points->Erase(node);
UpdateOriginalPoints(); UpdateOriginalPoints();
if (m_selected) if (m_selected)
{ {
@@ -437,7 +437,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
{ {
// Look for the point we'd be connecting to. This is // Look for the point we'd be connecting to. This is
// a heuristic... // a heuristic...
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -463,7 +463,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
double *xpoints = new double[n]; double *xpoints = new double[n];
double *ypoints = new double[n]; double *ypoints = new double[n];
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
@@ -541,7 +541,7 @@ void wxPolygonShape::OnDrawOutline(wxDC& dc, double x, double y, double w, doubl
// Make as many control points as there are vertices. // Make as many control points as there are vertices.
void wxPolygonShape::MakeControlPoints() void wxPolygonShape::MakeControlPoints()
{ {
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -555,8 +555,8 @@ void wxPolygonShape::MakeControlPoints()
void wxPolygonShape::ResetControlPoints() void wxPolygonShape::ResetControlPoints()
{ {
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
wxNode *controlPointNode = m_controlPoints.GetFirst(); wxObjectList::compatibility_iterator controlPointNode = m_controlPoints.GetFirst();
while (node && controlPointNode) while (node && controlPointNode)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -582,7 +582,7 @@ void wxPolygonShape::WriteAttributes(wxExpr *clause)
// Make a list of lists for the coordinates // Make a list of lists for the coordinates
wxExpr *list = new wxExpr(wxExprList); wxExpr *list = new wxExpr(wxExprList);
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -740,7 +740,7 @@ void wxPolygonShape::Copy(wxShape& copy)
polyCopy.m_points = new wxList; polyCopy.m_points = new wxList;
polyCopy.m_originalPoints = new wxList; polyCopy.m_originalPoints = new wxList;
wxNode *node = m_points->GetFirst(); wxObjectList::compatibility_iterator node = m_points->GetFirst();
while (node) while (node)
{ {
wxRealPoint *point = (wxRealPoint *)node->GetData(); wxRealPoint *point = (wxRealPoint *)node->GetData();
@@ -765,7 +765,7 @@ void wxPolygonShape::Copy(wxShape& copy)
int wxPolygonShape::GetNumberOfAttachments() const int wxPolygonShape::GetNumberOfAttachments() const
{ {
int maxN = (m_points ? (m_points->GetCount() - 1) : 0); int maxN = (m_points ? (m_points->GetCount() - 1) : 0);
wxNode *node = m_attachmentPoints.GetFirst(); wxObjectList::compatibility_iterator node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
@@ -798,7 +798,7 @@ bool wxPolygonShape::AttachmentIsValid(int attachment) const
if ((attachment >= 0) && (attachment < (int) m_points->GetCount())) if ((attachment >= 0) && (attachment < (int) m_points->GetCount()))
return true; return true;
wxNode *node = m_attachmentPoints.GetFirst(); wxObjectList::compatibility_iterator node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
@@ -817,7 +817,7 @@ void wxPolygonShape::Rotate(double x, double y, double theta)
// Rotate attachment points // Rotate attachment points
double sinTheta = (double)sin(actualTheta); double sinTheta = (double)sin(actualTheta);
double cosTheta = (double)cos(actualTheta); double cosTheta = (double)cos(actualTheta);
wxNode *node = m_attachmentPoints.GetFirst(); wxObjectList::compatibility_iterator node = m_attachmentPoints.GetFirst();
while (node) while (node)
{ {
wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
@@ -1797,7 +1797,7 @@ wxShapeRegion::wxShapeRegion(wxShapeRegion& region)
m_penColour = region.m_penColour; m_penColour = region.m_penColour;
ClearText(); ClearText();
wxNode *node = region.m_formattedText.GetFirst(); wxObjectList::compatibility_iterator node = region.m_formattedText.GetFirst();
while (node) while (node)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)node->GetData(); wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();
@@ -1815,7 +1815,7 @@ wxShapeRegion::~wxShapeRegion()
void wxShapeRegion::ClearText() void wxShapeRegion::ClearText()
{ {
wxNode *node = m_formattedText.GetFirst(); wxObjectList::compatibility_iterator node = m_formattedText.GetFirst();
while (node) while (node)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)node->GetData(); wxShapeTextLine *line = (wxShapeTextLine *)node->GetData();

View File

@@ -224,8 +224,8 @@ void MyFrame::OnClose(wxCloseEvent& event)
return ; return ;
} }
// now try the children // now try the children
wxNode * pNode = m_children.GetFirst (); wxObjectList::compatibility_iterator pNode = m_children.GetFirst ();
wxNode * pNext ; wxObjectList::compatibility_iterator pNext ;
MyChild * pChild ; MyChild * pChild ;
while ( pNode ) while ( pNode )
{ {
@@ -233,7 +233,7 @@ void MyFrame::OnClose(wxCloseEvent& event)
pChild = (MyChild*) pNode -> GetData (); pChild = (MyChild*) pNode -> GetData ();
if (pChild -> Close ()) if (pChild -> Close ())
{ {
delete pNode ; m_children.Erase(pNode) ;
} }
else else
{ {