Converted strings to utf8 before passing to gtksheet. Should work properly now with
[pspp-builds.git] / src / ui / gui / var-sheet.c
index e04d48955d571f3edec16d54e858b6c11f8fca23..76065949829564e7e6ef4c39ca5267864e5d7e40 100644 (file)
@@ -30,7 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define min(A,B) ((A < B)?A:B)
+#include <data/value.h>
+
+#include <minmax.h>
 
 #include <gtksheet/gtksheet.h>
 #include <gtksheet/gsheet-hetero-column.h>
@@ -366,11 +368,11 @@ var_sheet_cell_change_entry (GtkSheet * sheet, gint row, gint column,
                {
                case COL_WIDTH:
                  r_min = fmt->d + 1;
-                 r_max = (psppire_variable_get_type(pv) == ALPHA) ? 255 : 40;
+                 r_max = (psppire_variable_get_type(pv) == ALPHA) ? MAX_STRING : 40;
                  break;
                case COL_DECIMALS:
                  r_min = 0 ; 
-                 r_max = min(fmt->w - 1, 16);
+                 r_max = MIN(fmt->w - 1, 16);
                  break;
                case COL_COLUMNS:
                  r_min = 1;