| 1888 | } |
| 1889 | |
| 1890 | void |
| 1891 | LayoutViewBase::merge_dither_pattern (lay::LayerPropertiesList &props) |
| 1892 | { |
| 1893 | { |
| 1894 | lay::DitherPattern dp (dither_pattern ()); |
| 1895 | |
| 1896 | std::map <unsigned int, unsigned int> index_map; |
| 1897 | dp.merge (props.dither_pattern (), index_map); |
| 1898 | |
| 1899 | // remap the dither pattern index |
| 1900 | for (lay::LayerPropertiesIterator l = props.begin_recursive (); l != props.end_recursive (); ++l) { |
| 1901 | int dpi = l->dither_pattern (false /*local*/); |
| 1902 | std::map <unsigned int, unsigned int>::iterator m = index_map.find ((unsigned int) dpi); |
| 1903 | if (m != index_map.end ()) { |
| 1904 | l->set_dither_pattern (int (m->second)); |
| 1905 | } |
| 1906 | } |
| 1907 | |
| 1908 | // install the new custom pattern table |
| 1909 | if (mp_canvas->dither_pattern () != dp) { |
| 1910 | mp_canvas->set_dither_pattern (dp); |
| 1911 | for (unsigned int i = 0; i < layer_lists (); ++i) { |
| 1912 | m_layer_properties_lists [i]->set_dither_pattern (dp); |
| 1913 | } |
| 1914 | } |
| 1915 | } |
| 1916 | |
| 1917 | { |
| 1918 | lay::LineStyles ls (line_styles ()); |
| 1919 | |
| 1920 | std::map <unsigned int, unsigned int> index_map; |
| 1921 | ls.merge (props.line_styles (), index_map); |
| 1922 | |
| 1923 | // remap the dither pattern index |
| 1924 | for (lay::LayerPropertiesIterator l = props.begin_recursive (); l != props.end_recursive (); ++l) { |
| 1925 | int lsi = l->line_style (false /*local*/); |
| 1926 | std::map <unsigned int, unsigned int>::iterator m = index_map.find ((unsigned int) lsi); |
| 1927 | if (m != index_map.end ()) { |
| 1928 | l->set_line_style (int (m->second)); |
| 1929 | } |
| 1930 | } |
| 1931 | |
| 1932 | // install the new custom pattern table |
| 1933 | if (mp_canvas->line_styles () != ls) { |
| 1934 | mp_canvas->set_line_styles (ls); |
| 1935 | for (unsigned int i = 0; i < layer_lists (); ++i) { |
| 1936 | m_layer_properties_lists [i]->set_line_styles (ls); |
| 1937 | } |
| 1938 | } |
| 1939 | } |
| 1940 | } |
| 1941 | |
| 1942 | bool |
| 1943 | LayoutViewBase::always_show_source () const |
nothing calls this directly
no test coverage detected