Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / sp-tref.cpp
index ef9c8948609bdb3686638c50fa4a85614fbbff2b..eddcd270c482a79be553201b5d7a21f5d9840833 100644 (file)
@@ -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
  *
@@ -154,12 +154,12 @@ sp_tref_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
         ((SPObjectClass *) tref_parent_class)->build(object, document, repr);
     }
 
-    object->readAttr( "xlink:href");
-    object->readAttr( "x");
-    object->readAttr( "y");
-    object->readAttr( "dx");
-    object->readAttr( "dy");
-    object->readAttr( "rotate");
+    object->readAttr( "xlink:href" );
+    object->readAttr( "x" );
+    object->readAttr( "y" );
+    object->readAttr( "dx" );
+    object->readAttr( "dy" );
+    object->readAttr( "rotate" );
 }
 
 /**
@@ -507,8 +507,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
@@ -521,7 +520,7 @@ sp_tref_update_text(SPTRef *tref)
         }
 
         // 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));
@@ -586,7 +585,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");
 
@@ -633,7 +632,7 @@ sp_tref_convert_to_tspan(SPObject *obj)
     ////////////////////
     else {
         GSList *l = NULL;
-        for (SPObject *child = obj->first_child() ; 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);
         }
@@ -663,4 +662,4 @@ sp_tref_convert_to_tspan(SPObject *obj)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :