diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-15 03:59:18 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-15 03:59:18 +0000 |
| commit | 25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch) | |
| tree | e123aeae50d98a52e1ad4575b29bf3c199619e33 /src/ui/widget/layer-selector.cpp | |
| parent | Solve crash when deleting CSS property (diff) | |
| parent | inkview: Convert to ApplicationWindow (diff) | |
| download | inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip | |
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/ui/widget/layer-selector.cpp')
| -rw-r--r-- | src/ui/widget/layer-selector.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp index 7ee34f3b3..4432a6e09 100644 --- a/src/ui/widget/layer-selector.cpp +++ b/src/ui/widget/layer-selector.cpp @@ -19,6 +19,8 @@ #include "ui/dialog/layer-properties.h" #include <glibmm/i18n.h> +#include <boost/range/adaptor/filtered.hpp> +#include <boost/range/adaptor/reversed.hpp> #include "desktop.h" @@ -346,27 +348,17 @@ void LayerSelector::_buildSiblingEntries( unsigned depth, SPObject &parent, Inkscape::Util::List<SPObject &> hierarchy ) { - using Inkscape::Util::List; using Inkscape::Util::rest; - using Inkscape::Util::reverse_list_in_place; - using Inkscape::Util::filter_list; - Inkscape::Util::List<SPObject &> siblings( - reverse_list_in_place( - filter_list<SPObject::SiblingIterator>( - is_layer(_desktop), parent.firstChild(), NULL - ) - ) - ); + auto siblings = parent.children | boost::adaptors::filtered(is_layer(_desktop)) | boost::adaptors::reversed; SPObject *layer( hierarchy ? &*hierarchy : NULL ); - while (siblings) { - _buildEntry(depth, *siblings); - if ( &*siblings == layer ) { + for (auto& sib: siblings) { + _buildEntry(depth, sib); + if ( &sib == layer ) { _buildSiblingEntries(depth+1, *layer, rest(hierarchy)); } - ++siblings; } } |
