Code

Filter effects dialog:
[inkscape.git] / src / text-chemistry.cpp
index 0a655fdcb5e3620daeee1e69ff04dba10bc86871..4853258596d82d74c539e119585d06b964a0f728 100644 (file)
@@ -165,8 +165,8 @@ text_put_on_path()
     SP_OBJECT_REPR(text)->addChild(textpath, NULL);
 
     for ( GSList *i = text_reprs ; i ; i = i->next ) {
-        // make a copy of each text child
-        Inkscape::XML::Node *copy = ((Inkscape::XML::Node *) i->data)->duplicate();
+        // Make a copy of each text child
+        Inkscape::XML::Node *copy = ((Inkscape::XML::Node *) i->data)->duplicate(xml_doc);
         // We cannot have multiline in textpath, so remove line attrs from tspans
         if (!strcmp(copy->name(), "svg:tspan")) {
             copy->setAttribute("sodipodi:role", NULL);
@@ -346,7 +346,7 @@ text_flow_into_shape()
     } else { // reflow an already flowed text, preserving paras
         for (SPObject *o = SP_OBJECT(text)->children; o != NULL; o = o->next) {
             if (SP_IS_FLOWPARA(o)) {
-                Inkscape::XML::Node *para_repr = SP_OBJECT_REPR(o)->duplicate();
+                Inkscape::XML::Node *para_repr = SP_OBJECT_REPR(o)->duplicate(xml_doc);
                 root_repr->appendChild(para_repr);
                 object = doc->getObjectByRepr(para_repr);
                 g_return_if_fail(SP_IS_FLOWPARA(object));
@@ -397,6 +397,10 @@ text_unflow ()
 
         SPItem *flowtext = SP_ITEM(items->data);
 
+        if (sp_te_get_string_multiline(flowtext) == NULL) { // flowtext is empty
+            continue;
+        }
+
         /* Create <text> */
         Inkscape::XML::Node *rtext = xml_doc->createElement("svg:text");
         rtext->setAttribute("xml:space", "preserve"); // we preserve spaces in the text objects we create