Patch level : 2.0 592

Files correlati     : cg2.exe
Ricompilazione Demo : [ ]
Commento            :

EP20121
Richiamo in modifica una fattura di vendita o di acquisto già inserita,
cambio il numero documento e registro.cliccando su fine errore cg2


git-svn-id: svn://10.65.10.50/trunk@11470 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-10-07 12:53:38 +00:00
parent 044098660b
commit 5441eab6a9
7 changed files with 39 additions and 31 deletions

View File

@ -57,6 +57,7 @@
#define CLI_OCCAS "OCCAS" #define CLI_OCCAS "OCCAS"
#define CLI_CODLIN "CODLIN" #define CLI_CODLIN "CODLIN"
#define CLI_CODZONA "CODZONA" #define CLI_CODZONA "CODZONA"
#define CLI_VALINTRA "VALINTRA"
#endif #endif

View File

@ -44,7 +44,7 @@ static DATA4 *dbdata[CB4FILES];
bool handle_ok(int handle) bool handle_ok(int handle)
{ {
return handle >= 0 && handle < CB4FILES && dbdata[handle] !=0; return handle >= 0 && handle < CB4FILES && dbdata[handle] != NULL;
} }
static char* find_slash_backslash(const char* s) static char* find_slash_backslash(const char* s)
@ -68,9 +68,8 @@ void DB_init(void)
{ {
int i; int i;
for(i=0;i<CB4FILES;i++) for(i=0;i<CB4FILES;i++)
{ dbdata[i]=(DATA4*)NULL;
dbdata[i]=(DATA4 *) 0;
}
code4init(&code_base); code4init(&code_base);
code_base.readLock=0; code_base.readLock=0;
code_base.errDefaultUnique=e4unique; code_base.errDefaultUnique=e4unique;
@ -88,7 +87,14 @@ void DB_init(void)
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void DB_exit(void) void DB_exit(void)
{ {
int i;
code4initUndo(&code_base); code4initUndo(&code_base);
for(i=0;i<CB4FILES;i++)
{
if (handle_ok(i))
DB_close(i);
}
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
@ -104,7 +110,7 @@ int DB_open(const char *filename,int mode,int index)
found=-1; found=-1;
for(i=0;i<CB4FILES;i++) for(i=0;i<CB4FILES;i++)
{ {
if(dbdata[i]==(DATA4 *) 0) if(dbdata[i]==(DATA4*)NULL)
{ {
found=i; found=i;
break; break;

View File

@ -30,6 +30,7 @@ bool TConfig_application::create()
bool TConfig_application::destroy() bool TConfig_application::destroy()
{ {
_cnf->set_paragraph(""); // Flush
bool b = user_destroy(); bool b = user_destroy();
if (_m) delete _m; if (_m) delete _m;
if (_cnf) delete _cnf; if (_cnf) delete _cnf;

View File

@ -977,7 +977,7 @@ int TBaseisamfile::_read(TRectype& rec, word op, word lockop)
if (_lasterr == NOERR) if (_lasterr == NOERR)
{ {
if (lockop == _lock) if (lockop == _lock)
prefix().lock_record(_isam_handle, _recno); prefix().lock_record(_isam_handle, _recno); else
if (lockop == _unlock) if (lockop == _unlock)
prefix().unlock_record(_isam_handle, _recno); prefix().unlock_record(_isam_handle, _recno);
} }
@ -1123,6 +1123,8 @@ int TBaseisamfile::_rewrite(const TRectype& rec)
else else
DB_unlock(fhnd); DB_unlock(fhnd);
_recno = DB_recno(fhnd); _recno = DB_recno(fhnd);
prefix().unlock_record(_isam_handle, _recno);
if(_lasterr == NOERR && curr().has_memo( )) if(_lasterr == NOERR && curr().has_memo( ))
((TRectype &)rec).write_memo(_isam_handle, _recno ); ((TRectype &)rec).write_memo(_isam_handle, _recno );
} }

View File

@ -732,7 +732,7 @@ int TFile_manager::close_closeable()
TFile_info& i = fileinfo(n); TFile_info& i = fileinfo(n);
if (i.is_open()) if (i.is_open())
{ {
if (!(i.is_locked() || i.is_exclusive())) if (!i.is_exclusive())
i.auto_close(); i.auto_close();
else else
_open_files++; _open_files++;
@ -746,8 +746,10 @@ int TFile_manager::close_closeable()
void TFile_manager::close_all() void TFile_manager::close_all()
{ {
const int zoccolo_duro = close_closeable(); const int zoccolo_duro = close_closeable();
#ifdef DBG
if (zoccolo_duro > 0) if (zoccolo_duro > 0)
NFCHECK("%d files refuse to be closed!", zoccolo_duro); NFCHECK("%d files refuse can't be closed!", zoccolo_duro);
#endif
for (int n = _recinfo.last(); n > 0; n = _recinfo.pred(n)) for (int n = _recinfo.last(); n > 0; n = _recinfo.pred(n))
{ {
@ -886,6 +888,7 @@ TPrefix::~TPrefix()
set(); set();
if (_firm) if (_firm)
delete _firm; delete _firm;
_manager.close_all();
DB_exit(); DB_exit();
} }

View File

@ -1,8 +1,4 @@
#include <ctype.h> #include <xvt.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <strstrea.h> #include <strstrea.h>
#include <dongle.h> #include <dongle.h>
@ -357,12 +353,13 @@ int TString::rfind(
} }
#if XVT_OS == XVT_OS_SCOUNIX #if XVT_OS == XVT_OS_SCOUNIX
HIDDEN char* strstr(const char* string1, const char* string2) HIDDEN const char* strstr(const char* string1, const char* string2)
{ {
const int len = strlen(string2); const int len = strlen(string2);
while (*string1) while (*string1)
{ {
if (strncmp(string1, string2, len) == 0) return (char*) string1; if (strncmp(string1, string2, len) == 0)
return string1;
string1++; string1++;
} }
return NULL; return NULL;
@ -1017,7 +1014,7 @@ void TFilename::ext(const char* e)
bool can_cut = TRUE; bool can_cut = TRUE;
for (int i = start; i > 0 && _str[i] != '.'; i--) for (int i = start; i > 0 && _str[i] != '.'; i--)
if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':') if (is_slash(_str[i]) || _str[i] == ':')
{ {
can_cut = FALSE; can_cut = FALSE;
i = start; i = start;
@ -1042,7 +1039,7 @@ const char* TFilename::name() const
if (start < 0) if (start < 0)
start = len()-1; start = len()-1;
for (int i = start; i >= 0; i--) for (int i = start; i >= 0; i--)
if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':') if (is_slash(_str[i]) || _str[i] == ':')
break; break;
TString& spark = get_tmp_string(); TString& spark = get_tmp_string();
@ -1058,7 +1055,7 @@ const char* TFilename::path() const
if (start < 0) if (start < 0)
start = len()-1; start = len()-1;
for (int i = start; i >= 0; i--) for (int i = start; i >= 0; i--)
if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':') if (is_slash(_str[i]) || _str[i] == ':')
break; break;
TString& spark = get_tmp_string(); TString& spark = get_tmp_string();
spark = _str; spark = _str;
@ -1183,7 +1180,9 @@ const TFilename& TFilename::tempdir()
const TFilename& TFilename::currdir() const TFilename& TFilename::currdir()
{ {
_getcwd(get_buffer(),256); DIRECTORY dir;
xvt_fsys_get_dir(&dir);
xvt_fsys_convert_dir_to_str(&dir, get_buffer(), size());
return *this; return *this;
} }
// Certified 50% // Certified 50%
@ -1257,7 +1256,7 @@ bool TFilename::is_absolute_path() const
const char* s = _str; const char* s = _str;
if (isalpha(*s) && s[1] == ':') if (isalpha(*s) && s[1] == ':')
s += 2; s += 2;
return *s == '/' || *s == '\\'; return is_slash(*s);
} }
const TFilename& TFilename::make_absolute_path() const TFilename& TFilename::make_absolute_path()
@ -1265,7 +1264,9 @@ const TFilename& TFilename::make_absolute_path()
if (is_relative_path()) if (is_relative_path())
{ {
const TString saved(_str); const TString saved(_str);
getcwd(get_buffer(), size()); DIRECTORY dir;
xvt_fsys_get_dir(&dir);
xvt_fsys_convert_dir_to_str(&dir, get_buffer(), size());
add(saved); add(saved);
} }
return *this; return *this;

View File

@ -23,17 +23,11 @@ bool input_filename(TFilename& file);
const char* encode(const char* data); const char* encode(const char* data);
const char* decode(const char* data); const char* decode(const char* data);
// @doc EXTERNAL inline bool is_slash(char s) // @parm Carattere da confrontare
{ return s == '\\' || s == '/'; }
// @func Controlla se il carattere passato e' il simbolo di slash ('\\' oppure '/') inline bool is_not_slash(char s) // @parm Carattere da confrontare
// { return s != '\\' && s != '/'; }
// @rdesc Ritorna i seguneti valori:
//
// @flag TRUE | Se il carattere <p s> non e' uno slash
// @flag FALSE | Se il carattere <p s> e' uno slash
inline bool is_not_slash(
char s) // @parm Carattere da confrontare
{ return s != '\\' && s != '/'; }
const char* esc(const char* str); // Trasforma le sequenze "\n" nel carattere '\n' const char* esc(const char* str); // Trasforma le sequenze "\n" nel carattere '\n'
const char* unesc(const char* str); // Trasforma i caratteri '\n' nella sequenza "\n" const char* unesc(const char* str); // Trasforma i caratteri '\n' nella sequenza "\n"