From: Ben Pfaff <blp@cs.stanford.edu>
Date: Wed, 4 Sep 2013 04:52:19 +0000 (-0700)
Subject: psppire-var-sheet: Generalize get_var_align_stock_id().
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09958cbfa4c56ab8b3d7d2685d22fd55a1a4a30d;p=pspp

psppire-var-sheet: Generalize get_var_align_stock_id().

This change allows finding a stock-id speculatively, without having a
variable on hand.
---

diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c
index 837d112580..b52d420262 100644
--- a/src/ui/gui/psppire-var-sheet.c
+++ b/src/ui/gui/psppire-var-sheet.c
@@ -310,9 +310,9 @@ render_popup_cell (PsppSheetViewColumn *tree_column,
 }
 
 const char *
-get_var_align_stock_id (const struct variable *var)
+get_var_align_stock_id (enum alignment alignment)
 {
-  switch (var_get_alignment (var))
+  switch (alignment)
     {
     case ALIGN_LEFT:
       return GTK_STOCK_JUSTIFY_LEFT;
@@ -454,7 +454,8 @@ render_var_cell (PsppSheetViewColumn *tree_column,
                       "editable", TRUE,
                       NULL);
       else
-        g_object_set (cell, "stock-id", get_var_align_stock_id (var), NULL);
+        g_object_set (cell, "stock-id",
+                      get_var_align_stock_id (var_get_alignment (var)), NULL);
       break;
 
     case VS_MEASURE: