| 6364 | } |
| 6365 | |
| 6366 | db::cell_index_type |
| 6367 | LayoutViewBase::new_cell (int cv_index, const std::string &cell_name) |
| 6368 | { |
| 6369 | db::cell_index_type new_ci (0); |
| 6370 | |
| 6371 | if (cv_index >= 0 && int (m_cellviews.size ()) > cv_index) { |
| 6372 | |
| 6373 | db::Layout &layout = cellview (cv_index)->layout (); |
| 6374 | if (! cell_name.empty () && layout.cell_by_name (cell_name.c_str ()).first) { |
| 6375 | throw tl::Exception (tl::to_string (tr ("A cell with that name already exists: %s")), cell_name); |
| 6376 | } |
| 6377 | |
| 6378 | transaction (tl::to_string (tr ("New cell"))); |
| 6379 | new_ci = layout.add_cell (cell_name.empty () ? 0 : cell_name.c_str ()); |
| 6380 | commit (); |
| 6381 | |
| 6382 | } |
| 6383 | |
| 6384 | return new_ci; |
| 6385 | } |
| 6386 | |
| 6387 | template <class T, class Iter> |
| 6388 | static void make_unique_name (T *object, Iter from, Iter to) |
no test coverage detected