diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 5ba1e5576a..98d11752c0 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -412,10 +412,9 @@ public: virtual ~wxPGHeaderCtrl() { - for (wxVector::const_iterator it = m_columns.begin(); - it != m_columns.end(); ++it) + for ( wxHeaderColumnSimple* c : m_columns ) { - delete *it; + delete c; } } diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index e679f0c7ea..b7bed3f9d6 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -509,9 +509,8 @@ void wxPGProperty::InitAfterAdded( wxPropertyGridPageState* pageState, // // Convert invalid cells to default ones in this grid - for (wxVector::iterator it = m_cells.begin(); it != m_cells.end(); ++it) + for ( wxPGCell& cell : m_cells ) { - wxPGCell& cell = *it; if ( cell.IsInvalid() ) { cell = IsCategory() ? propgrid->GetCategoryDefaultCell() @@ -643,9 +642,8 @@ void wxPGProperty::OnDetached(wxPropertyGridPageState* WXUNUSED(state), const wxPGCell& catDefCell = propgrid->GetCategoryDefaultCell(); // Make default cells invalid - for(wxVector::iterator it = m_cells.begin(); it != m_cells.end(); ++it) + for ( wxPGCell& cell : m_cells ) { - wxPGCell& cell = *it; if ( cell.IsSameAs(propDefCell) || cell.IsSameAs(catDefCell) ) { diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 9e0e6f2462..4a7b420a89 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -485,9 +485,8 @@ wxPropertyGrid::~wxPropertyGrid() // // Remove grid and property pointers from live wxPropertyGridEvents. - for (wxVector::iterator it = m_liveEvents.begin(); it != m_liveEvents.end(); ++it) + for ( wxPropertyGridEvent* evt : m_liveEvents ) { - wxPropertyGridEvent* evt = *it; evt->SetPropertyGrid(nullptr); evt->SetProperty(nullptr); } @@ -560,9 +559,9 @@ wxPropertyGrid::~wxPropertyGrid() delete m_pState; // Delete common value records - for(wxVector::iterator it = m_commonValues.begin(); it != m_commonValues.end(); ++it) + for ( wxPGCommonValue* v : m_commonValues ) { - delete *it; + delete v; } #if WXWIN_COMPATIBILITY_3_0 wxASSERT( gs_deletedEditorObjects[this]->empty() ); @@ -2158,9 +2157,9 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxVector splitterPos; splitterPos.reserve(colCount); int sx = x; - for (wxVector::const_iterator cit = colWidths.begin(); cit != colWidths.end(); ++cit) + for ( int cw : colWidths ) { - sx += *cit; + sx += cw; splitterPos.push_back(sx); }