Code

Warning cleanup.
[inkscape.git] / src / sp-flowtext.cpp
index 83c13ca05bc00baf3814fd9c70eaa6c836b2748d..9280b604f9d04c7e839851a1fc1005b4a623ac4c 100644 (file)
@@ -352,7 +352,7 @@ sp_flowtext_print(SPItem *item, SPPrintContext *ctx)
     NRRect pbox;
     sp_item_invoke_bbox(item, &pbox, Geom::identity(), TRUE);
     NRRect bbox;
-    boost::optional<Geom::Rect> bbox_maybe = sp_item_bbox_desktop(item);
+    Geom::OptRect bbox_maybe = sp_item_bbox_desktop(item);
     if (!bbox_maybe) {
         return;
     }
@@ -577,6 +577,10 @@ SPFlowtext::getAsText()
                 sp_repr_set_svg_double(span_tspan, "x", anchor_point[Geom::X]);  // FIXME: this will pick up the wrong end of counter-directional runs
             if (set_y)
                 sp_repr_set_svg_double(span_tspan, "y", anchor_point[Geom::Y]);
+            if (line_tspan->childCount() == 0) {
+                sp_repr_set_svg_double(line_tspan, "x", anchor_point[Geom::X]);  // FIXME: this will pick up the wrong end of counter-directional runs
+                sp_repr_set_svg_double(line_tspan, "y", anchor_point[Geom::Y]);
+            }
 
             SPObject *source_obj = 0;
             void *rawptr = 0;
@@ -693,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]);
@@ -720,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;
 }