it wasn't such a good idea to let GimpConfig take care of the text when
2004-03-20 Sven Neumann <sven@gimp.org> * app/text/gimptextlayer.c: it wasn't such a good idea to let GimpConfig take care of the text when duplicating a text layer; it didn't create a copy. Do that manually again; fixes bug #137786.
This commit is contained in:

committed by
Sven Neumann

parent
584b3ceb9b
commit
7fdd4af69a
@ -1,3 +1,9 @@
|
|||||||
|
2004-03-20 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/text/gimptextlayer.c: it wasn't such a good idea to let
|
||||||
|
GimpConfig take care of the text when duplicating a text layer; it
|
||||||
|
didn't create a copy. Do that manually again; fixes bug #137786.
|
||||||
|
|
||||||
2004-03-20 Sven Neumann <sven@gimp.org>
|
2004-03-20 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimptexttool.c (gimp_text_tool_create_vectors): don't
|
* app/tools/gimptexttool.c (gimp_text_tool_create_vectors): don't
|
||||||
|
@ -58,7 +58,6 @@
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_TEXT,
|
|
||||||
PROP_AUTO_RENAME,
|
PROP_AUTO_RENAME,
|
||||||
PROP_MODIFIED
|
PROP_MODIFIED
|
||||||
};
|
};
|
||||||
@ -189,10 +188,6 @@ gimp_text_layer_class_init (GimpTextLayerClass *klass)
|
|||||||
drawable_class->set_tiles = gimp_text_layer_set_tiles;
|
drawable_class->set_tiles = gimp_text_layer_set_tiles;
|
||||||
drawable_class->swap_pixels = gimp_text_layer_swap_pixels;
|
drawable_class->swap_pixels = gimp_text_layer_swap_pixels;
|
||||||
|
|
||||||
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_TEXT,
|
|
||||||
"text", NULL,
|
|
||||||
GIMP_TYPE_TEXT,
|
|
||||||
0);
|
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTO_RENAME,
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTO_RENAME,
|
||||||
"auto-rename", NULL,
|
"auto-rename", NULL,
|
||||||
TRUE,
|
TRUE,
|
||||||
@ -234,9 +229,6 @@ gimp_text_layer_get_property (GObject *object,
|
|||||||
|
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_TEXT:
|
|
||||||
g_value_set_object (value, text_layer->text);
|
|
||||||
break;
|
|
||||||
case PROP_AUTO_RENAME:
|
case PROP_AUTO_RENAME:
|
||||||
g_value_set_boolean (value, text_layer->auto_rename);
|
g_value_set_boolean (value, text_layer->auto_rename);
|
||||||
break;
|
break;
|
||||||
@ -259,9 +251,6 @@ gimp_text_layer_set_property (GObject *object,
|
|||||||
|
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_TEXT:
|
|
||||||
gimp_text_layer_set_text (text_layer, g_value_get_object (value));
|
|
||||||
break;
|
|
||||||
case PROP_AUTO_RENAME:
|
case PROP_AUTO_RENAME:
|
||||||
text_layer->auto_rename = g_value_get_boolean (value);
|
text_layer->auto_rename = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@ -296,18 +285,31 @@ gimp_text_layer_duplicate (GimpItem *item,
|
|||||||
GType new_type,
|
GType new_type,
|
||||||
gboolean add_alpha)
|
gboolean add_alpha)
|
||||||
{
|
{
|
||||||
|
GimpTextLayer *layer;
|
||||||
GimpItem *new_item;
|
GimpItem *new_item;
|
||||||
|
|
||||||
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
|
g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_DRAWABLE), NULL);
|
||||||
|
|
||||||
new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item, new_type,
|
new_item = GIMP_ITEM_CLASS (parent_class)->duplicate (item,
|
||||||
|
new_type,
|
||||||
add_alpha);
|
add_alpha);
|
||||||
|
|
||||||
if (! GIMP_IS_TEXT_LAYER (new_item))
|
if (! GIMP_IS_TEXT_LAYER (new_item))
|
||||||
return new_item;
|
return new_item;
|
||||||
|
|
||||||
|
layer = GIMP_TEXT_LAYER (item);
|
||||||
|
|
||||||
gimp_config_sync (GIMP_CONFIG (item), GIMP_CONFIG (new_item), 0);
|
gimp_config_sync (GIMP_CONFIG (item), GIMP_CONFIG (new_item), 0);
|
||||||
|
|
||||||
|
if (layer->text)
|
||||||
|
{
|
||||||
|
GimpText *text = gimp_config_duplicate (GIMP_CONFIG (layer->text));
|
||||||
|
|
||||||
|
gimp_text_layer_set_text (GIMP_TEXT_LAYER (new_item), text);
|
||||||
|
|
||||||
|
g_object_unref (text);
|
||||||
|
}
|
||||||
|
|
||||||
return new_item;
|
return new_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,8 +463,6 @@ gimp_text_layer_set_text (GimpTextLayer *layer,
|
|||||||
layer, G_CONNECT_SWAPPED);
|
layer, G_CONNECT_SWAPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (layer), "text");
|
|
||||||
|
|
||||||
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer));
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user