Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
realtion.cpp    Corretta gestione cancellazione file indice dei cursori
utility.cpp     Aggiustati messaggi d'errore nella fcopy
viswin.*        Eliminata richiesta di conferma Esc quanto non e' toplevel
xvtility.cpp    Cambiata in TString80 la stringa della status bar


git-svn-id: svn://10.65.10.50/trunk@6950 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-08-10 10:28:11 +00:00
parent ca3715012a
commit 1e0ec20f1b
5 changed files with 28 additions and 27 deletions

View File

@ -935,7 +935,7 @@ FILE* TCursor::open_index(
bool create) // @parm Indica se creare l'indice nel caso manchi (default FALSE)
{
_last_created = create;
if (create || _indexname.empty())
if (/*create ||*/ _indexname.empty())
{
TString16 radix;
radix.format("c%d_", file().num());
@ -969,34 +969,37 @@ void TCursor::close_index(FILE* f)
TRecnotype TCursor::buildcursor(TRecnotype rp)
{
TRecnotype oldrecno=0,pos,ap = 0;
int junk, l, pagecnt = 0;
const bool filtered = has_filter();
FILE* _f = open_index(TRUE);
// rewind(_f);
const int handle = file().handle();
if (DB_reccount(handle) == 0)
{
close_index(_f);
return 0;
}
rewind(_f);
l = strlen(to());
junk=DB_index_seek(handle, (char*)(const char*) from());
if (junk < 0) junk=get_error(junk);
if (junk == _iseof) return 0;
const int l = strlen(to());
int junk = DB_index_seek(handle, (char*)(const char*) from());
if (junk < 0) junk = get_error(junk);
if (junk == _iseof)
{
close_index(_f);
return 0;
}
TRecnotype oldrecno=0,ap = 0;
int pagecnt = 0;
const bool filtered = has_filter();
TRecnotype* page = new TRecnotype [CMAXELPAGE];
pos = DB_index_recno(handle);
TRecnotype pos = DB_index_recno(handle);
_pos=-1;
while (TRUE)
{
if (DB_index_eof(handle)) break;
if (DB_index_eof(handle))
break;
const char* s0 = DB_index_getkey(handle);
const TRecnotype recno = DB_index_recno(handle);
if (l && (strncmp(to(), s0, l) < 0)) break;
@ -1295,9 +1298,7 @@ TRecnotype TCursor::read(TIsamop op, TReclock lockop)
else
{
FILE* _f = open_index();
if (fseek(_f, 0L, SEEK_SET) != 0)
fatal_box("Can't repos cursor : File %d\n", curfile.num());
rewind(_f);
TRecnotype *page = new TRecnotype [CMAXELPAGE];
int pagecnt;
@ -1369,7 +1370,6 @@ TRecnotype TCursor::readrec()
file().setstatus(NOERR);
FILE* _f = open_index();
if (fseek(_f, _pos * sizeof(TRecnotype), SEEK_SET) != 0)
fatal_box("Can't seek position %ld in cursor n. %d\n", _pos, file().num());

View File

@ -33,13 +33,14 @@ bool fcopy(
return TRUE; // Or FALSE?
FILE* i = fopen(orig, rflag);
if (!i) return error_box("Impossibile leggere il file %s", orig);
if (i == NULL)
return error_box("Impossibile leggere il file %s\nda copiare in ", orig, dest);
FILE* o = fopen(dest, wflag);
if (!o)
if (o == NULL)
{
fclose(i);
return error_box("Impossibile scrivere il file ", dest);
return error_box("Impossibile creare il file %s\nper copiare il file %s", dest, orig);
}
const word size = 16*1024;

View File

@ -1876,7 +1876,7 @@ bool TViswin::on_key (KEY key)
check_link (&_point);
break;
case K_ESC:
if (_isopen)
if (_isopen && _toplevel)
abort_print ();
else
{

View File

@ -311,7 +311,7 @@ public:
// @cmember Sposta la visualizzazione di stampa alla posizione indicata
void goto_pos(long r, long c, bool moveorigin = TRUE);
// @cmember Opera un ridisegno della pgina di anteprima a video
// @cmember Opera un ridisegno della pagina di anteprima a video
void refresh();
// @cmember Indica se mostrare o no il righello

View File

@ -560,12 +560,12 @@ void xvt_statbar_set(
if (_statbar)
{
const TDate oggi(TODAY);
TString t(31);
TString80 t;
t << text << '\t' << oggi.string() << " - " << main_app().title();
if (def)
statbar_set_default_title(_statbar, (char*)(const char*)t);
statbar_set_title(_statbar, (char*)(const char*)t);
statbar_set_default_title(_statbar, t.get_buffer());
statbar_set_title(_statbar, t.get_buffer());
}
}