Code

fix pasting style after copying a text span
[inkscape.git] / src / sp-flowtext.cpp
index e0f9b34729111ea5c170c6d9375c177a9cfbebf2..c6c0950146790700ce1b24d4f01322e425d9768e 100644 (file)
@@ -416,7 +416,7 @@ void SPFlowtext::_buildLayoutInput(SPObject *root, Shape const *exclusion_shape,
     if (SP_IS_FLOWPARA(root)) {
         // emulate par-indent with the first char's kern
         SPObject *t = root;
-        for ( ; t != NULL && !SP_IS_FLOWTEXT(t); t = SP_OBJECT_PARENT(t));
+        for ( ; t != NULL && !SP_IS_FLOWTEXT(t); t = SP_OBJECT_PARENT(t)){};
         if (SP_IS_FLOWTEXT(t)) {
             double indent = SP_FLOWTEXT(t)->par_indent;
             if (indent != 0) {
@@ -697,8 +697,8 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0,
 
     SPObject *rect = doc->getObjectByRepr(rect_repr);
 
-    p0 = sp_desktop_dt2root_xy_point(desktop, p0);
-    p1 = sp_desktop_dt2root_xy_point(desktop, p1);
+    p0 = sp_desktop_dt2doc_xy_point(desktop, p0);
+    p1 = sp_desktop_dt2doc_xy_point(desktop, p1);
     using Geom::X;
     using Geom::Y;
     Geom::Coord const x0 = MIN(p0[X], p1[X]);
@@ -724,6 +724,8 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0,
     Inkscape::GC::release(para_repr);
     Inkscape::GC::release(rect_repr);
 
+    ft_item->transform = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse();
+
     return ft_item;
 }