diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-12-15 16:19:28 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-12-15 16:19:28 +0000 |
| commit | 70201e92aa1e700d49279871f2b84082750b8ed8 (patch) | |
| tree | 1886fcdf8ad20d73b92bf4f4bfd3ab1406ba4c66 /src/sp-tref.cpp | |
| parent | Fix mask luminance calculation, so the coeffs add up to 1 (diff) | |
| parent | Win32 post-GSoC fixups. (diff) | |
| download | inkscape-70201e92aa1e700d49279871f2b84082750b8ed8.tar.gz inkscape-70201e92aa1e700d49279871f2b84082750b8ed8.zip | |
Merge from trunk (again)
(bzr r9508.1.72)
Diffstat (limited to 'src/sp-tref.cpp')
| -rw-r--r-- | src/sp-tref.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index af85bc58b..c206dac77 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -1,5 +1,3 @@ -#define __SP_TREF_CPP__ - /** \file * SVG <tref> implementation - All character data within the referenced * element, including character data enclosed within additional markup, @@ -10,6 +8,8 @@ /* * Authors: * Gail Banaszkiewicz <Gail.Banaszkiewicz@gmail.com> + * Jon A. Cruz <jon@joncruz.org> + * Abhishek Sharma * * Copyright (C) 2007 Gail Banaszkiewicz * @@ -153,12 +153,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" ); } /** @@ -358,7 +358,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(""); } @@ -387,7 +387,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; } @@ -506,8 +506,7 @@ sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, } -void -sp_tref_update_text(SPTRef *tref) +void sp_tref_update_text(SPTRef *tref) { if (tref) { // Get the character data that will be used with this tref @@ -515,20 +514,20 @@ 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; } // Create the node and SPString to be the tref's child - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(tref)); + Inkscape::XML::Document *xml_doc = SP_OBJECT_DOCUMENT(tref)->getReprDoc(); Inkscape::XML::Node *newStringRepr = xml_doc->createTextNode(charData.c_str()); 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); } @@ -585,7 +584,7 @@ sp_tref_convert_to_tspan(SPObject *obj) Inkscape::XML::Node *tref_parent = sp_repr_parent(tref_repr); SPDocument *document = SP_OBJECT(tref)->document; - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); + Inkscape::XML::Document *xml_doc = document->getReprDoc(); Inkscape::XML::Node *new_tspan_repr = xml_doc->createElement("svg:tspan"); @@ -632,7 +631,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->firstChild() ; child != NULL ; child = child->getNext() ) { sp_object_ref (SP_OBJECT (child), obj); l = g_slist_prepend (l, child); } |
