summaryrefslogtreecommitdiffstats
path: root/src/sp-tspan.cpp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2007-01-24 04:49:08 +0000
committermental <mental@users.sourceforge.net>2007-01-24 04:49:08 +0000
commita0f84b15f8db78931a744e31da7f2f37db225ece (patch)
tree472e612d1f0c9fe50f27801f41e98ca0447b635d /src/sp-tspan.cpp
parentanother createElement instead of repr_new (diff)
downloadinkscape-a0f84b15f8db78931a744e31da7f2f37db225ece.tar.gz
inkscape-a0f84b15f8db78931a744e31da7f2f37db225ece.zip
more removal of sp_repr_new*
(bzr r2271)
Diffstat (limited to 'src/sp-tspan.cpp')
-rw-r--r--src/sp-tspan.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp
index 3b5780721..3339b2377 100644
--- a/src/sp-tspan.cpp
+++ b/src/sp-tspan.cpp
@@ -37,6 +37,7 @@
#include "style.h"
#include "libnr/nr-matrix-fns.h"
#include "xml/repr.h"
+#include "document.h"
/*#####################################################
@@ -226,9 +227,10 @@ static Inkscape::XML::Node *
sp_tspan_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
SPTSpan *tspan = SP_TSPAN(object);
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:tspan");
+ repr = xml_doc->createElement("svg:tspan");
}
tspan->attributes.writeTo(repr);
@@ -242,7 +244,7 @@ sp_tspan_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
} else if ( SP_IS_TEXTPATH(child) ) {
//c_repr = child->updateRepr(NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
- c_repr = sp_repr_new_text(SP_STRING(child)->string.c_str());
+ c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
if ( c_repr ) l = g_slist_prepend(l, c_repr);
}
@@ -390,7 +392,8 @@ sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
}
if ( no_content ) {
- Inkscape::XML::Node* rch = sp_repr_new_text("");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+ Inkscape::XML::Node* rch = xml_doc->createTextNode("");
repr->addChild(rch, NULL);
}
@@ -487,9 +490,10 @@ static Inkscape::XML::Node *
sp_textpath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
SPTextPath *textpath = SP_TEXTPATH(object);
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:textPath");
+ repr = xml_doc->createElement("svg:textPath");
}
textpath->attributes.writeTo(repr);
@@ -516,7 +520,7 @@ sp_textpath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
} else if ( SP_IS_TEXTPATH(child) ) {
//c_repr = child->updateRepr(NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
- c_repr = sp_repr_new_text(SP_STRING(child)->string.c_str());
+ c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
if ( c_repr ) l = g_slist_prepend(l, c_repr);
}