| 1958 | } |
| 1959 | |
| 1960 | void |
| 1961 | LayoutViewBase::set_properties (unsigned int index, const LayerPropertiesList &props) |
| 1962 | { |
| 1963 | // If index is not a valid tab index, don't do anything except for the case of |
| 1964 | // index 0 in which the first entry is created (this can happen as a result of |
| 1965 | // delete_properties). |
| 1966 | if (index >= layer_lists ()) { |
| 1967 | if (index > 0) { |
| 1968 | return; |
| 1969 | } else { |
| 1970 | m_layer_properties_lists.push_back (new LayerPropertiesList ()); |
| 1971 | m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1)); |
| 1972 | } |
| 1973 | } |
| 1974 | |
| 1975 | // HINT: this method is quite frequently used in an imperative way. |
| 1976 | // Since it has some desired side effects such as forcing a recomputation of the internals, |
| 1977 | // it should be executed in any case, even if props == get_properties (). |
| 1978 | |
| 1979 | if (transacting ()) { |
| 1980 | manager ()->queue (this, new OpSetAllProps (index, get_properties (), props)); |
| 1981 | } else if (manager () && ! replaying ()) { |
| 1982 | manager ()->clear (); |
| 1983 | } |
| 1984 | |
| 1985 | if (index == current_layer_list ()) { |
| 1986 | begin_layer_updates (); |
| 1987 | } |
| 1988 | |
| 1989 | *m_layer_properties_lists [index] = props; |
| 1990 | m_layer_properties_lists [index]->attach_view (this, index); |
| 1991 | |
| 1992 | merge_dither_pattern (*m_layer_properties_lists [index]); |
| 1993 | |
| 1994 | if (index == current_layer_list ()) { |
| 1995 | end_layer_updates (); |
| 1996 | layer_list_changed_event (3); |
| 1997 | redraw_later (); |
| 1998 | m_prop_changed = true; |
| 1999 | } |
| 2000 | } |
| 2001 | |
| 2002 | void |
| 2003 | LayoutViewBase::clear_layers (unsigned int index) |
no test coverage detected