index 9bf2d761d2c9eb9278079365c17c7aa8012fe010..0817b06aba7418c8e5cb774cf6fcf2ed1fdd5f4c 100644 (file)
void
DocumentProperties::onNewGrid()
{
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
+ SPDesktop *dt = SP_ACTIVE_DESKTOP;
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
+ SPDocument *doc = sp_desktop_document(dt);
Glib::ustring typestring = _grids_combo_gridtype.get_active_text();
- CanvasGrid::writeNewGridToRepr(repr, CanvasGrid::getGridTypeFromName(typestring.c_str()));
+ CanvasGrid::writeNewGridToRepr(repr, doc, CanvasGrid::getGridTypeFromName(typestring.c_str()));
}
// delete the grid that corresponds with the selected tab
// when the grid is deleted from SVG, the SPNamedview handler automatically deletes the object, so found_grid becomes an invalid pointer!
found_grid->repr->parent()->removeChild(found_grid->repr);
- sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
+ sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
}
}