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:
parent
7fe7bb02c5
commit
f106df3e86
@ -195,7 +195,6 @@ public:
|
|||||||
|
|
||||||
class TCodice_livelli : public TObject
|
class TCodice_livelli : public TObject
|
||||||
{
|
{
|
||||||
bool _enabled[MANY_MAG_LEV];
|
|
||||||
int _code_lenght[MANY_MAG_LEV];
|
int _code_lenght[MANY_MAG_LEV];
|
||||||
TString _name[MANY_MAG_LEV];
|
TString _name[MANY_MAG_LEV];
|
||||||
TString _picture[MANY_MAG_LEV];
|
TString _picture[MANY_MAG_LEV];
|
||||||
|
@ -588,8 +588,7 @@ void TCodice_livelli::load(bool enabled, const char *tabname,const char *tabgrp)
|
|||||||
_last_level=0;
|
_last_level=0;
|
||||||
e=_tabformato.first();
|
e=_tabformato.first();
|
||||||
for (int i=0; i< MANY_MAG_LEV; i++) {
|
for (int i=0; i< MANY_MAG_LEV; i++) {
|
||||||
_enabled[i]=(e==NOERR) && _lev_enabled;
|
if ((e==NOERR) && _lev_enabled) {
|
||||||
if (_enabled[i]) {
|
|
||||||
_name[i]=_tabformato.get("S0");
|
_name[i]=_tabformato.get("S0");
|
||||||
_picture[i]=_tabformato.get("S1");
|
_picture[i]=_tabformato.get("S1");
|
||||||
_code_lenght[i]=TMetachar::maxstrlen(_picture[i]);
|
_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
|
const bool TCodice_livelli::enabled(int levnum) const
|
||||||
{
|
{
|
||||||
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
|
return (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0 && levnum<=_last_level);
|
||||||
return(_enabled[levnum-1]);
|
|
||||||
else
|
|
||||||
return(FALSE) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -704,7 +700,7 @@ TString TCodice_livelli::unpack_grpcode(const TString & pc, const int levnum) co
|
|||||||
if (start>=pc.len())
|
if (start>=pc.len())
|
||||||
return("");
|
return("");
|
||||||
else {
|
else {
|
||||||
if (levnum != _last_level && !_enabled[levnum-1])
|
if (levnum < 1 || levnum > _last_level )
|
||||||
return("");
|
return("");
|
||||||
return(pc.mid(start,levnum == _last_level ? -1 : _code_lenght[levnum-1]));
|
return(pc.mid(start,levnum == _last_level ? -1 : _code_lenght[levnum-1]));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user