From e0eba8f34f35b8295c3f353bc2d656ef09ee9d17 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 9 Dec 2000 23:46:51 +0000 Subject: Split the lines in this cell before testing whether we're to the right of 2000-12-09 Christopher James Lahey * e-cell-text.c (_blink_scroll_timeout): Split the lines in this cell before testing whether we're to the right of the right edge of the text data (since that test uses the split lines.) svn path=/trunk/; revision=6892 --- widgets/table/e-cell-text.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index e007bf6f5e..30899383f3 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1809,7 +1809,6 @@ _blink_scroll_timeout (gpointer data) ECellText *ect = E_CELL_TEXT (((ECellView *)text_view)->ecell); CellEdit *edit = text_view->edit; CurrentCell *cell = CURRENT_CELL(edit); - ECellTextLineBreaks *linebreaks = cell->breaks; gulong current_time; gboolean scroll = FALSE; @@ -1828,12 +1827,17 @@ _blink_scroll_timeout (gpointer data) } if (scroll && edit->button_down) { /* FIXME: Copy this for y. */ - if (edit->lastx - ect->x > cell->width && - edit->xofs_edit < linebreaks->max_width - cell->width) { - edit->xofs_edit += 4; - if (edit->xofs_edit > linebreaks->max_width - cell->width + 1) - edit->xofs_edit = linebreaks->max_width - cell->width + 1; - redraw = TRUE; + if (edit->lastx - ect->x > cell->width) { + ECellTextLineBreaks *linebreaks; + split_into_lines (cell); + linebreaks = cell->breaks; + if (edit->xofs_edit < linebreaks->max_width - cell->width) { + edit->xofs_edit += 4; + if (edit->xofs_edit > linebreaks->max_width - cell->width + 1) + edit->xofs_edit = linebreaks->max_width - cell->width + 1; + redraw = TRUE; + } + unref_lines (cell); } if (edit->lastx - ect->x < 0 && edit->xofs_edit > 0) { @@ -2380,7 +2384,7 @@ split_into_lines (CurrentCell *cell) gint len; char *text = cell->text; - ECellTextLineBreaks *linebreaks = cell->breaks; + ECellTextLineBreaks *linebreaks; if (! cell->breaks) { cell->breaks = g_new (ECellTextLineBreaks, 1); -- cgit v1.2.3