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

static gboolean set_doc_units ( SPUnitSelector *  ,
SPUnit const *  old,
SPUnit const *  new_units,
GObject *  dlg 
) [static]

Callback to set inkscape::document-units attribute from unit widget.

Definition at line 646 of file desktop-properties.cpp.

References SPDocument::rroot, sp_document_set_undo_sensitive(), and sp_repr_set_attr().

Referenced by sp_desktop_dialog().

{
    SPDesktop *dt = SP_ACTIVE_DESKTOP;

    if (!dt) {
        return FALSE;
    }

    SPDocument *doc = SP_DT_DOCUMENT(dt);

    Inkscape::XML::Node *repr = SP_OBJECT_REPR(SP_DT_NAMEDVIEW(dt));

    gboolean saved = sp_document_get_undo_sensitive(doc);
    sp_document_set_undo_sensitive(doc, FALSE);
    sp_repr_set_attr (repr, "inkscape:document-units", sp_unit_get_abbreviation (new_units));
    sp_repr_set_attr (doc->rroot, "sodipodi:modified", "true");
    sp_document_set_undo_sensitive(doc, saved);
    sp_document_done(doc);

    return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index