no need to memcpy() the arrays, they are properly copied by

2008-09-29  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcurve.c (gimp_curve_copy): no need to memcpy() the
	arrays, they are properly copied by gimp_config_sync() now. Add
	call to gimp_data_dirty() so GimpCurvesConfig gets notified.

	* app/gegl/gimpcurvesconfig.c (gimp_curves_config_set_property):
	use gimp_config_copy() instead of copying the curve menually.


svn path=/trunk/; revision=27076
This commit is contained in:
Michael Natterer 2008-09-29 12:33:58 +00:00 committed by Michael Natterer
parent a4ff76a5ac
commit 8938cca43f
3 changed files with 14 additions and 19 deletions

View File

@ -1,3 +1,12 @@
2008-09-29 Michael Natterer <mitch@gimp.org>
* app/core/gimpcurve.c (gimp_curve_copy): no need to memcpy() the
arrays, they are properly copied by gimp_config_sync() now. Add
call to gimp_data_dirty() so GimpCurvesConfig gets notified.
* app/gegl/gimpcurvesconfig.c (gimp_curves_config_set_property):
use gimp_config_copy() instead of copying the curve menually.
2008-09-29 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdialogfactory.c

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
@ -503,14 +502,11 @@ gimp_curve_copy (GimpConfig *src,
gimp_config_sync (G_OBJECT (src), G_OBJECT (dest), flags);
memcpy (dest_curve->points, src_curve->points,
sizeof (GimpVector2) * src_curve->n_points);
memcpy (dest_curve->samples, src_curve->samples,
sizeof (gdouble) * src_curve->n_samples);
dest_curve->identity = src_curve->identity;
return FALSE;
gimp_data_dirty (GIMP_DATA (dest));
return TRUE;
}

View File

@ -21,8 +21,6 @@
#include "config.h"
#include <string.h>
#include <gegl.h>
#include <glib/gstdio.h>
@ -207,14 +205,8 @@ gimp_curves_config_set_property (GObject *object,
if (src_curve && dest_curve)
{
gimp_config_sync (G_OBJECT (src_curve), G_OBJECT (dest_curve), 0);
memcpy (dest_curve->points, src_curve->points,
sizeof (GimpVector2) * src_curve->n_points);
memcpy (dest_curve->samples, src_curve->samples,
sizeof (gdouble) * src_curve->n_samples);
dest_curve->identity = src_curve->identity;
gimp_config_copy (GIMP_CONFIG (src_curve),
GIMP_CONFIG (dest_curve), 0);
}
}
break;
@ -340,8 +332,6 @@ gimp_curves_config_copy (GimpConfig *src,
flags);
}
g_object_notify (G_OBJECT (dest), "curve");
dest_config->channel = src_config->channel;
g_object_notify (G_OBJECT (dest), "channel");