Don't assume that ALIGN_* and GTK_JUSTIFY_* values coincide.
authorBen Pfaff <blp@gnu.org>
Sat, 16 Dec 2006 22:13:12 +0000 (22:13 +0000)
committerBen Pfaff <blp@gnu.org>
Sat, 16 Dec 2006 22:13:12 +0000 (22:13 +0000)
src/ui/gui/ChangeLog
src/ui/gui/psppire-data-store.c

index c20e3be26f7281b22e500878846060112458616f..daa4de7d19ddb1803efefb990cc4b9b6f4044dbf 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec 16 14:13:07 2006  Ben Pfaff  <blp@gnu.org>
+
+       * psppire-data-store.c (geometry_get_justification): Don't assume
+       that ALIGN_* and GTK_JUSTIFY_* values coincide.
+
 Sat Dec 16 14:10:43 2006  Ben Pfaff  <blp@gnu.org>
 
        * psppire-var-store.c (text_for_column): Adjust to account for new
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);
 }