output-item: Collapse the inheritance hierarchy into a single struct.
[pspp] / src / output / charts / scree-cairo.c
index a3ae10cd6287e5ecf384485b69f3c21d66985fd3..726e250856e219ebd56d50f9d4083ceaa6ed8be6 100644 (file)
 #define _(msgid) gettext (msgid)
 
 void
-xrchart_draw_scree (const struct chart_item *chart_item, cairo_t *cr,
+xrchart_draw_scree (const struct chart *chart, cairo_t *cr,
                     struct xrchart_geometry *geom)
 {
-  const struct scree *rc = to_scree (chart_item);
+  const struct scree *rc = to_scree (chart);
   size_t i;
   double min, max;
 
@@ -44,8 +44,10 @@ xrchart_draw_scree (const struct chart_item *chart_item, cairo_t *cr,
   else
     max = fabs (min);
 
-  xrchart_write_yscale (cr, geom, 0, max);
-  xrchart_write_xscale (cr, geom, 0, rc->eval->size + 1);
+  if (! xrchart_write_yscale (cr, geom, 0, max))
+    return;
+  if (! xrchart_write_xscale (cr, geom, 0, rc->eval->size + 1))
+    return;
 
   xrchart_vector_start (cr, geom, "");
   for (i = 0 ; i < rc->eval->size; ++i)