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
|
||||
#define __MGLIB_H
|
||||
|
||||
#ifndef __RELATION_H
|
||||
#include <relation.h>
|
||||
#ifndef __MULTIREC_H
|
||||
#include <multirec.h>
|
||||
#endif
|
||||
|
||||
#ifndef __RECARRAY_H
|
||||
@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __FORM_H
|
||||
#include "form.h"
|
||||
#include <form.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ANAMAG_H
|
||||
@ -52,10 +52,6 @@
|
||||
#include "rmovmag.h"
|
||||
#endif
|
||||
|
||||
#ifndef __MULTIREC_H
|
||||
#include <multirec.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGLIB01_H
|
||||
#include "..\cg\cglib01.h"
|
||||
#endif
|
||||
@ -215,7 +211,7 @@ protected:
|
||||
|
||||
public:
|
||||
// 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
|
||||
void enable(bool on=TRUE) ;
|
||||
// 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
|
||||
{
|
||||
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
|
||||
if (_lev_enabled && levnum<=MANY_MAG_LEV && levnum>0)
|
||||
return(_enabled[levnum-1]);
|
||||
else
|
||||
return(FALSE) ;
|
||||
@ -655,19 +655,22 @@ const int TCodice_livelli::code_start(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]);
|
||||
else
|
||||
return(0) ;
|
||||
return(0);
|
||||
*/
|
||||
return enabled() ? _code_lenght[levnum-1] : 0;
|
||||
}
|
||||
|
||||
|
||||
const int TCodice_livelli::packed_lenght(int levnum) const
|
||||
{
|
||||
int start=0;
|
||||
for (int i=1; _lev_enabled && i<=levnum && levnum<=MANY_MAG_LEV; i++)
|
||||
start+= _code_lenght[i-1];
|
||||
for (int i=0; _lev_enabled && i<levnum && levnum<MANY_MAG_LEV; i++)
|
||||
start+= _code_lenght[i];
|
||||
return start;
|
||||
}
|
||||
|
||||
@ -743,11 +746,10 @@ TCodart_livelli ::TCodart_livelli()
|
||||
TConfig mgconfig(CONFIG_DITTA, "mg");
|
||||
load(mgconfig.get_bool("GESLIVART"), "FCA","GCA");
|
||||
// imposta il riconoscimento dei caratteri del formato dell'ultima parte dell'articolo
|
||||
TString80 format("");
|
||||
TTable _tabfca("FCA");
|
||||
if (_tabfca.last()==NOERR) {
|
||||
format = _tabfca.get("S1");
|
||||
}
|
||||
TString80 format;
|
||||
TTable tabfca("FCA");
|
||||
if (tabfca.last() == NOERR)
|
||||
format = tabfca.get("S1");
|
||||
_metachars.add(new TMetachar(format),max(last_level()-1,0));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user