Logo Search packages:      
Sourcecode: inkscape version File versions

static Inkscape::XML::Node * sp_tref_write ( SPObject object,
Inkscape::XML::Node repr,
guint  flags 
) [static]

Writes its settings to an incoming repr object, if any.

Definition at line 293 of file sp-tref.cpp.

References Inkscape::XML::Node::setAttribute().

{
    debug("0x%p",object);
    
    SPTRef *tref = SP_TREF(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:tref");
    }
    
    tref->attributes.writeTo(repr);
    
    if (tref->uriOriginalRef->getURI()) {
        gchar *uri_string = tref->uriOriginalRef->getURI()->toString();
        debug("uri_string=%s", uri_string);
        repr->setAttribute("xlink:href", uri_string);
        g_free(uri_string);
    }

    if (((SPObjectClass *) tref_parent_class)->write) {
        ((SPObjectClass *) tref_parent_class)->write(object, repr, flags);
    }

    return repr;
}


Generated by  Doxygen 1.6.0   Back to index