Don't assume that ALIGN_* and GTK_JUSTIFY_* values coincide.
[pspp-builds.git] / src / ui / gui / psppire-data-store.c
index 840c4c832574eb11d3db0efc2646cd1009eb2142..c761c237edc3422726d8c4e48c6697f4c3817abd 100644 (file)
@@ -715,9 +715,9 @@ geometry_get_justification(const GSheetColumn *geom, gint unit)
 
   pv = psppire_dict_get_variable(ds->dict, unit);
 
-  /* Kludge: Happily GtkJustification is defined similarly
-     to enum alignment from pspp/variable.h */
-  return var_get_alignment(pv);
+  return (var_get_alignment (pv) == ALIGN_LEFT ? GTK_JUSTIFY_LEFT
+          : var_get_alignment (pv) == ALIGN_RIGHT ? GTK_JUSTIFY_RIGHT
+          : GTK_JUSTIFY_CENTER);
 }