| 2164 | } |
| 2165 | |
| 2166 | void |
| 2167 | LayoutViewBase::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter) |
| 2168 | { |
| 2169 | if (index >= layer_lists ()) { |
| 2170 | return; |
| 2171 | } |
| 2172 | |
| 2173 | lay::LayerPropertiesNode orig = *iter; |
| 2174 | |
| 2175 | if (index == current_layer_list ()) { |
| 2176 | begin_layer_updates (); |
| 2177 | } |
| 2178 | |
| 2179 | // delete the element |
| 2180 | m_layer_properties_lists [index]->erase (LayerPropertiesIterator (*m_layer_properties_lists [index], iter.uint ())); |
| 2181 | |
| 2182 | if (transacting ()) { |
| 2183 | manager ()->queue (this, new OpDeleteLayerProps (index, (unsigned int) iter.uint (), orig)); |
| 2184 | } else if (manager () && ! replaying ()) { |
| 2185 | manager ()->clear (); |
| 2186 | } |
| 2187 | |
| 2188 | // signal to the observers that something has changed |
| 2189 | if (index == current_layer_list ()) { |
| 2190 | end_layer_updates (); |
| 2191 | layer_list_changed_event (2); |
| 2192 | redraw_later (); |
| 2193 | m_prop_changed = true; |
| 2194 | } |
| 2195 | |
| 2196 | // invalidate the iterator so it can be used to refer to the next element |
| 2197 | iter.invalidate (); |
| 2198 | } |
| 2199 | |
| 2200 | void |
| 2201 | LayoutViewBase::save_as (unsigned int index, const std::string &filename, tl::OutputStream::OutputStreamMode om, const db::SaveLayoutOptions &options, bool update, int keep_backups) |
no test coverage detected