Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

void sp_object_attach ( SPObject parent,
SPObject object,
SPObject prev 
)

Put object into object tree, under parent, and behind prev; also update object's XML space.

Definition at line 615 of file sp-object.cpp.

References SPObject::_updateTotalHRefCount(), and sp_object_ref().

Referenced by sp_object_build(), and sp_object_child_added().

{
    g_return_if_fail(parent != NULL);
    g_return_if_fail(SP_IS_OBJECT(parent));
    g_return_if_fail(object != NULL);
    g_return_if_fail(SP_IS_OBJECT(object));
    g_return_if_fail(!prev || SP_IS_OBJECT(prev));
    g_return_if_fail(!prev || prev->parent == parent);
    g_return_if_fail(!object->parent);

    sp_object_ref(object, parent);
    object->parent = parent;
    parent->_updateTotalHRefCount(object->_total_hrefcount);

    SPObject *next;
    if (prev) {
        next = prev->next;
        prev->next = object;
    } else {
        next = parent->children;
        parent->children = object;
    }
    object->next = next;
    if (!next) {
        parent->_last_child = object;
    }
    if (!object->xml_space.set)
        object->xml_space.value = parent->xml_space.value;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index