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")) if (table.ends_with(".DBF"))
{ {
TFilename dbf = table; 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(); if (!dbf.custom_path())
dbf.add(table); {
dbf.tempdir();
dbf.add(table);
}
} }
} }
dbf.lower(); dbf.lower();

View File

@ -1999,7 +1999,6 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
const char* TSorted_cursor::fill_sort_key(TString& k) const char* TSorted_cursor::fill_sort_key(TString& k)
{ {
TString16 fmt;
TString sf; TString sf;
k.cut(0); k.cut(0);
for (TString80 s = _order_expr.get(0); s.not_empty(); s = _order_expr.get()) 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); const TFieldref f(s,0);
sf = f.read(*relation()); sf = f.read(*relation());
const TRectype& frec = curr(f.file()); const TRectype& frec = curr(f.file());
const TFieldtypes fld_type = frec.type(f.name()); TFieldtypes fld_type = frec.type(f.name());
if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI! 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); const TDate d(sf);
sf=d.string(ANSI); 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) if (fld_type == _alfafld || fld_type == _datefld)
fmt.format("%%-%ds",f.len(frec)); fmt.format("%%-%ds", fld_len);
else else
fmt.format("%%%ds",f.len(frec)); fmt.format("%%%ds", fld_len);
k << format(fmt, (const char*)sf); k << format(fmt, (const char*)sf);
} }
return k; return k;

View File

@ -564,7 +564,10 @@ public:
// @cmember Controlla la validita' dell'oggetto (TRUE se il numero del file e' valido) // @cmember Controlla la validita' dell'oggetto (TRUE se il numero del file e' valido)
virtual bool ok() const 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 // @cmember Ritorna il numero del file
int file() const 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 TString& t_code = stack.pop().as_string(); // prende il codice della tabella da leggere
const int logicnum = table2logic(t_code); 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(); const TString& codtab = stack.pop().as_string();
TVariant var; TVariant var;

View File

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