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 "fldtypes.h"
int hashfun(char *);
int hashfun(const char *);
void setdec(char *, int);
char *prefname(void);
@ -613,17 +613,17 @@ void setdec(s,dec)
@(FN)
*/
int hashfun(s)
char *s; /* stringa da eleborare */
int hashfun(const char* s) /* stringa da eleborare */
{
int l;
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);
if (ODD(LENGTH(s))) strcat(w, " ");
l = LENGTH(s);
if (ODD(l))
{
w[l++] = ' ';
w[l] = '\0';
}
while ((char *) pw < w + l)
{
temp ^= *pw;

View File

@ -467,7 +467,7 @@ int DB_rewrite(int handle)
if (rt == e4unique)
{
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);
}
rt=DB_unlock(handle);

View File

@ -942,9 +942,10 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
if (_cur_rec >= items())
{
_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);
_check_enabled = TRUE;
}