Most of the members of struct xr_rendering, including the 'xr'
member, are used only for table items. In chart items, these
members are zeroed. But xr_rendering_apply_options() attempted to
use the 'xr' member even for chart items, which caused a crash.
This reverts and replaces the provisional fix already applied by
John Darrington in commit
ee7b576822f (Avoid crash rendering charts
in the gui interface.), which also fixed the crash but added extra
unnecessary work.
Reported-by: Nick Macdonald <nick@nickmacdonald.net>
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void
xr_rendering_apply_options (struct xr_rendering *xr, struct string_map *o)
{
- apply_options (xr->xr, o);
+ if (is_table_item (xr->item))
+ apply_options (xr->xr, o);
}
struct xr_rendering *
{
r = xzalloc (sizeof *r);
r->item = output_item_ref (item);
- r->xr = xr;
- xr_set_cairo (xr, cr);
}
return r;