MCPcopy Create free account
hub / github.com/KLayout/klayout / do_delete_items

Function do_delete_items

src/laybasic/laybasic/layAbstractMenu.cc:1743–1758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741}
1742
1743static void do_delete_items (AbstractMenuItem &parent, Action *action)
1744{
1745 for (std::list<AbstractMenuItem>::iterator l = parent.children.begin (); l != parent.children.end (); ) {
1746 std::list<AbstractMenuItem>::iterator ll = l;
1747 ++ll;
1748 if (l->action () == action) {
1749 parent.children.erase (l);
1750 } else {
1751 do_delete_items (*l, action);
1752 if (l->remove_on_empty () && l->children.empty ()) {
1753 parent.children.erase (l);
1754 }
1755 }
1756 l = ll;
1757 }
1758}
1759
1760void
1761AbstractMenu::delete_items (Action *action)

Callers 1

delete_itemsMethod · 0.85

Calls 5

beginMethod · 0.45
endMethod · 0.45
actionMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected