--- parser3/src/classes/table.C 2015/08/02 23:44:20 1.309 +++ parser3/src/classes/table.C 2016/03/31 21:46:20 1.313 @@ -1,7 +1,7 @@ /** @file Parser: @b table parser class. - Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -22,7 +22,7 @@ #define USE_STRINGSTREAM #endif -volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.309 2015/08/02 23:44:20 moko Exp $"; +volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.313 2016/03/31 21:46:20 moko Exp $"; // class @@ -35,7 +35,7 @@ public: // global variable -DECLARE_CLASS_VAR(table, new MTable, 0); +DECLARE_CLASS_VAR(table, new MTable); #define TABLE_REVERSE_NAME "reverse" @@ -656,7 +656,7 @@ static void _count(Request& r, MethodPar if(params.count()) { const String& param=params.as_string(0, PARAMETER_MUST_BE_STRING); if(param == "columns") - result = table.columns() ? table.columns()->count() : 0; + result = table.columns() ? table.columns()->count() : table.max_cells(); else if(param == "cells") result = table.count() ? table[table.current()]->count() : 0; else if(param == "rows") // synonim for ^table.count[] @@ -1062,7 +1062,7 @@ static void _flip(Request& r, MethodPara Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(0); if(size_t old_count=old_table.count()) - if(size_t old_cols=old_table.columns()?old_table.columns()->count():old_table[0]->count()) + if(size_t old_cols=old_table.columns()?old_table.columns()->count():old_table.max_cells()) for(size_t column=0; column