From: Jim Evins Date: Mon, 14 Oct 2002 01:55:58 +0000 (+0000) Subject: Now uses gl_label_object_copy_props() in dup function. X-Git-Tag: glabels-2_3_0~725 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=72888ff037ca8e1c0fea29b8f908a4bb69966976;p=glabels Now uses gl_label_object_copy_props() in dup function. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@162 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/label-barcode.c b/glabels2/src/label-barcode.c index b00e2dd8..6f738bb7 100644 --- a/glabels2/src/label-barcode.c +++ b/glabels2/src/label-barcode.c @@ -147,7 +147,6 @@ gl_label_barcode_dup (glLabelBarcode *lbc, { glLabelBarcode *new_lbc; glTextNode *text_node; - gdouble x, y, w, h; glBarcodeStyle style; gboolean text_flag; guint color; @@ -160,11 +159,7 @@ gl_label_barcode_dup (glLabelBarcode *lbc, new_lbc = GL_LABEL_BARCODE(gl_label_barcode_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(lbc), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(lbc), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_lbc), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_lbc), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_lbc), GL_LABEL_OBJECT(lbc)); text_node = gl_label_barcode_get_data (lbc); gl_label_barcode_get_props (lbc, &style, &text_flag, &color, &scale); diff --git a/glabels2/src/label-box.c b/glabels2/src/label-box.c index 6abc2312..9797cd97 100644 --- a/glabels2/src/label-box.c +++ b/glabels2/src/label-box.c @@ -134,7 +134,7 @@ gl_label_box_dup (glLabelBox *lbox, glLabel *label) { glLabelBox *new_lbox; - gdouble x, y, w, h, line_width; + gdouble line_width; guint line_color, fill_color; gl_debug (DEBUG_LABEL, "START"); @@ -144,11 +144,7 @@ gl_label_box_dup (glLabelBox *lbox, new_lbox = GL_LABEL_BOX(gl_label_box_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(lbox), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(lbox), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_lbox), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_lbox), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_lbox), GL_LABEL_OBJECT(lbox)); line_width = gl_label_box_get_line_width (lbox); line_color = gl_label_box_get_line_color (lbox); diff --git a/glabels2/src/label-ellipse.c b/glabels2/src/label-ellipse.c index 9a7ac46c..25d06c75 100644 --- a/glabels2/src/label-ellipse.c +++ b/glabels2/src/label-ellipse.c @@ -134,7 +134,7 @@ gl_label_ellipse_dup (glLabelEllipse *lellipse, glLabel *label) { glLabelEllipse *new_lellipse; - gdouble x, y, w, h, line_width; + gdouble line_width; guint line_color, fill_color; gl_debug (DEBUG_LABEL, "START"); @@ -144,11 +144,8 @@ gl_label_ellipse_dup (glLabelEllipse *lellipse, new_lellipse = GL_LABEL_ELLIPSE(gl_label_ellipse_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(lellipse), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(lellipse), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_lellipse), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_lellipse), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_lellipse), + GL_LABEL_OBJECT(lellipse)); line_width = gl_label_ellipse_get_line_width (lellipse); line_color = gl_label_ellipse_get_line_color (lellipse); diff --git a/glabels2/src/label-image.c b/glabels2/src/label-image.c index 552603f4..15b7a92e 100644 --- a/glabels2/src/label-image.c +++ b/glabels2/src/label-image.c @@ -139,7 +139,6 @@ gl_label_image_dup (glLabelImage *limage, glLabel *label) { glLabelImage *new_limage; - gdouble x, y, w, h; gchar *filename; gl_debug (DEBUG_LABEL, "START"); @@ -149,16 +148,10 @@ gl_label_image_dup (glLabelImage *limage, new_limage = GL_LABEL_IMAGE(gl_label_image_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(limage), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(limage), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_limage), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_limage), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_limage), GL_LABEL_OBJECT(limage)); filename = gl_label_image_get_filename (limage); - gl_label_image_set_filename (new_limage, filename); - g_free (filename); gl_debug (DEBUG_LABEL, "END"); diff --git a/glabels2/src/label-line.c b/glabels2/src/label-line.c index 9730b438..61b18ea5 100644 --- a/glabels2/src/label-line.c +++ b/glabels2/src/label-line.c @@ -133,8 +133,8 @@ gl_label_line_dup (glLabelLine *lline, glLabel *label) { glLabelLine *new_lline; - gdouble x, y, w, h, line_width; - guint line_color; + gdouble line_width; + guint line_color; gl_debug (DEBUG_LABEL, "START"); @@ -143,11 +143,7 @@ gl_label_line_dup (glLabelLine *lline, new_lline = GL_LABEL_LINE(gl_label_line_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(lline), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(lline), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_lline), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_lline), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_lline), GL_LABEL_OBJECT(lline)); line_width = gl_label_line_get_line_width (lline); line_color = gl_label_line_get_line_color (lline); diff --git a/glabels2/src/label-text.c b/glabels2/src/label-text.c index ded111da..72dfb655 100644 --- a/glabels2/src/label-text.c +++ b/glabels2/src/label-text.c @@ -161,7 +161,6 @@ gl_label_text_dup (glLabelText *ltext, glLabel *label) { glLabelText *new_ltext; - gdouble x, y, w, h; GList *lines; gchar *font_family; gdouble font_size; @@ -177,11 +176,7 @@ gl_label_text_dup (glLabelText *ltext, new_ltext = GL_LABEL_TEXT(gl_label_text_new (label)); - gl_label_object_get_position (GL_LABEL_OBJECT(ltext), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(ltext), &w, &h); - - gl_label_object_set_position (GL_LABEL_OBJECT(new_ltext), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(new_ltext), w, h); + gl_label_object_copy_props (GL_LABEL_OBJECT(new_ltext), GL_LABEL_OBJECT(ltext)); lines = gl_label_text_get_lines (ltext); gl_label_text_get_props (ltext,