diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-12-12 08:40:34 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-12-12 08:40:34 +0000 |
| commit | aadfea4113abc6863d7ab03d21b973802c41c503 (patch) | |
| tree | 3f890c0c112433fd850d59558208addf1baa85da /src/rect-context.cpp | |
| parent | Pot and Dutch translation update (diff) | |
| parent | A simple layout document as to what, why and how is cppification. (diff) | |
| download | inkscape-aadfea4113abc6863d7ab03d21b973802c41c503.tar.gz inkscape-aadfea4113abc6863d7ab03d21b973802c41c503.zip | |
Merge and cleanup of GSoC C++-ification project.
(bzr r9945.1.1)
Diffstat (limited to 'src/rect-context.cpp')
| -rw-r--r-- | src/rect-context.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rect-context.cpp b/src/rect-context.cpp index 86f0b54a3..bcb1bf734 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -1,11 +1,11 @@ -#define __SP_RECT_CONTEXT_C__ - /* * Rectangle drawing context * * Author: * Lauris Kaplinski <lauris@kaplinski.com> * bulia byak <buliabyak@users.sf.net> + * Jon A. Cruz <jon@joncruz.org> + * Abhishek Sharma * * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl> * Copyright (C) 2000-2005 authors @@ -43,6 +43,8 @@ #include "context-fns.h" #include "shape-editor.h" +using Inkscape::DocumentUndo; + //static const double goldenratio = 1.61803398874989484820; // golden ratio static void sp_rect_context_class_init(SPRectContextClass *klass); @@ -466,16 +468,16 @@ static void sp_rect_drag(SPRectContext &rc, Geom::Point const pt, guint state) return; } - /* Create object */ - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&rc)); + // Create object + Inkscape::XML::Document *xml_doc = SP_EVENT_CONTEXT_DOCUMENT(&rc)->getReprDoc(); Inkscape::XML::Node *repr = xml_doc->createElement("svg:rect"); - /* Set style */ + // Set style sp_desktop_apply_style_tool (desktop, repr, "/tools/shapes/rect", false); rc.item = (SPItem *) desktop->currentLayer()->appendChildRepr(repr); Inkscape::GC::release(repr); - rc.item->transform = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse(); + rc.item->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse(); rc.item->updateRepr(); sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5); @@ -549,8 +551,8 @@ static void sp_rect_finish(SPRectContext *rc) sp_canvas_end_forced_full_redraws(desktop->canvas); sp_desktop_selection(desktop)->set(rc->item); - sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT, - _("Create rectangle")); + DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT, + _("Create rectangle")); rc->item = NULL; } @@ -575,7 +577,7 @@ static void sp_rect_cancel(SPRectContext *rc) sp_canvas_end_forced_full_redraws(desktop->canvas); - sp_document_cancel(sp_desktop_document(desktop)); + DocumentUndo::cancel(sp_desktop_document(desktop)); } |
