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/sp-tref.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-tref.cpp') diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 83f9ecfa6..382b55740 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -359,7 +359,7 @@ sp_tref_description(SPItem *item) char *child_desc; if (SP_IS_ITEM(referred)) { - child_desc = sp_item_description(SP_ITEM(referred)); + child_desc = SP_ITEM(referred)->description(); } else { child_desc = g_strdup(""); } -- 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/sp-tref.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sp-tref.cpp') diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 382b55740..850ebbd42 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -388,7 +388,7 @@ sp_tref_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTRef *tref) tref->_delete_connection.disconnect(); if (tref->stringChild) { - sp_object_detach(SP_OBJECT(tref), tref->stringChild); + SP_OBJECT(tref)->detach(tref->stringChild); tref->stringChild = NULL; } @@ -516,7 +516,7 @@ sp_tref_update_text(SPTRef *tref) build_string_from_root(SP_OBJECT_REPR(tref->getObjectReferredTo()), &charData); if (tref->stringChild) { - sp_object_detach(SP_OBJECT(tref), tref->stringChild); + SP_OBJECT(tref)->detach(tref->stringChild); tref->stringChild = NULL; } @@ -527,9 +527,9 @@ sp_tref_update_text(SPTRef *tref) tref->stringChild = SP_OBJECT(g_object_new(sp_repr_type_lookup(newStringRepr), NULL)); // Add this SPString as a child of the tref - sp_object_attach(SP_OBJECT(tref), tref->stringChild, tref->lastChild()); + SP_OBJECT(tref)->attach(tref->stringChild, tref->lastChild()); sp_object_unref(tref->stringChild, NULL); - sp_object_invoke_build(tref->stringChild, SP_OBJECT(tref)->document, newStringRepr, TRUE); + (tref->stringChild)->invoke_build(SP_OBJECT(tref)->document, newStringRepr, TRUE); Inkscape::GC::release(newStringRepr); } @@ -633,7 +633,7 @@ sp_tref_convert_to_tspan(SPObject *obj) //////////////////// else { GSList *l = NULL; - for (SPObject *child = sp_object_first_child(obj) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { + for (SPObject *child = obj->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { sp_object_ref (SP_OBJECT (child), obj); l = g_slist_prepend (l, child); } -- cgit v1.2.3 From 6cc35b45eab6422a6b6f67d621aa259a0a73786f Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Mon, 12 Jul 2010 22:06:46 +0530 Subject: SPObject c++ification finalized along with the beginning of XML Privatisation tweaks (bzr r9546.1.6) --- src/sp-tref.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/sp-tref.cpp') diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 850ebbd42..ef9c89486 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -154,12 +154,12 @@ sp_tref_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) ((SPObjectClass *) tref_parent_class)->build(object, document, repr); } - sp_object_read_attr(object, "xlink:href"); - sp_object_read_attr(object, "x"); - sp_object_read_attr(object, "y"); - sp_object_read_attr(object, "dx"); - sp_object_read_attr(object, "dy"); - sp_object_read_attr(object, "rotate"); + object->readAttr( "xlink:href"); + object->readAttr( "x"); + object->readAttr( "y"); + object->readAttr( "dx"); + object->readAttr( "dy"); + object->readAttr( "rotate"); } /** -- cgit v1.2.3