Code

Changed preference to use file chooser button
[inkscape.git] / src / sp-item-group.cpp
index bb94425c5beccbe8dbc88fc2966f86c1aae78704..f1035e9eef6028a234a0eac680c841f90ed6808a 100644 (file)
@@ -34,6 +34,7 @@
 #include "prefs-utils.h"
 #include "sp-clippath.h"
 #include "sp-mask.h"
+#include "sp-path.h"
 
 static void sp_group_class_init (SPGroupClass *klass);
 static void sp_group_init (SPGroup *group);
@@ -297,8 +298,10 @@ static void sp_group_snappoints (SPItem const *item, SnapPointsIter p)
             o != NULL;
             o = SP_OBJECT_NEXT(o))
        {
-               if (SP_IS_ITEM(o)) {
-                       sp_item_snappoints(SP_ITEM(o), p);
+               if (SP_IS_ITEM(o) && !SP_IS_PATH(o)) {
+            // getSnapPoints() and sp_group_snappoints are only being used in the selector tool,
+            // which should not snap path nodes. Only the node tool should snap those.
+            sp_item_snappoints(SP_ITEM(o), false, p);
                }
        }
 }
@@ -364,7 +367,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done)
 
                        child->updateRepr();
 
-                       Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate();
+                       Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate(prepr->document());
 
                        // Merging transform
                        NR::Matrix ctrans;
@@ -387,17 +390,14 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done)
                        // This is just a way to temporarily remember the transform in repr. When repr is
                        // reattached outside of the group, the transform will be written more properly
                        // (i.e. optimized into the object if the corresponding preference is set)
-                       gchar affinestr[80];
-                       if (sp_svg_transform_write(affinestr, 79, ctrans)) {
-                               nrepr->setAttribute("transform", affinestr);
-                       } else {
-                               nrepr->setAttribute("transform", NULL);
-                       }
+                       gchar *affinestr=sp_svg_transform_write(ctrans);
+                       nrepr->setAttribute("transform", affinestr);
+                        g_free(affinestr);
 
                        items = g_slist_prepend (items, nrepr);
 
                } else {
-                       Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate();
+                       Inkscape::XML::Node *nrepr = SP_OBJECT_REPR (child)->duplicate(prepr->document());
                        objects = g_slist_prepend (objects, nrepr);
                }
        }
@@ -420,7 +420,6 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done)
        }
 
        /* Step 4 - add items */
-       gint const preserve = prefs_get_int_attribute("options.preservetransform", "value", 0);
        while (items) {
                Inkscape::XML::Node *repr = (Inkscape::XML::Node *) items->data;
                // add item