diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index e682f394bb74c41029ce91c6aec088aa84c729ba..d3711a9f6d01e26d60c1d7de3643e3a8a4e9df47 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
# include "config.h"
#endif
+#include <cstring>
+#include <string>
#include "svg/svg.h"
#include "attributes.h"
static void sp_offset_build (SPObject * object, SPDocument * document,
Inkscape::XML::Node * repr);
-static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Node * repr,
+static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Document *doc, Inkscape::XML::Node * repr,
guint flags);
static void sp_offset_set (SPObject * object, unsigned int key,
const gchar * value);
static void sp_offset_snappoints(SPItem const *item, SnapPointsIter p);
static void sp_offset_set_shape (SPShape * shape);
-Path *bpath_to_liv_path (NArtBpath * bpath);
+Path *bpath_to_liv_path (NArtBpath const * bpath);
static void refresh_offset_source(SPOffset* offset);
@@ -257,12 +259,11 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
* Virtual write: write offset attributes to corresponding repr.
*/
static Inkscape::XML::Node *
-sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_offset_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPOffset *offset = SP_OFFSET (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(object)->document();
repr = xml_doc->createElement("svg:path");
}
}
// write that curve to "d"
- char *d = sp_svg_write_path (SP_CURVE_BPATH(((SPShape *) offset)->curve));
+ char *d = sp_svg_write_path (((SPShape *) offset)->curve->get_pathvector());
repr->setAttribute("d", d);
g_free (d);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr,
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr,
flags | SP_SHAPE_WRITE_PATH);
return repr;
offset->original = strdup (value);
bpath = sp_svg_read_path (offset->original);
- curve = sp_curve_new_from_bpath (bpath); // curve se chargera de detruire bpath
+ curve = SPCurve::new_from_bpath (bpath); // curve se chargera de detruire bpath
g_assert (curve != NULL);
offset->originalPath = bpath_to_liv_path (SP_CURVE_BPATH(curve));
- sp_curve_unref (curve);
+ curve->unref();
offset->knotSet = false;
if ( offset->isUpdating == false ) object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
* livarot Path. Duplicate of splivarot.
*/
Path *
-bpath_to_liv_path(NArtBpath *bpath)
+bpath_to_liv_path(NArtBpath const *bpath)
{
if (bpath == NULL)
return NULL;
const char *res_d = SP_OBJECT(shape)->repr->attribute("inkscape:original");
if ( res_d ) {
NArtBpath *bpath = sp_svg_read_path (res_d);
- SPCurve *c = sp_curve_new_from_bpath (bpath);
+ SPCurve *c = SPCurve::new_from_bpath (bpath);
g_assert(c != NULL);
sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
- sp_curve_unref (c);
+ c->unref();
}
return;
}
delete orig;
NArtBpath *bpath = sp_svg_read_path (res_d);
- SPCurve *c = sp_curve_new_from_bpath (bpath);
+ SPCurve *c = SPCurve::new_from_bpath (bpath);
g_assert(c != NULL);
sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
- sp_curve_unref (c);
+ c->unref();
free (res_d);
}
Path *finalPath = bpath_to_liv_path (SP_CURVE_BPATH(curve));
if (finalPath == NULL)
{
- sp_curve_unref (curve);
+ curve->unref();
return;
}
delete theShape;
delete finalPath;
- sp_curve_unref (curve);
+ curve->unref();
}
// the listening functions
@@ -1094,7 +1095,7 @@ sp_offset_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPOffset *offse
}
static void
-sp_offset_move_compensate(NR::Matrix const *mp, SPItem *original, SPOffset *self)
+sp_offset_move_compensate(NR::Matrix const *mp, SPItem */*original*/, SPOffset *self)
{
guint mode = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_PARALLEL);
if (mode == SP_CLONE_COMPENSATION_NONE) return;
}
static void
-sp_offset_source_modified (SPObject *iSource, guint flags, SPItem *item)
+sp_offset_source_modified (SPObject */*iSource*/, guint /*flags*/, SPItem *item)
{
SPOffset *offset = SP_OFFSET(item);
offset->sourceDirty=true;
return;
}
orig = bpath_to_liv_path (SP_CURVE_BPATH(curve));
- sp_curve_unref (curve);
+ curve->unref();
// Finish up.