2007-10-01 Neil J. Patel <njp@o-hand.com>
Patch by: Tommi Komulainen <tommi.komulainen@iki.fi> * clutter/clutter-entry.c: (clutter_entry_delete_text): Fix characters vs. bytes inconsistency (#520).
This commit is contained in:
parent
956f6b6238
commit
b5b613000c
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-10-01 Neil J. Patel <njp@o-hand.com>
|
||||||
|
|
||||||
|
Patch by: Tommi Komulainen <tommi.komulainen@iki.fi>
|
||||||
|
|
||||||
|
* clutter/clutter-entry.c: (clutter_entry_delete_text):
|
||||||
|
Fix characters vs. bytes inconsistency (#520).
|
||||||
|
|
||||||
2007-09-30 Matthew Allum <mallum@openedhand.com>
|
2007-09-30 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
* clutter/clutter-event.h:
|
* clutter/clutter-event.h:
|
||||||
|
|
|
@ -1439,6 +1439,8 @@ clutter_entry_delete_text (ClutterEntry *entry,
|
||||||
{
|
{
|
||||||
ClutterEntryPrivate *priv;
|
ClutterEntryPrivate *priv;
|
||||||
GString *new = NULL;
|
GString *new = NULL;
|
||||||
|
gint start_bytes;
|
||||||
|
gint end_bytes;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ENTRY (entry));
|
g_return_if_fail (CLUTTER_IS_ENTRY (entry));
|
||||||
|
|
||||||
|
@ -1446,9 +1448,12 @@ clutter_entry_delete_text (ClutterEntry *entry,
|
||||||
|
|
||||||
if (!priv->text)
|
if (!priv->text)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
start_bytes = offset_to_bytes (priv->text, start_pos);
|
||||||
|
end_bytes = offset_to_bytes (priv->text, end_pos);
|
||||||
|
|
||||||
new = g_string_new (priv->text);
|
new = g_string_new (priv->text);
|
||||||
new = g_string_erase (new, start_pos, end_pos - start_pos);
|
new = g_string_erase (new, start_bytes, end_bytes - start_bytes);
|
||||||
|
|
||||||
clutter_entry_set_text (entry, new->str);
|
clutter_entry_set_text (entry, new->str);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue