Commit 2358be73 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Minor optimization

No need to get the cursor position twice in a row.
parent 262e5986
...@@ -598,7 +598,7 @@ gtk_entry_accessible_remove_selection (AtkText *text, ...@@ -598,7 +598,7 @@ gtk_entry_accessible_remove_selection (AtkText *text,
gint selection_num) gint selection_num)
{ {
GtkWidget *widget; GtkWidget *widget;
gint start, end, caret_pos; gint start, end;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL) if (widget == NULL)
...@@ -609,8 +609,7 @@ gtk_entry_accessible_remove_selection (AtkText *text, ...@@ -609,8 +609,7 @@ gtk_entry_accessible_remove_selection (AtkText *text,
if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end)) if (gtk_editable_get_selection_bounds (GTK_EDITABLE (widget), &start, &end))
{ {
caret_pos = gtk_editable_get_position (GTK_EDITABLE (widget)); gtk_editable_select_region (GTK_EDITABLE (widget), end, end);
gtk_editable_select_region (GTK_EDITABLE (widget), caret_pos, caret_pos);
return TRUE; return TRUE;
} }
else else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment