Ignore:
Timestamp:
12/22/14 23:21:16 (9 years ago)
Author:
Maciej Komosinski
Message:

setDefault(numericonly) removed. 's', 'x' and 'o' are no special cases anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/param.cpp

    r273 r278  
    117117}
    118118
    119 void ParamInterface::setDefault(bool numericonly)
     119void ParamInterface::setDefault()
    120120{
    121121        int n = getPropCount();
    122122        for (int i = 0; i < n; i++)
    123                 setDefault(i, numericonly);
     123                setDefault(i);
    124124}
    125125
     
    138138}
    139139
    140 void ParamInterface::setDefault(int i, bool numericonly)
     140void ParamInterface::setDefault(int i)
    141141{
    142142        const char *t = type(i);
     
    157157        }
    158158                break;
    159         case 's': if (!numericonly)
     159        case 's': case 'x':
    160160        {
    161161                int a,b; SString c;
    162162                getMinMax(i,a,b,c);
    163                 setString(i,c);
     163                if (*t=='s')
     164                        setString(i,c);
     165                else
     166                        { if (c.len()>0) setExtValue(i,ExtValue(c)); else setExtValue(i,ExtValue::empty()); }
    164167        }
    165168                break;
    166         default: if (!numericonly) set(i, "");
     169        case 'o':
     170                setObject(i,ExtObject::empty());
     171                break;
    167172        }
    168173}
     
    371376}
    372377
    373 int ParamInterface::load(VirtFILE* f,bool warn_unknown_fields)
     378int ParamInterface::load(VirtFILE* f,bool warn_unknown_fields,bool *abortable)
    374379{
    375380        SString buf;
     
    379384        bool loaded;
    380385        int fields_loaded = 0;
    381         while (loadSStringLine(f, buf))
     386        while ( ((!abortable)||(!*abortable)) && loadSStringLine(f, buf) )
    382387        {
    383388                const char* t = (const char*)buf;
     
    908913}
    909914
    910 void SimpleAbstractParam::setDefault(bool numericonly)
     915void SimpleAbstractParam::setDefault()
    911916{
    912917        bool save = dontcheckchanges;
    913918        dontcheckchanges = 1;
    914         ParamInterface::setDefault(numericonly);
     919        ParamInterface::setDefault();
    915920        dontcheckchanges = save;
    916921}
    917922
    918 void SimpleAbstractParam::setDefault(int i, bool numericonly)
     923void SimpleAbstractParam::setDefault(int i)
    919924{
    920925        bool save = dontcheckchanges;
    921926        dontcheckchanges = 1;
    922         ParamInterface::setDefault(i, numericonly);
     927        ParamInterface::setDefault(i);
    923928        dontcheckchanges = save;
    924929}
Note: See TracChangeset for help on using the changeset viewer.