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();
int newfields = wfields;
TToken_string def;
const int oldfields = oldrec.fields(); //numero campi del vecchio file
const int wfields = wrec.fields(); //numero campi del nuovo file
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();
for (int j = 0; j < oldfields; 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)
{
wrec.update_fielddef(newfields++, def);
wrec.set_fields(newfields);
wrec.rehash();
}
else
if(!yesno_box(FR("Il campo %s non verra' preservato, continuare"),
(const char *) def.get(0)))
if(!yesno_box("Il campo %s non verra' preservato, devo continuare?",
(const char*)fname))
return NOERR;
}

View File

@ -1853,7 +1853,7 @@ bool TBook::main_loop()
_pageto = pages();
_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++)
{

View File

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