summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-05-17 23:20:35 +0100
committerAndy Williams <andy@andywilliams.me>2016-05-17 23:20:35 +0100
commita5e530fc627f65d71a1fc703573850e5945e02f0 (patch)
tree826564a1b4427844915c3eb4fc347664f3782530
parent769f5d8c96170b55f47563009f9422f75b029f1a (diff)
downloadefl-a5e530fc627f65d71a1fc703573850e5945e02f0.tar.gz
elm_code: Revert an optimisation to fix a crash
We made an assumption about the order lines were added. It wasn't true...
-rw-r--r--legacy/elm_code/src/lib/widget/elm_code_widget.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget.c b/legacy/elm_code/src/lib/widget/elm_code_widget.c
index 62b7f6c2b0..b591050cc4 100644
--- a/legacy/elm_code/src/lib/widget/elm_code_widget.c
+++ b/legacy/elm_code/src/lib/widget/elm_code_widget.c
@@ -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;