| 2044 | } |
| 2045 | |
| 2046 | void |
| 2047 | LayoutViewBase::replace_layer_node (unsigned int index, const LayerPropertiesConstIterator &iter, const LayerPropertiesNode &node) |
| 2048 | { |
| 2049 | if (index >= layer_lists ()) { |
| 2050 | return; |
| 2051 | } |
| 2052 | |
| 2053 | // if the source specification changed, a redraw is required |
| 2054 | if (*iter != node) { |
| 2055 | |
| 2056 | if (transacting ()) { |
| 2057 | manager ()->queue (this, new OpSetLayerPropsNode (index, (unsigned int) iter.uint (), *iter, node)); |
| 2058 | } else if (manager () && ! replaying ()) { |
| 2059 | manager ()->clear (); |
| 2060 | } |
| 2061 | |
| 2062 | if (index == current_layer_list ()) { |
| 2063 | begin_layer_updates (); |
| 2064 | } |
| 2065 | |
| 2066 | LayerPropertiesIterator non_const_iter (get_properties (index), iter.uint ()); |
| 2067 | *non_const_iter = node; |
| 2068 | non_const_iter->attach_view (this, index); |
| 2069 | |
| 2070 | if (index == current_layer_list ()) { |
| 2071 | end_layer_updates (); |
| 2072 | layer_list_changed_event (2); |
| 2073 | // TODO: check, if redraw is actually necessary (this is complex!) |
| 2074 | redraw_later (); |
| 2075 | m_prop_changed = true; |
| 2076 | } |
| 2077 | } |
| 2078 | } |
| 2079 | |
| 2080 | void |
| 2081 | LayoutViewBase::set_layer_node_expanded (unsigned int index, const LayerPropertiesConstIterator &iter, bool ex) |