--- parser3/src/classes/table.C 2003/07/24 11:31:20 1.182 +++ parser3/src/classes/table.C 2003/09/29 09:58:29 1.184 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_TABLE_C="$Date: 2003/07/24 11:31:20 $"; +static const char* IDENT_TABLE_C="$Date: 2003/09/29 09:58:29 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -207,8 +207,9 @@ static void _load(Request& r, MethodPara } // parse cells - Table& table=*new Table(columns); + Table& table=*new Table(columns);//что-то очень плохое с realloc'ом: 1000 сильно помогает char *row_chars; + int cells=0; while(row_chars=getrow(&data)) { // remove empty&comment lines if(!*row_chars || *row_chars == '#') @@ -216,6 +217,7 @@ static void _load(Request& r, MethodPara Table::element_type row(new ArrayString); while(char *cell_chars=lsplit(&row_chars, '\t')) { *row+=new String(cell_chars, 0, true); + cells++; } table+=row; }; @@ -599,7 +601,7 @@ static void _locate(Request& r, MethodPa static void _flip(Request& r, MethodParams& params) { Table& old_table=GET_SELF(r, VTable).table(); - Table& new_table=*new Table(old_table.columns()); + Table& new_table=*new Table(0); if(size_t old_count=old_table.count()) if(size_t old_cols=old_table[0]->count()) for(size_t column=0; column