From 8867de5daf309e4cdd3fce177b408618490be4f3 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 29 Jun 2010 23:35:42 +0530 Subject: This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options]. (bzr r9546.1.1) --- src/dialogs/spellcheck.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dialogs/spellcheck.cpp') diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp index 1645218c6..24890f8eb 100644 --- a/src/dialogs/spellcheck.cpp +++ b/src/dialogs/spellcheck.cpp @@ -236,8 +236,8 @@ gint compare_text_bboxes (gconstpointer a, gconstpointer b) SPItem *i1 = SP_ITEM(a); SPItem *i2 = SP_ITEM(b); - Geom::OptRect bbox1 = i1->getBounds(sp_item_i2d_affine(i1)); - Geom::OptRect bbox2 = i2->getBounds(sp_item_i2d_affine(i2)); + Geom::OptRect bbox1 = i1->getBounds(i1->i2d_affine()); + Geom::OptRect bbox2 = i2->getBounds(i2->i2d_affine()); if (!bbox1 || !bbox2) { return 0; } @@ -570,7 +570,7 @@ spellcheck_next_word() // draw rect std::vector points = - _layout->createSelectionShape(_begin_w, _end_w, sp_item_i2d_affine(_text)); + _layout->createSelectionShape(_begin_w, _end_w, _text->i2d_affine()); Geom::Point tl, br; tl = br = points.front(); for (unsigned i = 0 ; i < points.size() ; i ++) { -- cgit v1.2.3 From d25a9a072143eafa4a9823b84e977c4b85d45efe Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Fri, 2 Jul 2010 18:05:42 +0530 Subject: New Class SPDocumentUndo created which takes care of c++fying some non SPDocument based methods (bzr r9546.1.3) --- src/dialogs/spellcheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dialogs/spellcheck.cpp') diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp index 24890f8eb..5372a8bb5 100644 --- a/src/dialogs/spellcheck.cpp +++ b/src/dialogs/spellcheck.cpp @@ -777,7 +777,7 @@ sp_spellcheck_accept (GObject *, GObject *dlg) // find the end of the word anew _end_w = _begin_w; _end_w.nextEndOfWord(); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_TEXT, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_TEXT, _("Fix spelling")); } } -- cgit v1.2.3 From 1aad26aea24f62b63c992118f36b12483f9a5414 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Sat, 3 Jul 2010 22:50:36 +0530 Subject: another c++ification for sp-object.h/cpp and still in progress... (bzr r9546.1.4) --- src/dialogs/spellcheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dialogs/spellcheck.cpp') diff --git a/src/dialogs/spellcheck.cpp b/src/dialogs/spellcheck.cpp index 5372a8bb5..f95dce0e6 100644 --- a/src/dialogs/spellcheck.cpp +++ b/src/dialogs/spellcheck.cpp @@ -203,7 +203,7 @@ all_text_items (SPObject *r, GSList *l, bool hidden, bool locked) if (!strcmp (SP_OBJECT_REPR (r)->name(), "svg:metadata")) return l; // we're not interested in metadata - for (SPObject *child = sp_object_first_child(r); child; child = SP_OBJECT_NEXT (child)) { + for (SPObject *child = r->first_child(); child; child = SP_OBJECT_NEXT (child)) { if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !_desktop->isLayer(SP_ITEM(child))) { if ((hidden || !_desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) { if (SP_IS_TEXT(child) || SP_IS_FLOWTEXT(child)) -- cgit v1.2.3