diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/color.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/object-attributes.cpp | 30 | ||||
| -rw-r--r-- | src/widgets/sp-attribute-widget.cpp | 57 |
3 files changed, 32 insertions, 57 deletions
diff --git a/src/color.cpp b/src/color.cpp index ab01ebc2a..ca5d50f14 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -183,8 +183,6 @@ guint32 SPColor::toRGBA32( gdouble alpha ) const std::string SPColor::toString() const { CSSOStringStream css; - - std::string result; char tmp[64] = {0}; sp_svg_write_color(tmp, sizeof(tmp), toRGBA32(0x0ff)); diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp index 043454dc8..f83d3ef1f 100644 --- a/src/dialogs/object-attributes.cpp +++ b/src/dialogs/object-attributes.cpp @@ -66,16 +66,14 @@ static const SPAttrDesc image_nohref_desc[] = { }; -static void -object_released( SPObject */*object*/, GtkWidget *widget ) +static void object_released( SPObject */*object*/, GtkWidget *widget ) { gtk_widget_destroy (widget); } -static void -window_destroyed( GtkObject *window, GtkObject */*object*/ ) +static void window_destroyed( GtkObject *window, GtkObject */*object*/ ) { sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection"); release_connection->disconnect(); @@ -84,21 +82,20 @@ window_destroyed( GtkObject *window, GtkObject */*object*/ ) -static void -sp_object_attr_show_dialog ( SPObject *object, +static void sp_object_attr_show_dialog ( SPObject *object, const SPAttrDesc *desc, const gchar *tag ) { const gchar **labels, **attrs; gint len, i; - gchar *title; + Glib::ustring title; GtkWidget *w, *t; len = 0; while (desc[len].label) len += 1; - labels = (const gchar **)alloca (len * sizeof (char *)); - attrs = (const gchar **)alloca (len * sizeof (char *)); + labels = (const gchar **) new gchar* [len]; + attrs = (const gchar **) new gchar* [len]; for (i = 0; i < len; i++) { labels[i] = desc[i].label; @@ -106,19 +103,20 @@ sp_object_attr_show_dialog ( SPObject *object, } if (!strcmp (tag, "Link")) { - title = g_strdup_printf (_("Link Properties")); + title = _("Link Properties"); } else if (!strcmp (tag, "Image")) { - title = g_strdup_printf (_("Image Properties")); + title = _("Image Properties"); } else { - title = g_strdup_printf (_("%s Properties"), tag); + title = Glib::ustring::compose(_("%1 Properties"), tag); } - w = sp_window_new (title, TRUE); - g_free (title); + w = sp_window_new (title.c_str(), TRUE); t = sp_attribute_table_new (object, len, labels, attrs); gtk_widget_show (t); gtk_container_add (GTK_CONTAINER (w), t); + delete labels; + delete attrs; g_signal_connect ( G_OBJECT (w), "destroy", G_CALLBACK (window_destroyed), object ); @@ -128,13 +126,11 @@ sp_object_attr_show_dialog ( SPObject *object, g_object_set_data(G_OBJECT(w), "release_connection", release_connection); gtk_widget_show (w); - } // end of sp_object_attr_show_dialog() -void -sp_object_attributes_dialog (SPObject *object, const gchar *tag) +void sp_object_attributes_dialog (SPObject *object, const gchar *tag) { g_return_if_fail (object != NULL); g_return_if_fail (SP_IS_OBJECT (object)); diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp index b8ac50092..f3bdc062d 100644 --- a/src/widgets/sp-attribute-widget.cpp +++ b/src/widgets/sp-attribute-widget.cpp @@ -60,8 +60,7 @@ GType sp_attribute_widget_get_type(void) -static void -sp_attribute_widget_class_init (SPAttributeWidgetClass *klass) +static void sp_attribute_widget_class_init (SPAttributeWidgetClass *klass) { GtkObjectClass *object_class; GtkEditableClass *editable_class; @@ -79,8 +78,7 @@ sp_attribute_widget_class_init (SPAttributeWidgetClass *klass) -static void -sp_attribute_widget_init (SPAttributeWidget *spaw) +static void sp_attribute_widget_init (SPAttributeWidget *spaw) { spaw->blocked = FALSE; spaw->hasobj = FALSE; @@ -95,8 +93,7 @@ sp_attribute_widget_init (SPAttributeWidget *spaw) -static void -sp_attribute_widget_destroy (GtkObject *object) +static void sp_attribute_widget_destroy (GtkObject *object) { SPAttributeWidget *spaw; @@ -132,8 +129,7 @@ sp_attribute_widget_destroy (GtkObject *object) -static void -sp_attribute_widget_changed (GtkEditable *editable) +static void sp_attribute_widget_changed (GtkEditable *editable) { SPAttributeWidget *spaw; @@ -164,8 +160,7 @@ sp_attribute_widget_changed (GtkEditable *editable) -GtkWidget * -sp_attribute_widget_new ( SPObject *object, const gchar *attribute ) +GtkWidget *sp_attribute_widget_new ( SPObject *object, const gchar *attribute ) { SPAttributeWidget *spaw; @@ -182,8 +177,7 @@ sp_attribute_widget_new ( SPObject *object, const gchar *attribute ) -GtkWidget * -sp_attribute_widget_new_repr ( Inkscape::XML::Node *repr, const gchar *attribute ) +GtkWidget *sp_attribute_widget_new_repr ( Inkscape::XML::Node *repr, const gchar *attribute ) { SPAttributeWidget *spaw; @@ -196,8 +190,7 @@ sp_attribute_widget_new_repr ( Inkscape::XML::Node *repr, const gchar *attribute -void -sp_attribute_widget_set_object ( SPAttributeWidget *spaw, +void sp_attribute_widget_set_object ( SPAttributeWidget *spaw, SPObject *object, const gchar *attribute ) { @@ -251,8 +244,7 @@ sp_attribute_widget_set_object ( SPAttributeWidget *spaw, -void -sp_attribute_widget_set_repr ( SPAttributeWidget *spaw, +void sp_attribute_widget_set_repr ( SPAttributeWidget *spaw, Inkscape::XML::Node *repr, const gchar *attribute ) { @@ -300,8 +292,7 @@ sp_attribute_widget_set_repr ( SPAttributeWidget *spaw, -static void -sp_attribute_widget_object_modified ( SPObject */*object*/, +static void sp_attribute_widget_object_modified ( SPObject */*object*/, guint flags, SPAttributeWidget *spaw ) { @@ -377,8 +368,7 @@ GType sp_attribute_table_get_type(void) -static void -sp_attribute_table_class_init (SPAttributeTableClass *klass) +static void sp_attribute_table_class_init (SPAttributeTableClass *klass) { GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); @@ -390,8 +380,7 @@ sp_attribute_table_class_init (SPAttributeTableClass *klass) -static void -sp_attribute_table_init ( SPAttributeTable *spat ) +static void sp_attribute_table_init ( SPAttributeTable *spat ) { spat->blocked = FALSE; spat->hasobj = FALSE; @@ -405,8 +394,7 @@ sp_attribute_table_init ( SPAttributeTable *spat ) new (&spat->release_connection) sigc::connection(); } -static void -sp_attribute_table_destroy ( GtkObject *object ) +static void sp_attribute_table_destroy ( GtkObject *object ) { SPAttributeTable *spat; @@ -451,8 +439,7 @@ sp_attribute_table_destroy ( GtkObject *object ) } // end of sp_attribute_table_destroy() -GtkWidget * -sp_attribute_table_new ( SPObject *object, +GtkWidget * sp_attribute_table_new ( SPObject *object, gint num_attr, const gchar **labels, const gchar **attributes ) @@ -473,8 +460,7 @@ sp_attribute_table_new ( SPObject *object, -GtkWidget * -sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, +GtkWidget *sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, gint num_attr, const gchar **labels, const gchar **attributes ) @@ -496,8 +482,7 @@ sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, #define XPAD 4 #define YPAD 0 -void -sp_attribute_table_set_object ( SPAttributeTable *spat, +void sp_attribute_table_set_object ( SPAttributeTable *spat, SPObject *object, gint num_attr, const gchar **labels, @@ -600,8 +585,7 @@ sp_attribute_table_set_object ( SPAttributeTable *spat, -void -sp_attribute_table_set_repr ( SPAttributeTable *spat, +void sp_attribute_table_set_repr ( SPAttributeTable *spat, Inkscape::XML::Node *repr, gint num_attr, const gchar **labels, @@ -697,8 +681,7 @@ sp_attribute_table_set_repr ( SPAttributeTable *spat, -static void -sp_attribute_table_object_modified ( SPObject */*object*/, +static void sp_attribute_table_object_modified ( SPObject */*object*/, guint flags, SPAttributeTable *spat ) { @@ -725,16 +708,14 @@ sp_attribute_table_object_modified ( SPObject */*object*/, -static void -sp_attribute_table_object_release (SPObject */*object*/, SPAttributeTable *spat) +static void sp_attribute_table_object_release (SPObject */*object*/, SPAttributeTable *spat) { sp_attribute_table_set_object (spat, NULL, 0, NULL, NULL); } -static void -sp_attribute_table_entry_changed ( GtkEditable *editable, +static void sp_attribute_table_entry_changed ( GtkEditable *editable, SPAttributeTable *spat ) { if (!spat->blocked) |
