mglib.h Tolto include inutile
mglib01.cpp Resa piu' "bella" la code_length e tolto il _ ad una variabile locale git-svn-id: svn://10.65.10.50/trunk@5086 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c75e0aaa91
commit
7fe7bb02c5
12
mg/mglib.h
12
mg/mglib.h
@ -4,8 +4,8 @@
|
|||||||
#ifndef __MGLIB_H
|
#ifndef __MGLIB_H
|
||||||
#define __MGLIB_H
|
#define __MGLIB_H
|
||||||
|
|
||||||
#ifndef __RELATION_H
|
#ifndef __MULTIREC_H
|
||||||
#include <relation.h>
|
#include <multirec.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __RECARRAY_H
|
#ifndef __RECARRAY_H
|
||||||
@ -21,7 +21,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __FORM_H
|
#ifndef __FORM_H
|
||||||
#include "form.h"
|
#include <form.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ANAMAG_H
|
#ifndef __ANAMAG_H
|
||||||
@ -52,10 +52,6 @@
|
|||||||
#include "rmovmag.h"
|
#include "rmovmag.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MULTIREC_H
|
|
||||||
#include <multirec.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CGLIB01_H
|
#ifndef __CGLIB01_H
|
||||||
#include "..\cg\cglib01.h"
|
#include "..\cg\cglib01.h"
|
||||||
#endif
|
#endif
|
||||||
@ -215,7 +211,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// Ritorna il numero di livelli abilitati
|
// Ritorna il numero di livelli abilitati
|
||||||
int last_level() const {return enabled() ? _last_level: 0;};
|
int last_level() const { return enabled() ? _last_level : 0; }
|
||||||
// Abilita la gestione dei livelli
|
// Abilita la gestione dei livelli
|
||||||
void enable(bool on=TRUE) ;
|
void enable(bool on=TRUE) ;
|
||||||
// Ritorna se la gestione dei livelli è abilitata
|
// Ritorna se la gestione dei livelli è abilitata
|
||||||
|
@ -641,7 +641,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)
|
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
|
||||||
return(_enabled[levnum-1]);
|
return(_enabled[levnum-1]);
|
||||||
else
|
else
|
||||||
return(FALSE) ;
|
return(FALSE) ;
|
||||||
@ -655,19 +655,22 @@ const int TCodice_livelli::code_start(int levnum) const
|
|||||||
|
|
||||||
|
|
||||||
const int TCodice_livelli::code_lenght(int levnum) const
|
const int TCodice_livelli::code_lenght(int levnum) const
|
||||||
{
|
{
|
||||||
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
|
/*
|
||||||
|
if (_lev_enabled && levnum <= MANY_MAG_LEV && levnum > 0)
|
||||||
return(_code_lenght[levnum-1]);
|
return(_code_lenght[levnum-1]);
|
||||||
else
|
else
|
||||||
return(0) ;
|
return(0);
|
||||||
|
*/
|
||||||
|
return enabled() ? _code_lenght[levnum-1] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const int TCodice_livelli::packed_lenght(int levnum) const
|
const int TCodice_livelli::packed_lenght(int levnum) const
|
||||||
{
|
{
|
||||||
int start=0;
|
int start=0;
|
||||||
for (int i=1; _lev_enabled && i<=levnum && levnum<=MANY_MAG_LEV; i++)
|
for (int i=0; _lev_enabled && i<levnum && levnum<MANY_MAG_LEV; i++)
|
||||||
start+= _code_lenght[i-1];
|
start+= _code_lenght[i];
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,11 +746,10 @@ TCodart_livelli ::TCodart_livelli()
|
|||||||
TConfig mgconfig(CONFIG_DITTA, "mg");
|
TConfig mgconfig(CONFIG_DITTA, "mg");
|
||||||
load(mgconfig.get_bool("GESLIVART"), "FCA","GCA");
|
load(mgconfig.get_bool("GESLIVART"), "FCA","GCA");
|
||||||
// imposta il riconoscimento dei caratteri del formato dell'ultima parte dell'articolo
|
// imposta il riconoscimento dei caratteri del formato dell'ultima parte dell'articolo
|
||||||
TString80 format("");
|
TString80 format;
|
||||||
TTable _tabfca("FCA");
|
TTable tabfca("FCA");
|
||||||
if (_tabfca.last()==NOERR) {
|
if (tabfca.last() == NOERR)
|
||||||
format = _tabfca.get("S1");
|
format = tabfca.get("S1");
|
||||||
}
|
|
||||||
_metachars.add(new TMetachar(format),max(last_level()-1,0));
|
_metachars.add(new TMetachar(format),max(last_level()-1,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user