Show
Ignore:
Timestamp:
06/19/09 12:41:37 (15 years ago)
Author:
mido
Message:

class bdmroot renamed to root, ui matrix patched (possibility of a "matrix" string at first place of the matrix list was allowed)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.cpp

    r384 r390  
    222222    if ( link.result.isList() ) 
    223223    { 
    224         if ( link.result.getLength() != 3 ) 
    225             ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
    226  
    227         Setting &rows_setting = link.result[0]; 
    228         Setting &cols_setting = link.result[1]; 
    229         Setting &elements = link.result[2]; 
     224                int data_offset; 
     225 
     226                if ( link.result.getLength() == 3 ) 
     227                        data_offset = 0; 
     228                else if ( link.result.getLength() == 4 ) 
     229                { 
     230                ASSERT_UITYPE(link.result[0],TypeString); 
     231                        if( link.result[0] != "matrix" ) 
     232                                ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
     233 
     234                        data_offset = 1; 
     235                } 
     236                else 
     237                        ui_error( "the setting supposed to represent a matrix element has wrong syntax", link.result ); 
     238 
     239        Setting &rows_setting = link.result[0 + data_offset]; 
     240        Setting &cols_setting = link.result[1 + data_offset]; 
     241        Setting &elements = link.result[2 + data_offset]; 
    230242 
    231243        ASSERT_UITYPE(cols_setting,TypeInt);