]> mj.ucw.cz Git - libucw.git/commitdiff
tableprinter: table_set_col_opt now uses xtype_parse_fmt instead of hook parse_fmt
authorRobert Kessl <kesslr@centrum.cz>
Mon, 4 Aug 2014 11:47:05 +0000 (13:47 +0200)
committerRobert Kessl <kesslr@centrum.cz>
Mon, 4 Aug 2014 11:47:05 +0000 (13:47 +0200)
ucw/table.c

index 25a01d8db055d72c7f362817972d6cefae9cf0aa..1324839a7c371fd59e1097e09e7724faae437b1e 100644 (file)
@@ -215,10 +215,10 @@ const char *table_set_col_opt(struct table *tbl, uint col_inst_idx, const char *
     return col_def->set_col_opt(tbl, col_inst_idx, col_opt);
   }
 
-  if(col_def && col_def->type_def && col_def->type_def->parse_fmt) {
-    uint fmt = 0;
-    const char *tmp_err = col_def->type_def->parse_fmt(col_opt, &fmt, tbl->pool);
-    if(tmp_err) return tmp_err;
+  if(col_def && col_def->type_def) {
+    u32 fmt = 0;
+    const char *tmp_err = xtype_parse_fmt(col_def->type_def, col_opt, &fmt, tbl->pool);
+    if(tmp_err) return mp_printf(tbl->pool, "Invalid column format; xtypes error: '%s'.", tmp_err);
     tbl->column_order[col_inst_idx].fmt = fmt;
     return NULL;
   }