app: remove member text_tool->preedit_len
because it is always strlen(text_tool->preedit_string)
This commit is contained in:
parent
99b3af1cd2
commit
a8548fa7fd
3 changed files with 4 additions and 8 deletions
|
|
@ -88,7 +88,6 @@ gimp_text_tool_editor_init (GimpTextTool *text_tool)
|
|||
text_tool->needs_im_reset = FALSE;
|
||||
|
||||
text_tool->preedit_string = NULL;
|
||||
text_tool->preedit_len = 0;
|
||||
text_tool->preedit_cursor = 0;
|
||||
text_tool->overwrite_mode = FALSE;
|
||||
text_tool->x_pos = -1;
|
||||
|
|
@ -856,8 +855,6 @@ gimp_text_tool_preedit_changed_cb (GtkIMContext *context,
|
|||
&text_tool->preedit_string, NULL,
|
||||
&text_tool->preedit_cursor);
|
||||
|
||||
text_tool->preedit_len = strlen (text_tool->preedit_string);
|
||||
|
||||
/* FIXME: call gimp_text_tool_update_layout() here, and make sure
|
||||
* the preedit string is *only* honored for the display, and never
|
||||
* ends up on the text object
|
||||
|
|
|
|||
|
|
@ -908,8 +908,8 @@ gimp_text_tool_draw (GimpDrawTool *draw_tool)
|
|||
cursor_index = strlen (string);
|
||||
|
||||
/* TODO: make cursor position itself even inside preedits! */
|
||||
if (text_tool->preedit_len > 0)
|
||||
cursor_index += text_tool->preedit_len;
|
||||
if (text_tool->preedit_string)
|
||||
cursor_index += strlen (text_tool->preedit_string);
|
||||
|
||||
g_free (string);
|
||||
|
||||
|
|
@ -931,7 +931,7 @@ gimp_text_tool_draw (GimpDrawTool *draw_tool)
|
|||
overwrite_cursor,
|
||||
TRUE);
|
||||
|
||||
if (text_tool->preedit_string && text_tool->preedit_len > 0)
|
||||
if (text_tool->preedit_string)
|
||||
gimp_text_tool_draw_preedit (draw_tool, logical_off_x, logical_off_y);
|
||||
}
|
||||
}
|
||||
|
|
@ -960,7 +960,7 @@ gimp_text_tool_draw_preedit (GimpDrawTool *draw_tool,
|
|||
min = strlen (string);
|
||||
g_free (string);
|
||||
|
||||
max = min + text_tool->preedit_len;
|
||||
max = min + strlen (text_tool->preedit_string);
|
||||
|
||||
layout = gimp_text_layout_get_pango_layout (text_tool->layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ struct _GimpTextTool
|
|||
gboolean needs_im_reset;
|
||||
|
||||
gchar *preedit_string;
|
||||
gint preedit_len;
|
||||
gint preedit_cursor;
|
||||
|
||||
gboolean overwrite_mode;
|
||||
|
|
|
|||
Loading…
Reference in a new issue