diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:58:51 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-08-09 09:58:51 +0000 |
| commit | e5143d65bb57d4ce623e6220585b099e6d2ee453 (patch) | |
| tree | 4ff78f6fa8f0c1b740fd43b0ade2b91dbf9226d0 /src/ui/widget | |
| parent | Remove deprecated Autotools and btool files. Please use CMake instead (diff) | |
| parent | Merged trunk (diff) | |
| download | inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.tar.gz inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.zip | |
Merged gsoc work. Created better data structure for selections, replaced SPObject children list, improved spray tool, split tests to separate executables
(bzr r15047)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/layer-selector.cpp | 20 | ||||
| -rw-r--r-- | src/ui/widget/object-composite-settings.cpp | 2 | ||||
| -rw-r--r-- | src/ui/widget/style-subject.cpp | 10 |
3 files changed, 13 insertions, 19 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; } } diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index c8ac20c54..1727660c8 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -118,7 +118,7 @@ ObjectCompositeSettings::_blendBlurValueChanged() const Glib::ustring blendmode = _fe_cb.get_blend_mode(); //apply created filter to every selected item - std::vector<SPObject*> sel=_subject->list(); + std::vector<SPObject*> sel = _subject->list(); for (std::vector<SPObject*>::const_iterator i = sel.begin() ; i != sel.end() ; ++i ) { if (!SP_IS_ITEM(*i)) { continue; diff --git a/src/ui/widget/style-subject.cpp b/src/ui/widget/style-subject.cpp index 811ed2221..a779e6feb 100644 --- a/src/ui/widget/style-subject.cpp +++ b/src/ui/widget/style-subject.cpp @@ -54,11 +54,13 @@ Inkscape::Selection *StyleSubject::Selection::_getSelection() const { } } -std::vector<SPObject*> StyleSubject::Selection::list(){ +std::vector<SPObject*> StyleSubject::Selection::list() { Inkscape::Selection *selection = _getSelection(); - if(selection) - return selection->list(); - else return std::vector<SPObject*>(); + if(selection) { + return std::vector<SPObject *>(selection->objects().begin(), selection->objects().end()); + } + + return std::vector<SPObject*>(); } Geom::OptRect StyleSubject::Selection::getBounds(SPItem::BBoxType type) { |
