summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-05-28 14:38:37 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-05-28 14:38:37 +0000
commit6c9378a68e4d3a37a9122e2cc68e3302701b1e8d (patch)
treebaaa4930923a8ab5a5364311cd363433ffbb6aa8 /src
parentOption to keep selection when changing layers (diff)
downloadinkscape-6c9378a68e4d3a37a9122e2cc68e3302701b1e8d.tar.gz
inkscape-6c9378a68e4d3a37a9122e2cc68e3302701b1e8d.zip
break apart faster: prepend to list instead of append, add objects to selection wholesale instead of one by one
(bzr r1038)
Diffstat (limited to 'src')
-rw-r--r--src/display/curve.cpp7
-rw-r--r--src/draw-context.cpp2
-rw-r--r--src/path-chemistry.cpp8
3 files changed, 8 insertions, 9 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 3e491a2b8..bbbba09f0 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -254,12 +254,7 @@ sp_curve_split(SPCurve const *curve)
new_curve->substart = 0;
new_curve->closed = (new_curve->_bpath->code == NR_MOVETO);
new_curve->hascpt = (new_curve->_bpath->code == NR_MOVETO_OPEN);
- l = g_slist_append(l, new_curve);
- /** \todo
- * effic: Use g_slist_prepend instead. Either work backwards from
- * the end of curve, or work forwards as at present but do
- * g_slist_reverse before returning.
- */
+ l = g_slist_prepend(l, new_curve);
p += i;
}
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index 6263880a4..6bea0851b 100644
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
@@ -301,7 +301,7 @@ spdc_attach_selection(SPDrawContext *dc, Inkscape::Selection *sel)
SPCurve *norm = sp_shape_get_curve(SP_SHAPE(item));
sp_curve_transform(norm, sp_item_i2d_affine(dc->white_item));
g_return_if_fail( norm != NULL );
- dc->white_curves = sp_curve_split(norm);
+ dc->white_curves = g_slist_reverse(sp_curve_split(norm));
sp_curve_unref(norm);
/* Anchor list */
for (GSList *l = dc->white_curves; l != NULL; l = l->next) {
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 1cd7480aa..c11754ece 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -192,7 +192,8 @@ sp_selected_path_break_apart(void)
sp_curve_unref(curve);
- for (GSList *l = g_slist_reverse(list); l != NULL; l = l->next) {
+ GSList *reprs = NULL;
+ for (GSList *l = list; l != NULL; l = l->next) {
curve = (SPCurve *) l->data;
Inkscape::XML::Node *repr = sp_repr_new("svg:path");
@@ -212,11 +213,14 @@ sp_selected_path_break_apart(void)
if (l == list)
repr->setAttribute("id", id);
- selection->add(repr);
+ reprs = g_slist_prepend (reprs, repr);
Inkscape::GC::release(repr);
}
+ selection->setReprList(reprs);
+
+ g_slist_free(reprs);
g_slist_free(list);
g_free(style);