Fix NULL ptr dereference in status bar rendering; formatting.

svn path=/trunk/netsurf/; revision=9883
This commit is contained in:
Adrian Lees 2010-01-24 12:49:29 +00:00
parent 17096ef891
commit e79df765b0
2 changed files with 24 additions and 25 deletions

View File

@ -458,8 +458,8 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
/* initialise the plotters */
plot = ro_plotters;
ro_plot_set_scale(1.0);
ro_plot_origin_x = 0;
ro_plot_origin_y = 0;
ro_plot_origin_x = 0;
ro_plot_origin_y = 0;
/* redraw the window */
error = xwimp_redraw_window(redraw, &more);
@ -469,8 +469,8 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
return;
}
while (more) {
/* redraw the status text */
if (sb->text) {
/* redraw the status text */
if (sb->text) {
error = xcolourtrans_set_font_colours(font_CURRENT,
0xeeeeee00, 0x00000000, 14, 0, 0, 0);
if (error) {
@ -499,7 +499,7 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw)
-redraw->box.y0 >> 1,
(redraw->box.x0 + sb->width - WIDGET_WIDTH) >> 1,
-redraw->box.y1 >> 1,
0x00000000);
plot_style_fill_black);
error = xwimp_get_rectangle(redraw, &more);
if (error) {

View File

@ -81,11 +81,10 @@ bool ro_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style
{
os_error *error;
if (style->fill_type != PLOT_OP_TYPE_NONE) {
if (style->fill_type != PLOT_OP_TYPE_NONE) {
error = xcolourtrans_set_gcol(style->fill_colour << 8,
colourtrans_USE_ECFS_GCOL,
os_ACTION_OVERWRITE, 0, 0);
colourtrans_USE_ECFS_GCOL,
os_ACTION_OVERWRITE, 0, 0);
if (error) {
LOG(("xcolourtrans_set_gcol: 0x%x: %s",
error->errnum, error->errmess));
@ -109,26 +108,26 @@ bool ro_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style
}
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
bool dotted = false;
bool dashed = false;
const int path[] = { draw_MOVE_TO,
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + (x1) * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + (x1) * 2) * 256,
(ro_plot_origin_y - (y1) * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - (y1) * 2 - 1) * 256,
draw_CLOSE_LINE,
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_END_PATH };
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + (x1) * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + (x1) * 2) * 256,
(ro_plot_origin_y - (y1) * 2 - 1) * 256,
draw_LINE_TO,
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - (y1) * 2 - 1) * 256,
draw_CLOSE_LINE,
(ro_plot_origin_x + x0 * 2) * 256,
(ro_plot_origin_y - y0 * 2 - 1) * 256,
draw_END_PATH };
if (style->stroke_type == PLOT_OP_TYPE_DOT)
dotted = true;