cfiles.c ????

codeb.c      Migliorata hashfun
msksheet.cpp Corretta gestione eliminazione righe in edit


git-svn-id: svn://10.65.10.50/trunk@2392 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-01-04 14:53:23 +00:00
parent 49b4babbca
commit b0f727ea6b
3 changed files with 1396 additions and 1395 deletions

View File

@ -3,7 +3,7 @@
#include "cfiles.h" #include "cfiles.h"
#include "fldtypes.h" #include "fldtypes.h"
int hashfun(char *); int hashfun(const char *);
void setdec(char *, int); void setdec(char *, int);
char *prefname(void); char *prefname(void);
@ -613,17 +613,17 @@ void setdec(s,dec)
@(FN) @(FN)
*/ */
int hashfun(s) int hashfun(const char* s) /* stringa da eleborare */
char *s; /* stringa da eleborare */
{ {
int l;
char w[82]; char w[82];
unsigned short temp = 0, *pw = (unsigned short *)w; unsigned short temp = 0, *pw = (unsigned short *)w;
int l = LENGTH(s);
strcpy(w, s); strcpy(w, s);
if (ODD(LENGTH(s))) strcat(w, " "); if (ODD(l))
l = LENGTH(s); {
w[l++] = ' ';
w[l] = '\0';
}
while ((char *) pw < w + l) while ((char *) pw < w + l)
{ {
temp ^= *pw; temp ^= *pw;

View File

@ -467,7 +467,7 @@ int DB_rewrite(int handle)
if (rt == e4unique) if (rt == e4unique)
{ {
DB_get_error(); DB_get_error();
fatal_box("Errore in DB_rewrite(): chiav duplicata nell' indice %ld, file %s", fatal_box("Errore in DB_rewrite(): chiave duplicata nel record %ld, file %s",
dbdata[handle]->rec_num + 1, dbdata[handle]->file.name); dbdata[handle]->rec_num + 1, dbdata[handle]->file.name);
} }
rt=DB_unlock(handle); rt=DB_unlock(handle);

View File

@ -942,9 +942,10 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
if (_cur_rec >= items()) if (_cur_rec >= items())
{ {
_row_dirty = _cell_dirty = FALSE; _row_dirty = _cell_dirty = FALSE;
set_pos(0, 1); _cur_rec = items()-1;
_cur_row = 0; _cur_col = 1;
} }
if (_cur_rec >= 0) if (_cur_rec >= 0 && _cur_rec < items())
set_focus_cell(_cur_row, _cur_col); set_focus_cell(_cur_row, _cur_col);
_check_enabled = TRUE; _check_enabled = TRUE;
} }