Patch level : 4.0 911

Files correlati     :
Ricompilazione Demo : [ ]
Commento           :

Riportata la versione 3.2 1010


git-svn-id: svn://10.65.10.50/trunk@16353 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2008-03-20 17:13:20 +00:00
parent 8e9fb3fce8
commit 98b6456710
3 changed files with 27 additions and 11 deletions

View File

@ -2110,23 +2110,29 @@ int TSystemisamfile::update(
} }
} }
const int wfields = wrec.fields(); const int oldfields = oldrec.fields(); //numero campi del vecchio file
int newfields = wfields; const int wfields = wrec.fields(); //numero campi del nuovo file
TToken_string def; int newfields = wfields; //numero campi del nuovo file compresi quelli personalizzati (_)
TToken_string def; //riga del file .trr nome|tipo|lungh|dec
const int oldfields = oldrec.fields(); const int oldfields = oldrec.fields();
for (int j = 0; j < oldfields; j++) for (int j = 0; j < oldfields; j++)
{ {
def = oldrec.fielddef(j); def = oldrec.fielddef(j);
if (!interactive && (def.get(0)[0] == '_')) const TString16 fname = def.get(0); //nome e basta del campo
if (!interactive && fname[0] == '_')
{ {
if (newrec.field(def) == FIELDERR) if (wrec.field(fname) == FIELDERR)
{ {
if (newfields < MaxFields) if (newfields < MaxFields)
{
wrec.update_fielddef(newfields++, def); wrec.update_fielddef(newfields++, def);
wrec.set_fields(newfields);
wrec.rehash();
}
else else
if(!yesno_box(FR("Il campo %s non verra' preservato, continuare"), if(!yesno_box("Il campo %s non verra' preservato, devo continuare?",
(const char *) def.get(0))) (const char*)fname))
return NOERR; return NOERR;
} }

View File

@ -1853,7 +1853,7 @@ bool TBook::main_loop()
_pageto = pages(); _pageto = pages();
_print_aborted = false; _print_aborted = false;
for (word copy = 1; copy < _copies && !_print_aborted; copy++) for (word copy = 0; copy < _copies && !_print_aborted; copy++)
{ {
for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++) for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++)
{ {

View File

@ -119,10 +119,20 @@ long TVariant::as_int() const
bool TVariant::as_bool() const bool TVariant::as_bool() const
{ {
bool ok = false; bool ok = false;
if (_type == _alfafld) switch (_type)
ok = strchr("1VXY", as_string()[0]) != NULL; {
else case _nullfld:
break;
case _alfafld:
{
const TString& str = as_string();
ok = str.full() && strchr("1TVXY", str[0]) != NULL;
}
break;
default:
ok = as_int() != 0; ok = as_int() != 0;
break;
}
return ok; return ok;
} }