| 2294 | } |
| 2295 | |
| 2296 | void |
| 2297 | LayoutViewBase::undo (db::Op *op) |
| 2298 | { |
| 2299 | tl_assert (! transacting ()); |
| 2300 | |
| 2301 | OpSetLayerProps *sop = dynamic_cast <OpSetLayerProps *> (op); |
| 2302 | if (sop) { |
| 2303 | if (sop->m_list_index < m_layer_properties_lists.size ()) { |
| 2304 | set_properties (sop->m_list_index, lay::LayerPropertiesConstIterator (*m_layer_properties_lists [sop->m_list_index], sop->m_index), sop->m_old); |
| 2305 | } |
| 2306 | return; |
| 2307 | } |
| 2308 | |
| 2309 | OpSetLayerPropsNode *snop = dynamic_cast <OpSetLayerPropsNode *> (op); |
| 2310 | if (snop) { |
| 2311 | if (snop->m_list_index < m_layer_properties_lists.size ()) { |
| 2312 | replace_layer_node (snop->m_list_index, lay::LayerPropertiesConstIterator (*m_layer_properties_lists [snop->m_list_index], snop->m_index), snop->m_old); |
| 2313 | } |
| 2314 | return; |
| 2315 | } |
| 2316 | |
| 2317 | OpInsertLayerList *ilop = dynamic_cast <OpInsertLayerList *> (op); |
| 2318 | if (ilop) { |
| 2319 | if (ilop->m_list_index <= m_layer_properties_lists.size ()) { |
| 2320 | delete_layer_list (ilop->m_list_index); |
| 2321 | } |
| 2322 | return; |
| 2323 | } |
| 2324 | |
| 2325 | OpDeleteLayerList *dlop = dynamic_cast <OpDeleteLayerList *> (op); |
| 2326 | if (dlop) { |
| 2327 | if (dlop->m_list_index < m_layer_properties_lists.size ()) { |
| 2328 | insert_layer_list (dlop->m_list_index, dlop->m_old); |
| 2329 | } |
| 2330 | return; |
| 2331 | } |
| 2332 | |
| 2333 | OpSetAllProps *saop = dynamic_cast <OpSetAllProps *> (op); |
| 2334 | if (saop) { |
| 2335 | if (saop->m_list_index < m_layer_properties_lists.size ()) { |
| 2336 | set_properties (saop->m_list_index, saop->m_old); |
| 2337 | } |
| 2338 | return; |
| 2339 | } |
| 2340 | |
| 2341 | OpRenameProps *rnop = dynamic_cast <OpRenameProps *> (op); |
| 2342 | if (rnop) { |
| 2343 | if (rnop->m_list_index < m_layer_properties_lists.size ()) { |
| 2344 | rename_properties (rnop->m_list_index, rnop->m_old); |
| 2345 | } |
| 2346 | return; |
| 2347 | } |
| 2348 | |
| 2349 | OpLayerList *lop = dynamic_cast <OpLayerList *> (op); |
| 2350 | if (lop) { |
| 2351 | if (lop->m_list_index < m_layer_properties_lists.size ()) { |
| 2352 | if (lop->m_mode == OpLayerList::Insert) { |
| 2353 | lay::LayerPropertiesConstIterator iter (*m_layer_properties_lists [lop->m_list_index], lop->m_index); |
nothing calls this directly
no test coverage detected