From 69cea38f41b411ca9e55db365cf94339f4be891c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 26 Apr 2016 12:14:56 +0100 Subject: update scrollbar_create error handling to return nserror --- desktop/textarea.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'desktop/textarea.c') diff --git a/desktop/textarea.c b/desktop/textarea.c index 4a7e008bc..467965d39 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1029,10 +1029,11 @@ static bool textarea_reflow_multiline(struct textarea *ta, if (x > avail_width && ta->bar_x == NULL) { /* We need to insert a horizontal scrollbar */ int w = ta->vis_width - 2 * ta->border_width; - if (!scrollbar_create(true, w, w, w, + if (scrollbar_create(true, w, w, w, ta, textarea_scrollbar_callback, - &(ta->bar_x))) + &(ta->bar_x)) != NSERROR_OK) { return false; + } if (ta->bar_y != NULL) scrollbar_make_pair(ta->bar_x, ta->bar_y); @@ -1120,10 +1121,11 @@ static bool textarea_reflow_multiline(struct textarea *ta, if (line > scroll_lines && ta->bar_y == NULL) { /* Add vertical scrollbar */ int h = ta->vis_height - 2 * ta->border_width; - if (!scrollbar_create(false, h, h, h, - ta, textarea_scrollbar_callback, - &(ta->bar_y))) + if (scrollbar_create(false, h, h, h, + ta, textarea_scrollbar_callback, + &(ta->bar_y)) != NSERROR_OK) { return false; + } if (ta->bar_x != NULL) scrollbar_make_pair(ta->bar_x, ta->bar_y); -- cgit v1.2.3