Code

widgets/select-toolbar.h: Supply missing #includes/declarations so that we don't...
[inkscape.git] / src / text-chemistry.cpp
index ef5bd90bf3a48efb2facdb28edfad890f1bd4af5..9cce92ef8ca4400f7a016282baf8148e61f9800c 100644 (file)
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+
+#include <cstring>
+#include <string>
+#include <glibmm/i18n.h>
+
 #include "libnr/nr-matrix-fns.h"
 #include "xml/repr.h"
-#include <glibmm/i18n.h>
 #include "sp-rect.h"
 #include "sp-textpath.h"
 #include "inkscape.h"
@@ -425,7 +429,7 @@ text_unflow ()
         rtext->setAttribute("style", SP_OBJECT_REPR(flowtext)->attribute("style")); // fixme: transfer style attrs too; and from descendants
 
         NRRect bbox;
-        sp_item_invoke_bbox(SP_ITEM(flowtext), &bbox, sp_item_i2doc_affine(SP_ITEM(flowtext)), TRUE);
+        sp_item_invoke_bbox(SP_ITEM(flowtext), &bbox, from_2geom(sp_item_i2doc_affine(SP_ITEM(flowtext))), TRUE);
         NR::Point xy(bbox.x0, bbox.y0);
         if (xy[NR::X] != 1e18 && xy[NR::Y] != 1e18) {
             sp_repr_set_svg_double(rtext, "x", xy[NR::X]);
@@ -504,7 +508,7 @@ flowtext_to_text()
         did = true;
 
         Inkscape::XML::Node *parent = SP_OBJECT_REPR(item)->parent();
-        parent->appendChild(repr);
+        parent->addChild(repr, SP_OBJECT_REPR(item));
 
         SPItem *new_item = (SPItem *) sp_desktop_document(desktop)->getObjectByRepr(repr);
         sp_item_write_transform(new_item, repr, item->transform);