Code

plumb XML::Documents in everywhere
[inkscape.git] / src / sp-font-face.cpp
index ad4d586fc2e8f3f3d6d9ab1ed527090b5efbe574..31886b718522d0252ed0f9e6ef08e3c8d46ca567 100644 (file)
@@ -60,7 +60,7 @@ static void sp_fontface_init(SPFontFace *font);
 static void sp_fontface_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
 static void sp_fontface_release(SPObject *object);
 static void sp_fontface_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
 
 static void sp_fontface_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
 static void sp_fontface_remove_child(SPObject *object, Inkscape::XML::Node *child);
@@ -459,12 +459,11 @@ sp_fontface_update(SPObject *object, SPCtx *ctx, guint flags)
 
 #define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
 
-static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
 {
     SPFontFace *face = SP_FONTFACE(object);
 
     if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
         repr = xml_doc->createElement("svg:font-face");
     }
 
@@ -528,7 +527,7 @@ static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::N
     }
 
     if (((SPObjectClass *) (parent_class))->write) {
-        ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+        ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
     }
 
     return repr;