elm_code: Pass widget data to _elm_code_widget_fill_line

We already have this looked up in all callers, and the lookup is mind
smashingly heavy.  Just use what we have.

ref T6209

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7694
This commit is contained in:
Derek Foreman 2019-01-18 10:41:05 -06:00
parent ec910c5bb9
commit 014705c740
1 changed files with 6 additions and 9 deletions

View File

@ -385,7 +385,7 @@ _elm_code_widget_fill_selection(Elm_Code_Widget *widget, Elm_Code_Line *line, Ev
}
static void
_elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line)
_elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, Elm_Code_Line *line)
{
char *chr;
Eina_Unicode unichr;
@ -393,11 +393,9 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line)
int chrpos, gutter;
Evas_Object *grid;
Evas_Textgrid_Cell *cells;
Elm_Code_Widget_Data *pd;
EINA_SAFETY_ON_NULL_RETURN(line);
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
gutter = elm_obj_code_widget_text_left_gutter_width_get(widget);
if (eina_list_count(pd->grids) < line->number)
return;
@ -409,7 +407,6 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line)
length = elm_code_widget_line_text_column_width_get(widget, line);
chrpos = 0;
chr = (char *)elm_code_line_text_get(line, NULL);
for (x = gutter; x < (unsigned int) w && x < length + gutter; x+=charwidth)
{
unichr = eina_unicode_utf8_next_get(chr, &chrpos);
@ -477,7 +474,7 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd,
unsigned int y;
if (newline)
_elm_code_widget_fill_line(widget, newline);
_elm_code_widget_fill_line(widget, pd, newline);
// if called from new line cb, no need to update whole range unless visible
if (newline && !elm_obj_code_widget_line_visible_get(widget, newline))
@ -491,7 +488,7 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd,
line = elm_code_file_line_get(pd->code->file, y);
if (line)
_elm_code_widget_fill_line(widget, line);
_elm_code_widget_fill_line(widget, pd, line);
}
if (pd->selection)
@ -714,7 +711,7 @@ _elm_code_widget_cursor_move(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd,
if (oldrow != pd->cursor_line)
_elm_code_widget_refresh(widget, line_obj);
else
_elm_code_widget_fill_line(widget, elm_code_file_line_get(pd->code->file, pd->cursor_line));
_elm_code_widget_fill_line(widget, pd, elm_code_file_line_get(pd->code->file, pd->cursor_line));
elm_layout_signal_emit(pd->cursor_rect, "elm,action,show,cursor", "elm");
}
@ -2080,9 +2077,9 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
}
EOAPI void
_elm_code_widget_line_refresh(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSED, Elm_Code_Line *line)
_elm_code_widget_line_refresh(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code_Line *line)
{
_elm_code_widget_fill_line(obj, line);
_elm_code_widget_fill_line(obj, pd, line);
}
EOAPI Eina_Bool