Code

new command: relink clone to copied object
[inkscape.git] / src / sp-offset.cpp
index 5ff01814f06ae6a1c7fd2fc09ff1c79904799eb7..d3711a9f6d01e26d60c1d7de3643e3a8a4e9df47 100644 (file)
@@ -75,7 +75,7 @@ static void sp_offset_finalize(GObject *obj);
 
 static void sp_offset_build (SPObject * object, SPDocument * document,
                              Inkscape::XML::Node * repr);
-static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Node * repr,
+static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Document *doc, Inkscape::XML::Node * repr,
                                 guint flags);
 static void sp_offset_set (SPObject * object, unsigned int key,
                            const gchar * value);
@@ -259,12 +259,11 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
  * Virtual write: write offset attributes to corresponding repr.
  */
 static Inkscape::XML::Node *
-sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_offset_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
 {
     SPOffset *offset = SP_OFFSET (object);
 
     if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(object)->document();
         repr = xml_doc->createElement("svg:path");
     }
 
@@ -287,12 +286,12 @@ sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
     }
 
     // write that curve to "d"
-    char *d = sp_svg_write_path (SP_CURVE_BPATH(((SPShape *) offset)->curve));
+    char *d = sp_svg_write_path (((SPShape *) offset)->curve->get_pathvector());
     repr->setAttribute("d", d);
     g_free (d);
 
     if (((SPObjectClass *) (parent_class))->write)
-        ((SPObjectClass *) (parent_class))->write (object, repr,
+        ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr,
                                                    flags | SP_SHAPE_WRITE_PATH);
 
     return repr;