diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index fc9115f24adadbacc7f3af3c1475df4cc962beb4..e682f394bb74c41029ce91c6aec088aa84c729ba 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
offset->sourceHref = NULL;
offset->sourceRepr = NULL;
offset->sourceObject = NULL;
+ new (&offset->_modified_connection) sigc::connection();
new (&offset->_delete_connection) sigc::connection();
new (&offset->_changed_connection) sigc::connection();
new (&offset->_transformed_connection) sigc::connection();
SPOffset *offset = (SPOffset *) obj;
delete offset->sourceRef;
+
+ offset->_modified_connection.disconnect();
+ offset->_modified_connection.~connection();
+ offset->_delete_connection.disconnect();
offset->_delete_connection.~connection();
+ offset->_changed_connection.disconnect();
offset->_changed_connection.~connection();
+ offset->_transformed_connection.disconnect();
offset->_transformed_connection.~connection();
}
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) {
}
// write that curve to "d"
- char *d = sp_svg_write_path (((SPShape *) offset)->curve->bpath);
+ char *d = sp_svg_write_path (SP_CURVE_BPATH(((SPShape *) offset)->curve));
repr->setAttribute("d", d);
g_free (d);
bpath = sp_svg_read_path (offset->original);
curve = sp_curve_new_from_bpath (bpath); // curve se chargera de detruire bpath
g_assert (curve != NULL);
- offset->originalPath = bpath_to_liv_path (curve->bpath);
+ offset->originalPath = bpath_to_liv_path (SP_CURVE_BPATH(curve));
sp_curve_unref (curve);
offset->knotSet = false;
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;
return;
}
- Path *finalPath = bpath_to_liv_path (curve->bpath);
+ Path *finalPath = bpath_to_liv_path (SP_CURVE_BPATH(curve));
if (finalPath == NULL)
{
sp_curve_unref (curve);
offset->_delete_connection = SP_OBJECT(to)->connectDelete(sigc::bind(sigc::ptr_fun(&sp_offset_delete_self), offset));
offset->_transformed_connection = SP_ITEM(to)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_offset_move_compensate), offset));
- offset->_modified_connection = g_signal_connect (G_OBJECT (to), "modified", G_CALLBACK (sp_offset_source_modified), offset);
+ offset->_modified_connection = SP_OBJECT(to)->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_offset_source_modified), offset));
}
static void sp_offset_quit_listening(SPOffset *offset)
if ( offset->sourceObject == NULL )
return;
- g_signal_handler_disconnect (offset->sourceObject, offset->_modified_connection);
+ offset->_modified_connection.disconnect();
offset->_delete_connection.disconnect();
offset->_transformed_connection.disconnect();
if (curve == NULL)
return;
}
- orig = bpath_to_liv_path (curve->bpath);
+ orig = bpath_to_liv_path (SP_CURVE_BPATH(curve));
sp_curve_unref (curve);