summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2015-12-07 10:00:35 +0000
committer~suv <suv-sf@users.sourceforge.net>2015-12-07 10:00:35 +0000
commit457c41675d69c7463c3590ad9b8e43bcae20e611 (patch)
tree43d1f8d4e350a3070944bbd7bb4ad265c1b6ed02 /src/document.cpp
parentmerge from trunk (r14473) (diff)
parentRemove leftover assert. (diff)
downloadinkscape-457c41675d69c7463c3590ad9b8e43bcae20e611.tar.gz
inkscape-457c41675d69c7463c3590ad9b8e43bcae20e611.zip
merge from trunk (r14506)
(bzr r14425.1.4)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 0e49f23e2..23d99d78c 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -1337,20 +1337,25 @@ SPItem *SPDocument::getItemFromListAtPointBottom(unsigned int dkey, SPGroup *gro
/**
Turn the SVG DOM into a flat list of nodes that can be searched from top-down.
The list can be persisted, which improves "find at multiple points" speed.
+Returns true if upto is reached.
*/
-static void build_flat_item_list(std::deque<SPItem*> *nodes, unsigned int dkey, SPGroup *group, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL)
+static bool build_flat_item_list(std::deque<SPItem*> *nodes, unsigned int dkey, SPGroup *group, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL)
{
+ bool found_upto = false;
for ( SPObject *o = group->firstChild() ; o ; o = o->getNext() ) {
if (!SP_IS_ITEM(o)) {
continue;
}
if (upto && SP_ITEM(o) == upto) {
+ found_upto = true;
break;
}
if (SP_IS_GROUP(o) && (SP_GROUP(o)->effectiveLayerMode(dkey) == SPGroup::LAYER || into_groups)) {
- build_flat_item_list(nodes, dkey, SP_GROUP(o), into_groups, take_insensitive, upto);
+ found_upto = build_flat_item_list(nodes, dkey, SP_GROUP(o), into_groups, take_insensitive, upto);
+ if (found_upto)
+ break;
} else {
SPItem *child = SP_ITEM(o);
@@ -1359,6 +1364,7 @@ static void build_flat_item_list(std::deque<SPItem*> *nodes, unsigned int dkey,
}
}
}
+ return found_upto;
}
/**