cairo: Minor cleanup by factoring out new function set_source_rgba().
[pspp] / src / output / table-casereader.c
index fa7498c849ac4dd4daced36a956ffc725362d078..e1b75ac5da28564684e1dca3f9ac0d53c24e2df1 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2011, 2013, 2014 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
@@ -38,7 +38,7 @@ static const struct table_class table_casereader_class;
 static struct table_casereader *
 table_casereader_cast (const struct table *table)
 {
-  assert (table->class == &table_casereader_class);
+  assert (table->klass == &table_casereader_class);
   return UP_CAST (table, struct table_casereader, table);
 }
 
@@ -106,17 +106,24 @@ table_casereader_get_cell (const struct table *t, int x, int y,
   struct ccase *c;
   char *s;
 
+  static const struct area_style style = {
+    AREA_STYLE_INITIALIZER__,
+    .cell_style.halign = TABLE_HALIGN_RIGHT
+  };
+
   cell->d[TABLE_HORZ][0] = x;
   cell->d[TABLE_HORZ][1] = x + 1;
   cell->d[TABLE_VERT][0] = y;
   cell->d[TABLE_VERT][1] = y + 1;
-  cell->options = TAB_RIGHT;
+  cell->style = &style;
+  cell->options = 0;
+  cell->n_footnotes = 0;
   if (tc->heading != NULL)
     {
       if (y == 0)
         {
           s = xstrdup (tc->heading);
-          cell->contents = s;
+          cell->text = s;
           cell->destructor = free_string;
           cell->destructor_aux = s;
           return;
@@ -132,17 +139,21 @@ table_casereader_get_cell (const struct table *t, int x, int y,
       s = data_out (case_data_idx (c, 0), UTF8, &tc->format);
       case_unref (c);
     }
-  cell->contents = s;
+  cell->text = s;
   cell->destructor = free_string;
   cell->destructor_aux = s;
 }
 
 static int
 table_casereader_get_rule (const struct table *t, enum table_axis axis,
-                           int x UNUSED, int y)
+                           int x UNUSED, int y,
+                           struct cell_color *color UNUSED)
 {
   struct table_casereader *tc = table_casereader_cast (t);
-  return axis == TABLE_VERT && tc->heading != NULL && y == 1 ? TAL_1 : TAL_0;
+  if (axis == TABLE_VERT)
+    return tc->heading != NULL && y == 1 ? TAL_1 : TAL_0;
+  else
+    return TAL_0;
 }
 
 static const struct table_class table_casereader_class =