diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index de310cf35e..ea27b75a01 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1160,7 +1160,7 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) wxCHECK_RET( points, "NULL pointer to spline points?" ); - const size_t n_points = points->GetCount(); + const size_t n_points = points->size(); wxCHECK_RET( n_points >= 2 , "incomplete list of spline points?" ); const size_t n_bezier_points = n_points * 3 + 1; @@ -1168,8 +1168,8 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) size_t bezier_pos = 0; wxCoord x1, y1, x2, y2, cx1, cy1; - wxPointList::compatibility_iterator node = points->GetFirst(); - wxPoint *p = node->GetData(); + wxPointList::const_iterator itPt = points->begin(); + wxPoint* p = *itPt; ++itPt; lppt[ bezier_pos ].x = x1 = p->x; lppt[ bezier_pos ].y = y1 = p->y; bezier_pos++; @@ -1177,9 +1177,7 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) bezier_pos++; CalcBoundingBox(x1, y1); - node = node->GetNext(); - p = node->GetData(); - + p = *itPt; ++itPt; x2 = p->x; y2 = p->y; cx1 = ( x1 + x2 ) / 2; @@ -1191,20 +1189,15 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points) bezier_pos++; CalcBoundingBox(x2, y2); -#if !wxUSE_STD_CONTAINERS - while ((node = node->GetNext()) != NULL) -#else - while ((node = node->GetNext())) -#endif // !wxUSE_STD_CONTAINERS + while ( itPt != points->end() ) { - int cx4, cy4; - p = (wxPoint *)node->GetData(); + p = *itPt; ++itPt; x1 = x2; y1 = y2; x2 = p->x; y2 = p->y; - cx4 = (x1 + x2) / 2; - cy4 = (y1 + y2) / 2; + int cx4 = (x1 + x2) / 2; + int cy4 = (y1 + y2) / 2; // B0 is B3 of previous segment // B1: lppt[ bezier_pos ].x = XLOG2DEV((x1*2+cx1)/3);