Patch level : 10.0

Files correlati     : cg3.exe
Ricompilazione Demo : [ ]
Commento            :
Corretta decodifica tabelle di ditta


git-svn-id: svn://10.65.10.50/trunk@17684 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-11-19 16:01:09 +00:00
parent 77ca727c70
commit ae20e57276
3 changed files with 23 additions and 7 deletions

View File

@ -465,7 +465,13 @@ void TFile_cache::construct(int key)
TFile_cache::TFile_cache(TLocalisamfile* f , int key)
{
construct(key);
_filecode << f->num();
switch (f->num())
{
case LF_TABCOM: _filecode << '%' << f->name(); break;
case LF_TAB : _filecode = f->name(); break;
case LF_TABMOD: _filecode << '&' << f->name(); break;
default : _filecode << f->num(); break;
}
init_file(f);
}
@ -714,7 +720,16 @@ TObject* TDecoder::rec2obj(const TRectype& curr) const
const TString& TDecoder::decode(const char* code)
{
const TString& obj = (const TString&)query(code);
TString80 key;
switch (file().num())
{
case LF_TABMOD: key << file().get("MOD") << '|' << file().get("CUST") << '|'; // Fall down
case LF_TAB:
case LF_TABCOM: key << file().name() << '|'; break;
default: break;
}
key << code;
const TString& obj = (const TString&)query(key);
return obj;
}

View File

@ -152,7 +152,7 @@ class TFile_cache : public TObject
static unsigned long _hits, _misses;
TToken_string _code;
TString4 _filecode;
TString4 _filecode; // Codice tabella es: %STA, &AUT
TLocalisamfile* _file;
int _key;
long _last_firm, _limit;
@ -170,7 +170,7 @@ protected:
const TObject& query(const char* chiave);
virtual TObject* rec2obj(const TRectype& rec) const pure;
TLocalisamfile & file();
TLocalisamfile& file();
public:
virtual bool discard(const char* victim);

View File

@ -205,9 +205,10 @@ void TVariable_rectype::set_memo_fld( const char * fieldname)
{
if (fieldname && *fieldname)
{
CHECKS(exist(fieldname), "Unknown memo field", fieldname);
CHECKS(type(fieldname) == _memofld, "Incorrect field type", fieldname);
_memo_fld = fieldname;
if (type(fieldname) == _memofld)
_memo_fld = fieldname;
else
NFCHECK("Campo memo non esistente %s", fieldname);
}
else
_memo_fld.cut(0);