Code

Filter effects dialog:
[inkscape.git] / src / sp-offset.cpp
index 2253bf1e1170dd7b869304d8aa30da7b09667ebe..e682f394bb74c41029ce91c6aec088aa84c729ba 100644 (file)
@@ -262,7 +262,8 @@ sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
     SPOffset *offset = SP_OFFSET (object);
 
     if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-        repr = sp_repr_new ("svg:path");
+        Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(object)->document();
+        repr = xml_doc->createElement("svg:path");
     }
 
     if (flags & SP_OBJECT_WRITE_EXT) {
@@ -583,9 +584,9 @@ sp_offset_set_shape(SPShape *shape)
         theRes->ConvertToForme (orig, 1, originaux);
 
         SPItem *item = shape;
-        NR::Rect bbox = sp_item_bbox_desktop (item);
-        if (!bbox.isEmpty()) {
-            gdouble size = L2(bbox.dimensions());
+        NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop (item);
+        if ( bbox && !bbox->isEmpty() ) {
+            gdouble size = L2(bbox->dimensions());
             gdouble const exp = NR::expansion(item->transform);
             if (exp != 0)
                 size /= exp;