From: Robert Kessl Date: Mon, 28 Jul 2014 12:20:08 +0000 (+0200) Subject: tableprinter: table_make_default_column_order sets default xtype format X-Git-Tag: v6.1~3^2~33 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0ab670aef22cf24695b5e31f999f762443dc9260;p=libucw.git tableprinter: table_make_default_column_order sets default xtype format --- diff --git a/ucw/table.c b/ucw/table.c index eefb4785..c406452d 100644 --- a/ucw/table.c +++ b/ucw/table.c @@ -80,7 +80,6 @@ void table_cleanup(struct table *tbl) } // TODO: test default column order -// FIXME: should we copy the default format from table definition or use TBL_FMT_HUMAN_READABLE? static void table_make_default_column_order(struct table *tbl) { struct table_col_instance *col_order = alloca(sizeof(struct table_col_instance) * tbl->column_count); @@ -88,7 +87,8 @@ static void table_make_default_column_order(struct table *tbl) for(int i = 0; i < tbl->column_count; i++) { col_order[i].idx = (uint) i; - col_order[i].fmt = tbl->columns[i].fmt; + // currently, XTYPE_FMT_DEFAULT is 0, so bzero actually sets it correctly. This makes it more explicit. + col_order[i].fmt = XTYPE_FMT_DEFAULT; } table_set_col_order(tbl, col_order, tbl->column_count);