Eliminato l'array di booleani dall'oggetto tcodice_livelli

git-svn-id: svn://10.65.10.50/trunk@5087 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
augusto 1997-08-21 07:33:26 +00:00
parent 7fe7bb02c5
commit f106df3e86
2 changed files with 3 additions and 8 deletions

View File

@ -195,7 +195,6 @@ public:
class TCodice_livelli : public TObject
{
bool _enabled[MANY_MAG_LEV];
int _code_lenght[MANY_MAG_LEV];
TString _name[MANY_MAG_LEV];
TString _picture[MANY_MAG_LEV];

View File

@ -588,8 +588,7 @@ void TCodice_livelli::load(bool enabled, const char *tabname,const char *tabgrp)
_last_level=0;
e=_tabformato.first();
for (int i=0; i< MANY_MAG_LEV; i++) {
_enabled[i]=(e==NOERR) && _lev_enabled;
if (_enabled[i]) {
if ((e==NOERR) && _lev_enabled) {
_name[i]=_tabformato.get("S0");
_picture[i]=_tabformato.get("S1");
_code_lenght[i]=TMetachar::maxstrlen(_picture[i]);
@ -641,10 +640,7 @@ const bool TCodice_livelli::enabled() const
const bool TCodice_livelli::enabled(int levnum) const
{
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
return(_enabled[levnum-1]);
else
return(FALSE) ;
return (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0 && levnum<=_last_level);
}
@ -704,7 +700,7 @@ TString TCodice_livelli::unpack_grpcode(const TString & pc, const int levnum) co
if (start>=pc.len())
return("");
else {
if (levnum != _last_level && !_enabled[levnum-1])
if (levnum < 1 || levnum > _last_level )
return("");
return(pc.mid(start,levnum == _last_level ? -1 : _code_lenght[levnum-1]));
}