From: pjrm Date: Thu, 17 May 2007 13:05:12 +0000 (+0000) Subject: Fix a couple of unannotated transactions causing g_warning from finish_incomplete_tra... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6d4172ee425290a0ed87d7c8199e77e3d35f1eff;p=inkscape.git Fix a couple of unannotated transactions causing g_warning from finish_incomplete_transaction. (Thanks to johanengelen for help with this.) --- diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 30c858dcc..8c626355d 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -223,16 +223,15 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, GridType gridtype) // first create the child xml node, then hook it to repr. This order is important, to not set off listeners to repr before the new node is complete. - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(sp_desktop_document(SP_ACTIVE_DESKTOP)); + SPDocument *current_document = sp_desktop_document(SP_ACTIVE_DESKTOP); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(current_document); Inkscape::XML::Node *newnode; newnode = xml_doc->createElement("inkscape:grid"); newnode->setAttribute("type", getSVGName(gridtype)); repr->appendChild(newnode); - // FIXME: add this to history? -// sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, -// _("Create new element node")); + sp_document_done(current_document, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid")); } /* diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 4a57c6bfc..33193bbba 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -564,6 +564,7 @@ DocumentProperties::onRemoveGrid() // 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")); } }