diff --git a/src/ant/ant/antService.cc b/src/ant/ant/antService.cc index b42ae5012..8477b6231 100644 --- a/src/ant/ant/antService.cc +++ b/src/ant/ant/antService.cc @@ -1750,10 +1750,11 @@ Service::transform (const db::DCplxTrans &trans) if (robj) { // compute transformed object and replace + int id = robj->id (); ant::Object *rnew = new ant::Object (*robj); rnew->transform (trans); mp_view->annotation_shapes ().replace (s->first, db::DUserObject (rnew)); - annotation_changed_event (rnew->id ()); + annotation_changed_event (id); } diff --git a/src/laybasic/laybasic/layViewObject.cc b/src/laybasic/laybasic/layViewObject.cc index 1242f9d4d..31caade5b 100644 --- a/src/laybasic/laybasic/layViewObject.cc +++ b/src/laybasic/laybasic/layViewObject.cc @@ -691,11 +691,9 @@ ViewObjectUI::do_mouse_move () db::DPoint p = pixel_to_um (m_mouse_pressed); - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->enabled () && (*g)->mouse_press_event (p, m_mouse_buttons, true)); - g = gg; } if (! done && mp_active_service) { @@ -726,11 +724,9 @@ ViewObjectUI::do_mouse_move () db::DPoint p = pixel_to_um (m_mouse_pos); - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->enabled () && (*g)->mouse_move_event (p, m_mouse_buttons, true)); - g = gg; } if (! done && mp_active_service) { @@ -772,11 +768,9 @@ ViewObjectUI::send_leave_event () bool done = false; - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->enabled () && (*g)->leave_event (true)); - g = gg; } if (! done && mp_active_service) { @@ -814,11 +808,9 @@ ViewObjectUI::send_enter_event () bool done = false; - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->enabled () && (*g)->enter_event (true)); - g = gg; } if (! done && mp_active_service) { @@ -878,11 +870,9 @@ ViewObjectUI::send_mouse_double_clicked_event (const db::DPoint &pt, unsigned in db::DPoint p = pixel_to_um (m_mouse_pos); - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->m_enabled && (*g)->mouse_double_click_event (p, buttons, true)); - g = gg; } if (! done && mp_active_service) { @@ -917,15 +907,13 @@ ViewObjectUI::send_mouse_release_event (const db::DPoint &pt, unsigned int /*but m_mouse_pos = pt; db::DPoint p = pixel_to_um (m_mouse_pos); - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { if (m_mouse_pressed_state) { done = (*g)->enabled () && (*g)->mouse_click_event (p, m_mouse_buttons, true); } else { done = (*g)->enabled () && (*g)->mouse_release_event (p, m_mouse_buttons, true); } - g = gg; } if (! done && mp_active_service && mp_active_service->enabled ()) { @@ -978,11 +966,9 @@ ViewObjectUI::send_wheel_event (int delta, bool horizontal, const db::DPoint &pt bool done = false; - for (std::list::iterator g = m_grabbed.begin (); !done && g != m_grabbed.end (); ) { - std::list::iterator gg = g; - ++gg; + auto grabbed = m_grabbed; + for (auto g = grabbed.begin (); !done && g != grabbed.end (); ++g) { done = ((*g)->enabled () && (*g)->wheel_event (delta, horizontal, p, buttons, true)); - g = gg; } if (! done && mp_active_service) {