mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
Minor optimization
No need to get the cursor position twice in a row.
This commit is contained in:
parent
262e59869f
commit
2358be732d
@ -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,
|
|||||||
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user