Patch level : 10.0

Files correlati     : ve1
Ricompilazione Demo : [ ]
Commento            :
Corretta gestione MESSAGE _TABLEREAD sulle tabelle di modulo


git-svn-id: svn://10.65.10.50/trunk@18729 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-04-17 14:13:47 +00:00
parent 90f27e8dfe
commit cfe57d63b3
5 changed files with 37 additions and 15 deletions

View File

@ -1218,12 +1218,23 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
if (table.ends_with(".DBF"))
{
TFilename dbf = table;
if (dbf.is_relative_path())
if (table[0] == '$' || table[0] == '%')
{
if (!dbf.custom_path())
if (table[0] == '%')
dbf = firm2dir(0);
else
dbf = firm2dir(prefix().get_codditta());
dbf.add(table.mid(1));
}
else
{
if (dbf.is_relative_path())
{
dbf.tempdir();
dbf.add(table);
if (!dbf.custom_path())
{
dbf.tempdir();
dbf.add(table);
}
}
}
dbf.lower();

View File

@ -1999,7 +1999,6 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
const char* TSorted_cursor::fill_sort_key(TString& k)
{
TString16 fmt;
TString sf;
k.cut(0);
for (TString80 s = _order_expr.get(0); s.not_empty(); s = _order_expr.get())
@ -2012,17 +2011,27 @@ const char* TSorted_cursor::fill_sort_key(TString& k)
const TFieldref f(s,0);
sf = f.read(*relation());
const TRectype& frec = curr(f.file());
const TFieldtypes fld_type = frec.type(f.name());
if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI!
TFieldtypes fld_type = frec.type(f.name());
int fld_len = f.len(frec);
// Converte in ANSI i campi data ed i sottocampi con una data!
if (fld_type == _datefld || (f.is_subfield() && TDate::isdate(sf)))
{
TDate d(sf);
sf=d.string(ANSI);
const TDate d(sf);
sf = d.string(ANSI);
fld_type = _datefld;
fld_len = 10;
}
if (is_up) sf.upper();
else
{
if (is_up)
sf.upper();
}
TString8 fmt;
if (fld_type == _alfafld || fld_type == _datefld)
fmt.format("%%-%ds",f.len(frec));
fmt.format("%%-%ds", fld_len);
else
fmt.format("%%%ds",f.len(frec));
fmt.format("%%%ds", fld_len);
k << format(fmt, (const char*)sf);
}
return k;

View File

@ -564,7 +564,10 @@ public:
// @cmember Controlla la validita' dell'oggetto (TRUE se il numero del file e' valido)
virtual bool ok() const
{ return _name.not_empty(); }
{ return _name.full(); }
virtual bool is_subfield() const
{ return _name.find(':') > 0; }
// @cmember Ritorna il numero del file
int file() const

View File

@ -2785,7 +2785,7 @@ void TReport::msg_table_read(TVariant_stack& stack)
{
const TString& t_code = stack.pop().as_string(); // prende il codice della tabella da leggere
const int logicnum = table2logic(t_code);
if (logicnum == LF_TAB || logicnum == LF_TABCOM)
if (logicnum == LF_TAB || logicnum == LF_TABCOM || logicnum == LF_TABMOD)
{
const TString& codtab = stack.pop().as_string();
TVariant var;

View File

@ -578,7 +578,6 @@ public:
void report2mask(TMask & m) const;
void mask2report(const TMask & m);
void destroy();
bool print_or_preview();