elm_code: Revert an optimisation to fix a crash

We made an assumption about the order lines were added.
It wasn't true...
This commit is contained in:
Andy Williams 2016-05-17 23:20:35 +01:00
parent 769f5d8c96
commit a5e530fc62
1 changed files with 1 additions and 13 deletions

View File

@ -1534,7 +1534,6 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
int w, h, cw, ch, gutter;
unsigned int line_width;
Elm_Code_Widget_Data *pd;
Eina_Bool neww = EINA_FALSE;
pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
gutter = elm_obj_code_widget_text_left_gutter_width_get(widget);
@ -1560,13 +1559,11 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
line_width = elm_code_widget_line_text_column_width_get(widget, line);
if ((int) line_width + gutter + 1 > w)
{
neww = EINA_TRUE;
w = (int) line_width + gutter + 1;
}
}
else
{
neww = EINA_TRUE;
EINA_LIST_FOREACH(pd->code->file->lines, item, line)
{
line_width = elm_code_widget_line_text_column_width_get(widget, line);
@ -1583,20 +1580,11 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
wh = h*ch;
pd->col_count = ww/cw + 1;
if (newline && !neww)
EINA_LIST_FOREACH(pd->grids, item, grid)
{
grid = eina_list_nth(pd->grids, newline->number - 1);
evas_object_textgrid_size_set(grid, pd->col_count, 1);
evas_object_size_hint_min_set(grid, w*cw, ch);
}
else
{
EINA_LIST_FOREACH(pd->grids, item, grid)
{
evas_object_textgrid_size_set(grid, pd->col_count, 1);
evas_object_size_hint_min_set(grid, w*cw, ch);
}
}
if (!newline) return;