Modifiche dalla versione Linux sulla 2.1
git-svn-id: svn://10.65.10.50/trunk@11846 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
00aa150b32
commit
6dffdb1751
@ -158,11 +158,6 @@ class TForm : public TObject
|
||||
// @cmember:(INTERNAL) Cambio da applicare in output per stampa prezzi ed importi
|
||||
TExchange* _exchange;
|
||||
|
||||
// @cmember:(INTERNAL) Handler di default della testata di stampa
|
||||
static void header_handler(TPrinter& p);
|
||||
// @cmember:(INTERNAL) Handler di default del piede di stampa
|
||||
static void footer_handler(TPrinter& p);
|
||||
|
||||
// @cmember:(INTERNAL) Ritorna l'array di caratteri di fincatura
|
||||
const char* get_fincatura()
|
||||
{ return _fink; }
|
||||
@ -172,6 +167,11 @@ class TForm : public TObject
|
||||
// @access Protected Member
|
||||
protected:
|
||||
|
||||
// @cmember:(INTERNAL) Handler di default della testata di stampa
|
||||
static void header_handler(TPrinter& p);
|
||||
// @cmember:(INTERNAL) Handler di default del piede di stampa
|
||||
static void footer_handler(TPrinter& p);
|
||||
|
||||
// @cmember Cambia il formato di tutte le date nel form
|
||||
bool ps_change_date_format(TPrint_section& s, const char* f);
|
||||
// @cmember Cambia il formato di tutti i numeri nel form
|
||||
|
@ -33,12 +33,6 @@ HIDDEN TPrint_section& section()
|
||||
return *_cur_sect;
|
||||
}
|
||||
|
||||
HIDDEN TMask& special_mask()
|
||||
{
|
||||
CHECK(_special_mask, "Can't access NULL mask");
|
||||
return *_special_mask;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Gestione TFieldref su maschera
|
||||
// ID CAMPO ATTIVO
|
||||
@ -738,7 +732,7 @@ bool TPrint_section::repos_fields(const char* name, int size)
|
||||
for (word i = 0; i < flds; i++)
|
||||
{
|
||||
TForm_item& f = ps.field(i);
|
||||
ps.field(i).print_on_sheet_row(tt);
|
||||
f.print_on_sheet_row(tt);
|
||||
ms.row(i) = tt;
|
||||
}
|
||||
}
|
||||
@ -1101,7 +1095,7 @@ bool TPrint_section::edit(
|
||||
for (word i = 0; i < flds; i++)
|
||||
{
|
||||
TForm_item& f = field(i);
|
||||
field(i).print_on_sheet_row(tt);
|
||||
f.print_on_sheet_row(tt);
|
||||
// TBI colorare se specials (e vedi se colorare solo se non standard)
|
||||
ms.row(-1) = tt;
|
||||
}
|
||||
@ -1141,7 +1135,9 @@ bool TPrint_section::edit(
|
||||
{
|
||||
TSheet_field& ms = (TSheet_field&)m.field(F_FIELDS);
|
||||
const int items = ms.items();
|
||||
for (int i=0; i<items && !ok; i++)
|
||||
int i;
|
||||
|
||||
for (i=0; i<items && !ok; i++)
|
||||
{
|
||||
TToken_string& tt = ms.row(i);
|
||||
ok = tt.get_char(prn_id - 101)==' ';
|
||||
@ -1268,4 +1264,3 @@ void TPrint_section::print_on(ostream& out) const
|
||||
for(word i = 0; i < fields(); i++)
|
||||
if (!field(i).temp()) out << field(i);
|
||||
}
|
||||
|
@ -12,8 +12,10 @@
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <mapi.h>
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#include "bagn006.h"
|
||||
|
||||
@ -43,7 +45,7 @@ bool goto_url(const char* url)
|
||||
if (app.not_empty())
|
||||
{
|
||||
app << " \"" << url << '"';
|
||||
UINT error = xvt_sys_execute(app, FALSE, FALSE);
|
||||
long error = xvt_sys_execute(app, FALSE, FALSE); //verificare
|
||||
if (error > 32)
|
||||
return TRUE;
|
||||
else
|
||||
@ -126,7 +128,7 @@ bool TGolem_mask::file_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
char ext[_MAX_EXT];
|
||||
char name[_MAX_FNAME];
|
||||
_splitpath(file, NULL, NULL, name, ext);
|
||||
xvt_fsys_parse_pathname(file, NULL, NULL, name, ext, NULL); //verificare
|
||||
file = name; file.ext(ext);
|
||||
m.enable(S_LINK);
|
||||
m.disable(F_NEWREC);
|
||||
@ -162,7 +164,7 @@ bool TGolem_mask::link_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
TFilename name;
|
||||
char ext[_MAX_EXT];
|
||||
_splitpath(url, NULL, NULL, name.get_buffer(), ext);
|
||||
xvt_fsys_parse_pathname(url, NULL, NULL, name.get_buffer(), ext, NULL);
|
||||
if (name.not_empty() && *ext)
|
||||
{
|
||||
name.ext(ext);
|
||||
@ -273,13 +275,17 @@ TGolem_mask::TGolem_mask()
|
||||
const int MAX_ITEMS = ITEMS_PER_ROW * 2;
|
||||
|
||||
// Aggiungi la posta se attiva
|
||||
#ifdef WIN32 // verificare
|
||||
if (GetProfileInt("Mail", "MAPI", 0))
|
||||
{
|
||||
const int items = list.items();
|
||||
const int mmf_pos = (items >= MAX_ITEMS) ? MAX_ITEMS-1 : -1;
|
||||
list.add("mailto", mmf_pos);
|
||||
}
|
||||
|
||||
#else
|
||||
SORRY_BOX(); // verificare
|
||||
#endif
|
||||
|
||||
int i = 0;
|
||||
FOR_EACH_ARRAY_ROW(list, r, row)
|
||||
{
|
||||
@ -405,15 +411,15 @@ bool TGolem_field::autosave(TRelation& r)
|
||||
|
||||
if (old_file != new_file)
|
||||
{
|
||||
const was_stored = old_row.get_char(2) <= ' ' &&
|
||||
golem_path.compare(old_file, golem_path.len(), TRUE) == 0;
|
||||
const tobe_stored = new_row.get_char(2) <= ' ';
|
||||
const bool was_stored = old_row.get_char(2) <= ' ' &&
|
||||
golem_path.compare(old_file, golem_path.len(), TRUE) == 0;
|
||||
const bool tobe_stored = new_row.get_char(2) <= ' ';
|
||||
if (was_stored && fexist(old_file))
|
||||
::remove(old_file);
|
||||
if (tobe_stored && !new_file.blank())
|
||||
{
|
||||
char ext[_MAX_EXT];
|
||||
_splitpath(new_file, NULL, NULL, NULL, ext);
|
||||
xvt_fsys_parse_pathname(new_file, NULL, NULL, NULL, ext, NULL);
|
||||
old_file.temp(golem_path, ext);
|
||||
|
||||
fcopy(new_file, old_file);
|
||||
@ -485,7 +491,7 @@ bool TGolem_field::on_key(KEY key)
|
||||
}
|
||||
|
||||
TGolem_field::TGolem_field(TMask* m)
|
||||
: TEditable_field(m), _selected(0), _old_value(80, '\n')
|
||||
: TEditable_field(m), _old_value(80, '\n'), _selected(0)
|
||||
{ }
|
||||
|
||||
TGolem_field::~TGolem_field()
|
||||
@ -583,12 +589,14 @@ bool TGolem_window::on_key(KEY k)
|
||||
TFilename file; get_current_file(file);
|
||||
if (file != _last_file)
|
||||
{
|
||||
#ifdef WIN32 // verificare
|
||||
if (_last_handle)
|
||||
{
|
||||
if (IsWindow(HWND(_last_handle)))
|
||||
::SendMessage(HWND(_last_handle), WM_CLOSE, 0, 0);
|
||||
_last_handle = NULL;
|
||||
}
|
||||
#endif
|
||||
_last_file = file;
|
||||
|
||||
if (!file.blank() && file.exist())
|
||||
@ -602,9 +610,11 @@ bool TGolem_window::on_key(KEY k)
|
||||
{
|
||||
if (ext == good_ext[i])
|
||||
{
|
||||
#ifdef WIN32 // verificare
|
||||
::GetSystemDirectory(cmd.get_buffer(), cmd.size());
|
||||
cmd.add("viewers");
|
||||
cmd.add("quikview.exe");
|
||||
cmd.add("quikview.exe");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -634,6 +644,7 @@ void TGolem_window::handler(WINDOW win, EVENT* ep)
|
||||
case E_DROP_FILES:
|
||||
if (driver())
|
||||
{
|
||||
#ifdef WIN32 // verificare
|
||||
HDROP hdrop = (HDROP)(DWORD)ep->v.user.ptr;
|
||||
const int num_files = DragQueryFile(hdrop, -1, NULL, 0); // Numero totale di files
|
||||
|
||||
@ -655,6 +666,7 @@ void TGolem_window::handler(WINDOW win, EVENT* ep)
|
||||
}
|
||||
DragFinish(hdrop);
|
||||
driver()->set(file_list);
|
||||
#endif
|
||||
on_key(K_SPACE);
|
||||
}
|
||||
break;
|
||||
@ -676,16 +688,20 @@ TGolem_window::TGolem_window(int x, int y, int dx, int dy, WINDOW parent, TGolem
|
||||
{
|
||||
_pixmap = TRUE;
|
||||
|
||||
#ifdef WIN32 // verificare
|
||||
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
||||
DragAcceptFiles(nat, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
TGolem_window::~TGolem_window()
|
||||
{
|
||||
#ifdef WIN32 // verificare
|
||||
if (_last_handle)
|
||||
PostMessage(HWND(_last_handle), WM_CLOSE, 0, 0);
|
||||
HWND nat = (HWND)xvt_vobj_get_attr(win(), ATTR_NATIVE_WINDOW);
|
||||
DragAcceptFiles(nat, FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
word TGolem_client_field::class_id() const
|
||||
@ -731,6 +747,7 @@ TGolem_client_field::TGolem_client_field(TMask* m)
|
||||
TGolem_client_field::~TGolem_client_field()
|
||||
{ }
|
||||
|
||||
#ifdef WIN32 // verificare
|
||||
///////////////////////////////////////////////////////////
|
||||
// MAPI session
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -765,12 +782,8 @@ public:
|
||||
virtual ~TMAPI_session();
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
const char* const szMAPIDLL = "MAPI32.DLL";
|
||||
const int MAPI_USE_DEFAULT = 0;
|
||||
#else
|
||||
const char* const szMAPIDLL = "MAPI.DLL";
|
||||
#endif
|
||||
const char* const szMAPIDLL = "MAPI32.DLL";
|
||||
const int MAPI_USE_DEFAULT = 0;
|
||||
|
||||
LPMAPILOGON lpfnMAPILogon = NULL;
|
||||
LPMAPILOGOFF lpfnMAPILogoff = NULL;
|
||||
@ -906,7 +919,7 @@ TMAPI_session::~TMAPI_session()
|
||||
// Ripristina directory base
|
||||
SetCurrentDirectory(m_strBaseDir);
|
||||
}
|
||||
|
||||
#endif
|
||||
///////////////////////////////////////////////////////////
|
||||
// TMail_message
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -929,6 +942,7 @@ int TMail_message::add_line(const char* s)
|
||||
|
||||
bool TMail_message::send(TMAPI_session& lhSession, bool hide_ui)
|
||||
{
|
||||
#ifdef WIN32
|
||||
const int MAX_RECIPIENTS = _recipients.items() + _copy_recipients.items() + 1;
|
||||
MapiRecipDesc* msgRecipient = new MapiRecipDesc[MAX_RECIPIENTS];
|
||||
memset(msgRecipient, 0, MAX_RECIPIENTS*sizeof(MapiRecipDesc));
|
||||
@ -994,24 +1008,39 @@ bool TMail_message::send(TMAPI_session& lhSession, bool hide_ui)
|
||||
delete msgAttachment;
|
||||
|
||||
return ok;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_message::send(bool hide_ui)
|
||||
{
|
||||
#ifdef WIN32 //verificare
|
||||
TMAPI_session lhSession; // Open MAPI session
|
||||
return send(lhSession, hide_ui);
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_message::remove(TMAPI_session& lhSession)
|
||||
{
|
||||
#ifdef WIN32 //verificare
|
||||
bool ok = _id.not_empty() && lhSession.remove(_id);
|
||||
return ok;
|
||||
return ok;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_message::remove()
|
||||
{
|
||||
#ifdef WIN32 //verificare
|
||||
TMAPI_session lhSession; // Open MAPI session
|
||||
return remove(lhSession);
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_message::add_recipient_ex(const char* recipient, int type)
|
||||
@ -1089,7 +1118,8 @@ int TMail_messages::get(const char* senderFilter,
|
||||
const char* bodyFilter,
|
||||
bool attach, bool mark)
|
||||
{
|
||||
TMAPI_session lhSession;
|
||||
#ifdef WIN32 //verificare
|
||||
TMAPI_session lhSession;
|
||||
destroy();
|
||||
if (!lhSession.open())
|
||||
return 0;
|
||||
@ -1169,24 +1199,35 @@ int TMail_messages::get(const char* senderFilter,
|
||||
}
|
||||
|
||||
return items();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_messages::send(bool hide_ui)
|
||||
{
|
||||
#ifdef WIN32 //verificare
|
||||
TMAPI_session lhSession;
|
||||
bool ok = TRUE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
ok &= msg(i).send(lhSession, hide_ui);
|
||||
return ok;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool TMail_messages::remove()
|
||||
{
|
||||
#ifdef WIN32 //verificare
|
||||
TMAPI_session lhSession;
|
||||
bool ok = TRUE;
|
||||
for (int i = 0; ok && i < items(); i++)
|
||||
ok &= msg(i).remove(lhSession);
|
||||
return ok;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ TImage::TImage(const TImage& im, short w, short h) : _image(NULL)
|
||||
if (w < 0) w = iw;
|
||||
if (h < 0) h = ih;
|
||||
}
|
||||
set(xvt_image_create(fmt, w, h, NULL));
|
||||
set(xvt_image_create(fmt, w, h, 0L));
|
||||
|
||||
if (ok())
|
||||
{
|
||||
@ -97,7 +97,7 @@ TImage::TImage(const TImage& im, short w, short h) : _image(NULL)
|
||||
// Certified 90%
|
||||
TImage::TImage(short w, short h, XVT_IMAGE_FORMAT fmt) : _image(NULL)
|
||||
{
|
||||
set(xvt_image_create(fmt, w, h, NULL));
|
||||
set(xvt_image_create(fmt, w, h, 0L));
|
||||
}
|
||||
|
||||
// Certified 100%
|
||||
@ -175,7 +175,7 @@ void TImage::set_palette(
|
||||
XVT_PALETTE wp = xvt_vobj_get_palet(w);
|
||||
if (wp != NULL)
|
||||
{
|
||||
XVT_PALETTE p = xvt_palet_create(XVT_PALETTE_USER, NULL);
|
||||
XVT_PALETTE p = xvt_palet_create(XVT_PALETTE_USER, 0L);
|
||||
const int ncolors = xvt_palet_get_ncolors(wp);
|
||||
COLOR* color = new COLOR[ncolors];
|
||||
xvt_palet_get_colors(wp, color, ncolors);
|
||||
|
@ -92,4 +92,4 @@ public:
|
||||
virtual ~TImage();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <config.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include "..\ba\bainsta.h"
|
||||
#include "../ba/bainsta.h"
|
||||
|
||||
// ********************************
|
||||
// classe TSystemtempfile
|
||||
@ -243,8 +243,9 @@ int TSystemtempfile::dump(
|
||||
TArray fld(nflds);
|
||||
TBit_array rjust(nflds);
|
||||
int len[MaxFields];
|
||||
int j;
|
||||
|
||||
for (int j = 0; j < nflds; j++)
|
||||
for (j = 0; j < nflds; j++)
|
||||
{
|
||||
fld.add(TString(curr().fieldname(j)), j);
|
||||
const TString & wfld = (const TString&) fld[j];
|
||||
@ -259,7 +260,7 @@ int TSystemtempfile::dump(
|
||||
TProgind p(nitems, s, TRUE, TRUE, 70);
|
||||
TString s1;
|
||||
|
||||
fprintf(f, "[Header]\nVersion=%ld", prefix().filelevel());
|
||||
fprintf(f, "[Header]\nVersion=%ld", (long) prefix().filelevel());
|
||||
for (int k = 0; k < nflds; k++)
|
||||
{
|
||||
if ((k % 10) == 0) fprintf(f, "\nFields=");
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
|
||||
TMemo_data& operator=(const TMemo_data& m) { copy(m); return *this; }
|
||||
TMemo_data(const TMemo_data& m) { copy(m); }
|
||||
TMemo_data() : _recno(RECORD_NON_FISICO), _isamfile(NULL) { }
|
||||
TMemo_data() : _recno(RECORD_NON_FISICO), _isamfile(0) { }
|
||||
virtual ~TMemo_data() { }
|
||||
};
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
#include <isamrpc.h>
|
||||
|
||||
#define XVAGA
|
||||
#include <netsock.h>
|
||||
|
||||
static TSocketClient* _client = NULL;
|
||||
@ -248,8 +248,8 @@ bool rpc_UserLogin(const char* server, const char* user,
|
||||
}
|
||||
|
||||
const bool local = server == NULL || *server == '\0' ||
|
||||
stricmp(server, "127.0.0.1") == 0 ||
|
||||
stricmp(server, "localhost") == 0;
|
||||
xvt_str_compare_ignoring_case(server, "127.0.0.1") == 0 ||
|
||||
xvt_str_compare_ignoring_case(server, "localhost") == 0;
|
||||
const TString name = local ? "locale" : server;
|
||||
|
||||
if (_connection != 0)
|
||||
|
@ -32,4 +32,4 @@ bool http_post(const char* server, const char* remote_file,
|
||||
byte*& answer, size_t& length);
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include <fstream.h>
|
||||
#ifndef INCSTR_H
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
|
||||
#include <applicat.h>
|
||||
#include <mailbox.h>
|
||||
|
@ -653,7 +653,9 @@ bool TMask::stop_run(
|
||||
if (key != K_AUTO_ENTER && key != K_FORCE_CLOSE)
|
||||
{
|
||||
const int last = fields();
|
||||
for (int i = 0; i < last; i++)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < last; i++)
|
||||
{
|
||||
const TMask_field& f = fld(i);
|
||||
if (f.active() && f.is_kind_of(CLASS_BUTTON_FIELD))
|
||||
@ -727,7 +729,7 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
||||
if (menu != NULL)
|
||||
{
|
||||
const PNT& p = ep->v.mouse.where;
|
||||
xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, NULL);
|
||||
xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, 0); // verificare
|
||||
xvt_res_free_menu_tree(menu);
|
||||
}
|
||||
}
|
||||
@ -1160,7 +1162,7 @@ TCurrency& TMask::get_currency(short fld_id, TCurrency& c) const
|
||||
}
|
||||
else
|
||||
{
|
||||
real n = cf.get();
|
||||
real n(cf.get());
|
||||
c.force_value("");
|
||||
c.set_num(n);
|
||||
}
|
||||
@ -2228,4 +2230,4 @@ TYesnoallnone_box::TYesnoallnone_box(const char * message, int default_key)
|
||||
|
||||
|
||||
TYesnoallnone_box::~TYesnoallnone_box()
|
||||
{}
|
||||
{}
|
||||
|
@ -1590,7 +1590,7 @@ public: // TMask_field
|
||||
public:
|
||||
TField_window& win() const { CHECK(_win, "NULL Window in field"); return *_win; }
|
||||
|
||||
TWindowed_field(TMask* m) : TOperable_field(m), _win(NULL), _dlg(0) { }
|
||||
TWindowed_field(TMask* m) : TOperable_field(m), _dlg(0), _win(NULL) { }
|
||||
virtual ~TWindowed_field();
|
||||
};
|
||||
|
||||
@ -1641,4 +1641,4 @@ public:
|
||||
virtual ~TGolem_client_field();
|
||||
};
|
||||
|
||||
#endif // __MASKFLD_H
|
||||
#endif // __MASKFLD_H
|
||||
|
@ -27,7 +27,7 @@ class TSheet_field;
|
||||
// @doc EXTERNAL
|
||||
|
||||
//typedef (*ROWS_COMPARE_FUNCTION)(const TToken_string&, const TToken_string&);
|
||||
typedef (*ROWS_COMPARE_FUNCTION)(TSheet_field & s, int r1, int r2);
|
||||
typedef int (*ROWS_COMPARE_FUNCTION)(TSheet_field & s, int r1, int r2);
|
||||
|
||||
// @type SPREADSHEET_NOTIFY | Prototipo funzione che gestisce l'ingresso, l'uscita e la modifica da una riga dello sheet
|
||||
typedef bool (*SPREADSHEET_NOTIFY)(TSheet_field& s, int r, KEY k);
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __NETSOCK_H__
|
||||
|
||||
#ifndef __NETUTILS_H__
|
||||
#include "NetUtils.h"
|
||||
#include "netutils.h"
|
||||
#endif
|
||||
|
||||
class TSocketServer : public TLanServer
|
||||
@ -57,4 +57,4 @@ public:
|
||||
virtual ~TSocketClient();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "NetUtils.h"
|
||||
#include "netutils.h"
|
||||
|
||||
TLanManager::TLanManager()
|
||||
{ }
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef __OBJECT_H
|
||||
#define __OBJECT_H
|
||||
|
||||
#ifndef __IOSTREAM_H
|
||||
#include <iostream.h>
|
||||
#ifndef __INCSTR_H
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CLASSES_H
|
||||
|
@ -112,7 +112,7 @@ void TRecord_info::translate_key(TToken_string& t) const// Traduce l'espressione
|
||||
const bool is_upper = ws.find("UPPER") >= 0;
|
||||
const bool is_sub = ws.find("SUBSTR") >= 0;
|
||||
int paren1 = ws.find('('); // Trova la prima parentesi aperta
|
||||
int paren2,last,from,to;
|
||||
int paren2,last,from = 0,to = 0;
|
||||
|
||||
if (paren1 >= 0 && is_sub && is_upper)
|
||||
paren1 = ws.find('('); // Trova la seconda parentesi (in questo caso c'e' per forza)
|
||||
@ -436,9 +436,9 @@ const TFilename& TFile_info::load_filedes()
|
||||
}
|
||||
|
||||
TFile_info::TFile_info(int logicnum, TFilename& name)
|
||||
: _num(logicnum), _handle(-1), _ref_count(0),
|
||||
_locked(FALSE), _exclusive(FALSE),
|
||||
_last_access(0), _last_change(0), _last_key(-1)
|
||||
: _ref_count(0), _num(logicnum), _handle(-1),
|
||||
_last_access(0),
|
||||
_last_change(0), _locked(FALSE), _exclusive(FALSE), _last_key(-1)
|
||||
{
|
||||
if (logicnum < LF_EXTERNAL)
|
||||
{
|
||||
@ -565,7 +565,7 @@ bool TFile_manager::close_oldest()
|
||||
_open_files--;
|
||||
}
|
||||
|
||||
return oldest != NULL;
|
||||
return oldest != 0; //verificare
|
||||
}
|
||||
|
||||
// name : nome del file
|
||||
@ -574,7 +574,9 @@ TIsam_handle TFile_manager::get_handle(TFilename& name)
|
||||
|
||||
TFile_info* i = NULL;
|
||||
TFilename fname(name); fname.ext("");
|
||||
for (int num = LF_EXTERNAL; (i = (TFile_info*)_fileinfo.objptr(num)) != NULL; num++)
|
||||
int num;
|
||||
|
||||
for (num = LF_EXTERNAL; (i = (TFile_info*)_fileinfo.objptr(num)) != NULL; num++)
|
||||
{
|
||||
if (i->pathname() == fname)
|
||||
break;
|
||||
@ -946,13 +948,13 @@ void TPrefix::set(
|
||||
if (strcmp(name, "DEF") == 0)
|
||||
{
|
||||
CGetPref();
|
||||
_splitpath(cprefix, NULL, NULL, _prefix.get_buffer(), NULL);
|
||||
xvt_fsys_parse_pathname(cprefix, NULL, NULL, _prefix.get_buffer(), NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
_prefix = name;
|
||||
if (*name)
|
||||
_makepath(cprefix, NULL, __ptprf, name, NULL);
|
||||
xvt_fsys_build_pathname(cprefix, NULL, __ptprf, name, NULL, NULL);
|
||||
else
|
||||
strcpy(cprefix, "");
|
||||
}
|
||||
@ -1019,7 +1021,7 @@ bool TPrefix::test(long codditta) const
|
||||
{
|
||||
TString16 s("com");
|
||||
if (codditta > 0L)
|
||||
s.format("%05ldA", codditta);
|
||||
s.format("%05lda", codditta);
|
||||
return test(s);
|
||||
}
|
||||
|
||||
@ -1253,7 +1255,6 @@ bool TPrefix::build_firm_data(long codditta, bool flagcom)
|
||||
prefix().set_codditta(codditta);
|
||||
dir.put(i, _nordir, _sysdirop);
|
||||
rec.put(i);
|
||||
const char* name = dir.name();
|
||||
dir.flags() = 0L;
|
||||
create_now = create_now && (flagcom ? dir.is_com() : dir.is_firm());
|
||||
|
||||
|
@ -1,11 +1,7 @@
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
//#include <ctype.h>
|
||||
//#include <stdarg.h>
|
||||
|
||||
#ifndef __LONGDOUBLE__
|
||||
#include <gm.h>
|
||||
#endif
|
||||
|
||||
#include <currency.h>
|
||||
//#include <currency.h>
|
||||
#include <tabutil.h>
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
@ -425,7 +421,8 @@ const char* FLD (const char *tabname, const char *f, const char *picture)
|
||||
TString& fill_str (TString & t, char f)
|
||||
{
|
||||
const int len = t.len();
|
||||
for (int kk = len - 1; kk >= 0; kk--)
|
||||
int kk;
|
||||
for (kk = len - 1; kk >= 0; kk--)
|
||||
if (t[kk] == ' ') t[kk] = f;
|
||||
else break;
|
||||
for (kk = 0; kk < len; kk++)
|
||||
@ -795,7 +792,7 @@ void TPrint_application::set_row (
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
flags |= IGNORE_FILL;
|
||||
flags |= IGNORE_FILL;
|
||||
// fall down
|
||||
case 't':
|
||||
flags |= TRANS_FLAG;
|
||||
@ -930,10 +927,18 @@ void TPrint_application::set_row (
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'G':
|
||||
#ifdef WIN32
|
||||
q.format (formato, islong ? va_arg (params, double) : va_arg (params, float));
|
||||
#else
|
||||
q.format (formato, va_arg (params, double));
|
||||
#endif
|
||||
break;
|
||||
case 'c':
|
||||
#ifdef WIN32
|
||||
q.format (formato, va_arg (params, char));
|
||||
#else
|
||||
q.format (formato, va_arg (params, int));
|
||||
#endif
|
||||
break;
|
||||
case 's':
|
||||
q.format (formato, va_arg (params, char *));
|
||||
@ -965,7 +970,7 @@ void TPrint_application::set_row (
|
||||
#ifdef __LONGDOUBLE__
|
||||
sprintf (q.get_buffer(), formato, (long double)rrr);
|
||||
#else
|
||||
dsprintf (q.get_buffer(), (char*)(const char*)formato, rrr.ptr());
|
||||
rrr.sprintf(q.get_buffer(), (char*)(const char*)formato);
|
||||
#endif
|
||||
}
|
||||
if (rrr.is_zero () && !_print_zero)
|
||||
@ -1156,7 +1161,7 @@ bool TPrint_application::print_tree (link_item * head)
|
||||
|
||||
void TPrint_application::real2currency(TString& s, const real& r, const char* p) const
|
||||
{
|
||||
const TFixed_string pic = (p && *p) ? p : _picture;
|
||||
const TFixed_string pic = (p && *p) ? p : (const char *) _picture;
|
||||
if (!r.is_zero() || _print_zero)
|
||||
{
|
||||
TCurrency c(r);
|
||||
@ -1226,7 +1231,7 @@ bool TPrint_application::print_one (
|
||||
{
|
||||
char pic[36], fn[17];
|
||||
int ch, ln, from, to;
|
||||
|
||||
|
||||
if (t->tag() == 3)
|
||||
{
|
||||
_PrintRowToken* r = (_PrintRowToken*)t;
|
||||
@ -1300,7 +1305,8 @@ bool TPrint_application::print_one (
|
||||
{
|
||||
_Transfield *tr = NULL;
|
||||
// look up field value in translation table
|
||||
for (int i = 0; i < _transtab.items (); i++)
|
||||
int i;
|
||||
for (i = 0; i < _transtab.items (); i++)
|
||||
{
|
||||
tr = (_Transfield *) & _transtab[i];
|
||||
if (tr->_fn == fn && tr->_lognum == ln)
|
||||
@ -1358,12 +1364,12 @@ bool TPrint_application::print_one (
|
||||
toprint = toprint.sub (from, to);
|
||||
else if (to != -1)
|
||||
toprint = toprint.left (to);
|
||||
if (toprint.find('@') >= 0)
|
||||
if (toprint.find('@') >= 0)
|
||||
raddoppia_chiocciole(toprint);
|
||||
}
|
||||
else if (ft->_flags & VALUTA_FLAG)
|
||||
{
|
||||
const real n = f.get(fn);
|
||||
const real n(f.get(fn));
|
||||
real2currency(toprint, n);
|
||||
}
|
||||
}
|
||||
@ -1406,16 +1412,16 @@ bool TPrint_application::print_one (
|
||||
pos[pt->row ()] += v.len ();
|
||||
const char* s = v;
|
||||
while (*s && strncmp(s, "$[", 2) == 0)
|
||||
{
|
||||
{
|
||||
while (*s && *s != ']')
|
||||
{
|
||||
{
|
||||
pos[pt->row()]--;
|
||||
s++;
|
||||
}
|
||||
if (*s)
|
||||
pos[pt->row()]--;
|
||||
while (*s && *s != '$') s++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1478,7 +1484,7 @@ bool TPrint_application::print_one (
|
||||
#ifdef __LONGDOUBLE__
|
||||
sprintf(ps.get_buffer(), fff, (long double)rrr);
|
||||
#else
|
||||
dsprintf(ps.get_buffer(), (char*)fff, rrr.ptr());
|
||||
rrr.sprintf(ps.get_buffer(), (char*)fff);
|
||||
#endif
|
||||
}
|
||||
if (rrr.is_zero () && !_print_zero)
|
||||
@ -1492,9 +1498,9 @@ bool TPrint_application::print_one (
|
||||
ps = fill_str (ps, _fillchar);
|
||||
((TPrintrow *) (&rw[pr->row ()]))->put (ps, pos[pr->row ()]);
|
||||
if (para_str != NULL)
|
||||
{
|
||||
{
|
||||
const char * s = para_str->get();
|
||||
int row = pr->row();
|
||||
int row = pr->row();
|
||||
TPrintstyle xstyle = ((TPrintrow *)(&rw[row]))->get_style();
|
||||
|
||||
while (s != NULL)
|
||||
@ -1599,9 +1605,9 @@ void TPrint_application::disable_setprint_menu()
|
||||
enable_menu_item (BAR_ITEM (1), FALSE);
|
||||
}
|
||||
|
||||
TPrint_application::TPrint_application ():TApplication (), _transtab (10),
|
||||
_cursors (10), _header (10),
|
||||
_footer (10), _rows (100)
|
||||
TPrint_application::TPrint_application ():TApplication (), _rows (100),
|
||||
_cursors (10), _transtab (10), _header (10),
|
||||
_footer (10)
|
||||
{
|
||||
_cur = NULL;
|
||||
_repeat_print = FALSE;
|
||||
|
@ -78,7 +78,7 @@ void TPrinter_setup_mask::fill_font_list()
|
||||
|
||||
void TPrinter_setup_mask::fill_size_list()
|
||||
{
|
||||
const int MAXSIZES = 16;
|
||||
const int MAXSIZES = 128;
|
||||
long sizes[MAXSIZES];
|
||||
BOOLEAN scalable;
|
||||
|
||||
@ -320,8 +320,9 @@ void TPrint_intersector::h_line(int x1, int y1, int len)
|
||||
}
|
||||
|
||||
TString& s = row(y1);
|
||||
int i;
|
||||
|
||||
for (int i = x1; i < x1+len; i++)
|
||||
for (i = x1; i < x1+len; i++)
|
||||
s[i] = f_horizontal();
|
||||
for (i = x1; i < x1+len; i++)
|
||||
s[i] = check_intersection(i, y1, f_horizontal());
|
||||
@ -329,7 +330,8 @@ void TPrint_intersector::h_line(int x1, int y1, int len)
|
||||
|
||||
void TPrint_intersector::v_line(int x1, int y1, int len)
|
||||
{
|
||||
for (int i = y1; i < y1+len; i++)
|
||||
int i;
|
||||
for (i = y1; i < y1+len; i++)
|
||||
{
|
||||
if (objptr(i) == NULL)
|
||||
{
|
||||
@ -532,7 +534,8 @@ HIDDEN int read_int (const char *s, int &n, int &cnt)
|
||||
while (!isdigit (s[cnt]))
|
||||
cnt++;
|
||||
|
||||
for (int j = 0; isdigit (s[cnt]); j++)
|
||||
int j;
|
||||
for (j = 0; isdigit (s[cnt]); j++)
|
||||
nbuf[j] = s[cnt++];
|
||||
nbuf[j] = '\0';
|
||||
|
||||
@ -1149,7 +1152,7 @@ void TPrinter::init_formlen(
|
||||
TString256 spc; spc.fill('m', maxcol);
|
||||
|
||||
_formwidth = maxcol;
|
||||
int w;
|
||||
int w = 0;
|
||||
while (mincol < maxcol )
|
||||
{
|
||||
w = xvt_dwin_get_text_width(prwin, (char*)(const char*)spc, _formwidth);
|
||||
@ -1173,10 +1176,10 @@ void TPrinter::init_formlen(
|
||||
}
|
||||
|
||||
TPrinter::TPrinter()
|
||||
: _date (TODAY), _multiple_link (FALSE), _frozen (FALSE), _isgraphics (TRUE),
|
||||
_lines_per_inch (6), _ch_size (12), _export_header(FALSE),
|
||||
_export_header_len(0), _vf(NULL), _l_offset(0), _c_offset(0), _appendfile(FALSE),
|
||||
_print_rcd(NULL)
|
||||
: _vf(NULL), _ch_size (12), _date (TODAY), _multiple_link (FALSE),
|
||||
_isgraphics (TRUE), _frozen (FALSE), _print_rcd(NULL), _lines_per_inch (6),
|
||||
_l_offset(0), _c_offset(0), _export_header(FALSE), _export_header_len(0),
|
||||
_appendfile(FALSE)
|
||||
|
||||
{
|
||||
_footerhandler = _headerhandler = NULL;
|
||||
@ -1315,7 +1318,7 @@ void TPrinter::read_configuration(
|
||||
{
|
||||
case 1: _printertype = fileprinter; break;
|
||||
case 2: _printertype = screenvis; break;
|
||||
case 3: _printertype = export; break;
|
||||
case 3: _printertype = exportprinter; break;
|
||||
default: _printertype = winprinter; break;
|
||||
}
|
||||
}
|
||||
@ -1472,8 +1475,8 @@ bool TPrinter::printrow(
|
||||
if (_currentpage < _frompage || _currentpage > _topage)
|
||||
return TRUE;
|
||||
|
||||
TString rw (rowtoprint == NULL ? "" : (_printertype == screenvis || _printertype == winprinter ||
|
||||
_printertype == export ?
|
||||
TString rw (rowtoprint == NULL ? "" : ((_printertype == screenvis || _printertype == winprinter ||
|
||||
_printertype == exportprinter) ?
|
||||
rowtoprint->row_codified () :
|
||||
rowtoprint->row ()));
|
||||
rw.rtrim ();
|
||||
@ -1481,7 +1484,7 @@ bool TPrinter::printrow(
|
||||
int lun = rw.len ();
|
||||
int idx;
|
||||
|
||||
if (_printertype != export)
|
||||
if (_printertype != exportprinter)
|
||||
{
|
||||
for (idx = 0; idx < lun; idx++)
|
||||
{
|
||||
@ -1514,7 +1517,7 @@ bool TPrinter::printrow(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (_printertype == winprinter || _printertype == export)
|
||||
if (_printertype == winprinter || _printertype == exportprinter)
|
||||
{
|
||||
// add line to txt
|
||||
if (!_frozen)
|
||||
@ -1558,7 +1561,7 @@ bool TPrinter::print(
|
||||
{
|
||||
bool ok = TRUE;
|
||||
|
||||
if (!(_printertype == export && !_export_header))
|
||||
if (!(_printertype == exportprinter && !_export_header))
|
||||
{
|
||||
if (_currentrow > _formlen - _footersize)
|
||||
ok = printfooter ();
|
||||
@ -1581,7 +1584,9 @@ bool TPrinter::printheader()
|
||||
_headerhandler(*this);
|
||||
|
||||
bool ok = TRUE;
|
||||
for (int i = 0; i < _headersize && ok; i++)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < _headersize && ok; i++)
|
||||
ok = printrow(getheaderline(i));
|
||||
|
||||
// _currentrow = _headersize + 1;
|
||||
@ -1701,7 +1706,7 @@ bool TPrinter::open()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_printertype == winprinter || _printertype == export || _printertype == fileprinter)
|
||||
if (_printertype == winprinter || _printertype == exportprinter || _printertype == fileprinter)
|
||||
{
|
||||
// prepare text object for new text
|
||||
_txt.destroy();
|
||||
@ -1868,7 +1873,7 @@ void TPrinter::close ()
|
||||
|
||||
delete _vf; _vf = NULL;
|
||||
}
|
||||
else if (_printertype == export)
|
||||
else if (_printertype == exportprinter)
|
||||
{
|
||||
if (_exportfile.not_empty() && _txt.lines() > 0L)
|
||||
{
|
||||
@ -2030,7 +2035,9 @@ HIDDEN BOOLEAN calc_font_callback(long data)
|
||||
|
||||
TString test(fd._columns);
|
||||
test.fill('M', fd._columns);
|
||||
for (int size = fd._size; size > 0; size--)
|
||||
int size;
|
||||
|
||||
for (size = fd._size; size > 0; size--)
|
||||
{
|
||||
// Set print font
|
||||
xvt_set_font(win, fd._name, XVT_FS_NONE, size);
|
||||
|
@ -37,7 +37,7 @@ enum TPrtype
|
||||
winprinter = 0, // @emem Stampa su stampante normale
|
||||
fileprinter = 1, // @emem Stampa su file
|
||||
screenvis = 2, // @emem Anteprima a video
|
||||
export = 3 // @emem Esporatzione di stampa
|
||||
exportprinter = 3 // @emem Esporatzione di stampa
|
||||
};
|
||||
|
||||
// @doc EXTERNAL
|
||||
@ -547,7 +547,7 @@ public:
|
||||
// @cmember Dirige la stampa sul file specificato, preservando gli attributi di formato.
|
||||
// Se <p header> = TRUE si stampano su file anche gli header
|
||||
void set_export_file(const char* n, bool header = TRUE, int len = 0)
|
||||
{ _printertype = export; _exportfile = n; _export_header = header; _export_header_len = len;}
|
||||
{ _printertype = exportprinter; _exportfile = n; _export_header = header; _export_header_len = len;}
|
||||
// @cmember Inserisce un file di export fatto da un'altra printer
|
||||
void merge_export_file(const char* file, bool header = TRUE);
|
||||
// @cmember Ritorna il numero di righe disponibili poer la stampa
|
||||
|
@ -48,7 +48,7 @@ void TPrintwin::paint_background(long j)
|
||||
|
||||
TString& rwd = (TString&)(*_bg)[rw];
|
||||
|
||||
while (ch = rwd[cnt++])
|
||||
while ((ch = rwd[cnt++]))
|
||||
{
|
||||
if (!fink_mode && (ch == 'v' || ch == 'o' || ch == 'u' || ch == 'h' || ch == 'r'))
|
||||
continue;
|
||||
@ -246,7 +246,8 @@ void TPrintwin::paint_row(long j)
|
||||
if (*beg)
|
||||
{
|
||||
int len = 0;
|
||||
for (const char * end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++)
|
||||
const char * end;
|
||||
for (end = beg; *end && (*end != ' ' || *(end+1) != ' '); end++)
|
||||
len++; // Misura stringa da stampare
|
||||
xvt_dwin_draw_text(win(), _hofs + LEN_SPACES(win(), pos), y, (char*)beg, len);
|
||||
pos += len;
|
||||
@ -297,8 +298,9 @@ bool TPrintwin::print_band(
|
||||
const int rows = (r.bottom - r.top) / _chary;
|
||||
const int top = r.top / _chary;
|
||||
const long lines = _txt.lines() + _frlc;
|
||||
int k;
|
||||
|
||||
for (int k = top; k < top+rows; k++)
|
||||
for (k = top; k < top+rows; k++)
|
||||
{
|
||||
const long row = first_row + k;
|
||||
if (row < lines && k < _formlen)
|
||||
@ -359,7 +361,7 @@ bool TPrintwin::do_print(word page_from, word page_to, word copies)
|
||||
|
||||
|
||||
TPrintwin::TPrintwin(TTextfile& txt)
|
||||
: _txt(txt), _inited(FALSE), _aborted(FALSE)
|
||||
: _aborted(FALSE), _txt(txt), _inited(FALSE)
|
||||
{
|
||||
TPrinter& p = printer();
|
||||
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember long double | operator long double | | Ritorna il numero reale
|
||||
operator long double () const
|
||||
operator long double () const
|
||||
{ return _dec; }
|
||||
|
||||
// @cmember Trasforma un numero dal formato inglese (decimali con punto) in
|
||||
@ -137,8 +137,8 @@ long double abs(long double a) ;
|
||||
|
||||
#else
|
||||
|
||||
#ifndef __IOSTREAM_H
|
||||
#include <iostream.h>
|
||||
#ifndef INCSTR_H
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
|
||||
#ifndef GMDOTH
|
||||
@ -178,11 +178,11 @@ protected:
|
||||
|
||||
// @access Public Member
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
// @cmember Rimuove gli zeri prima della virgola, aggiustando la precisione
|
||||
void trail( );
|
||||
|
||||
|
||||
// @cmember Trasforma un numero dal formato inglese (decimali con punto) in
|
||||
// formato italiano (decimali con virgola)
|
||||
static const char* eng2ita(char* s);
|
||||
@ -206,7 +206,7 @@ public:
|
||||
const char* stringa(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
||||
// @cmember Ritorna la stringa con il formato passato
|
||||
const char* string(const char* picture) const;
|
||||
|
||||
|
||||
// @cmember Ritorna la precisione del reale (numero di decimali)
|
||||
int precision() const;
|
||||
// @cmember Controlla se si tratta di un reale uguale 0 (TRUE se 0)
|
||||
@ -374,7 +374,7 @@ public:
|
||||
}
|
||||
|
||||
// @cmember Costruttore
|
||||
TDistrib(const real& r,int round=UNDEFINED) : _prog(0.0),_tot(r),_ready(FALSE),_current(0),_decs(round),_slices(4)
|
||||
TDistrib(const real& r,int round=UNDEFINED) : _tot(r), _prog(0.0), _ready(FALSE), _slices(4), _current(0), _decs(round)
|
||||
{}
|
||||
// @cmember Distruttore
|
||||
virtual ~TDistrib()
|
||||
@ -432,7 +432,7 @@ public:
|
||||
}
|
||||
|
||||
// @cmember Costruttore
|
||||
TGeneric_distrib(const real& r,int round=0) : _totslices(0.0),_tot(r),_ready(FALSE),_current(0),_decs(round),_slices(4)
|
||||
TGeneric_distrib(const real& r,int round=0) : _tot(r), _totslices(0.0), _ready(FALSE), _slices(4), _current(0),_decs(round)
|
||||
{}
|
||||
// @cmember Distruttore
|
||||
virtual ~TGeneric_distrib()
|
||||
|
@ -10,13 +10,13 @@
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
TRecord_array::TRecord_array(const TRectype& r, const char* numfield, int first)
|
||||
: _file(r.num()), _num(numfield), _offset(first - 1)
|
||||
: _file(r.num()), _offset(first - 1), _num(numfield)
|
||||
{
|
||||
read(r);
|
||||
}
|
||||
|
||||
TRecord_array::TRecord_array(int logicnum, const char* numfield, int first)
|
||||
: _file(logicnum), _num(numfield), _offset(first - 1)
|
||||
: _file(logicnum), _offset(first - 1), _num(numfield)
|
||||
{
|
||||
set_key(new TRectype(logicnum));
|
||||
}
|
||||
@ -338,7 +338,8 @@ int TRecord_array::write(bool re) const
|
||||
|
||||
//TRectype* rec = (TRectype*)key().dup();
|
||||
CHECK(u<1 || !key().empty(), "Can't write rows using an empty key");
|
||||
for (int i = 1; i <= u; i++)
|
||||
int i;
|
||||
for (i = 1; i <= u; i++)
|
||||
{
|
||||
const TRectype* r = (TRectype*)_data.objptr(i);
|
||||
|
||||
@ -423,7 +424,7 @@ void TFile_cache::stats(unsigned long& h, unsigned long& m)
|
||||
|
||||
TFile_cache::TFile_cache(TLocalisamfile *f , int key)
|
||||
: _file(NULL), _key(key), _last_firm(-883),
|
||||
_test_changes(FALSE), _last_read(0), _limit(0)
|
||||
_last_read(0), _limit(0), _test_changes(FALSE)
|
||||
{
|
||||
_filecode << f->num();
|
||||
init_file(f);
|
||||
@ -432,7 +433,7 @@ TFile_cache::TFile_cache(TLocalisamfile *f , int key)
|
||||
|
||||
TFile_cache::TFile_cache(int num, int key)
|
||||
: _file(NULL), _key(key), _last_firm(-883),
|
||||
_test_changes(FALSE), _last_read(0), _limit(0)
|
||||
_last_read(0), _limit(0), _test_changes(FALSE)
|
||||
{
|
||||
_filecode << num;
|
||||
_last_change_test = clock();
|
||||
@ -440,7 +441,7 @@ TFile_cache::TFile_cache(int num, int key)
|
||||
|
||||
TFile_cache::TFile_cache(const char* tab, int key)
|
||||
: _file(NULL), _key(key), _last_firm(-883),
|
||||
_test_changes(FALSE), _last_read(0), _limit(0)
|
||||
_last_read(0), _limit(0), _test_changes(FALSE)
|
||||
{
|
||||
_filecode = tab;
|
||||
_last_change_test = clock();
|
||||
|
@ -101,7 +101,5 @@ enum TIsamerr {
|
||||
_istrcerr = 227 // @emem Tracciato record incoerente
|
||||
};
|
||||
|
||||
typedef long TRecnotype;
|
||||
|
||||
#endif // __RECTYPES_H
|
||||
|
||||
|
@ -1826,13 +1826,15 @@ void TRelation_application::sheet2ini(TSheet_field &sheet,TConfig& ini)
|
||||
// scrive le righe degli sheet associati
|
||||
TString16 defpar;
|
||||
TString str;
|
||||
for (int r = 1 ; r <= sheet.items(); r++)
|
||||
int r;
|
||||
|
||||
for (r = 1 ; r <= sheet.items(); r++)
|
||||
{
|
||||
defpar.format("%d,%d", lognum, r);
|
||||
|
||||
TMask_field* fkey;
|
||||
sheet.restart_key();
|
||||
while (fkey = sheet.get_key(str))
|
||||
while ((fkey = sheet.get_key(str)))
|
||||
{
|
||||
ini.set(str, fkey->get(), defpar);
|
||||
}
|
||||
@ -1906,7 +1908,7 @@ void TRelation_application::mask2ini(const TMask& m, TConfig& ini)
|
||||
{
|
||||
if (campo.class_id() == CLASS_DATE_FIELD && campo.right_justified())
|
||||
{
|
||||
const TDate d = campo.get();
|
||||
const TDate d(campo.get());
|
||||
fr->write(ini, defpar, d.string(ANSI));
|
||||
}
|
||||
else
|
||||
|
@ -88,8 +88,8 @@ public:
|
||||
TRelationdef::TRelationdef(const TRelation* rel, int idx_file, byte key,
|
||||
int idx_to, const char* relexprs, int alias,
|
||||
bool allow_lock)
|
||||
: _num(idx_file), _key(key), _numto(idx_to),
|
||||
_rel(rel), _fields(4), _exprs(4), _alias(alias),
|
||||
: _rel(rel), _num(idx_file), _numto(idx_to),
|
||||
_alias(alias), _key(key), _fields(4), _exprs(4),
|
||||
_first_match(FALSE), _allow_lock(allow_lock),
|
||||
_write_enable(FALSE)
|
||||
{
|
||||
@ -287,7 +287,8 @@ void TRelation::print_on(ostream& out) const
|
||||
|
||||
void TRelation::restore_status()
|
||||
{
|
||||
// _status.restart();
|
||||
int i;
|
||||
|
||||
for (int i = _files.last(); i >= 0 ; i--)
|
||||
{
|
||||
const int err = _status.get_int(i*3);
|
||||
@ -310,7 +311,8 @@ void TRelation::restore_status()
|
||||
void TRelation::save_status()
|
||||
{
|
||||
_status.cut(0);
|
||||
for (int i = 0; i < _files.items(); i++)
|
||||
int i;
|
||||
for (i = 0; i < _files.items(); i++)
|
||||
{
|
||||
const int err = file(i).status();
|
||||
const TRecnotype recno = file(i).eof() ? -1l : file(i).recno();
|
||||
@ -680,11 +682,11 @@ bool TRelation::next_match(
|
||||
const int i = log2ind(logicnum);
|
||||
CHECKD(i != NOTFOUND,"Nonexistent file referenced in relation ",logicnum);
|
||||
|
||||
for (int j = 0; j < _reldefs.items(); j++)
|
||||
int j;
|
||||
for (j = 0; j < _reldefs.items(); j++)
|
||||
if (reldef(j).num() == i) break;
|
||||
|
||||
TLocalisamfile& from = file(i);
|
||||
TLocalisamfile& to = file(reldef(j).link());
|
||||
|
||||
reldef(j)._first_match = FALSE;
|
||||
|
||||
@ -722,7 +724,8 @@ bool TRelation::next_match(
|
||||
from.setkey(nkey);
|
||||
TToken_string fields(fieldlist);
|
||||
TToken_string old(80);
|
||||
for (const char* f = fields.get(0); f; f = fields.get())
|
||||
const char * f;
|
||||
for (f = fields.get(0); f; f = fields.get())
|
||||
old.add(from.curr().get(f));
|
||||
|
||||
from.next();
|
||||
@ -800,10 +803,10 @@ bool TRelation::isconsistent(
|
||||
|
||||
{
|
||||
const int MAXREL = 24;
|
||||
int bad = 0;
|
||||
int bad = 0, i;
|
||||
TRecnotype recnos[MAXREL];
|
||||
|
||||
for (int i = 0; i < _files.items() && i < MAXREL; i++)
|
||||
for (i = 0; i < _files.items() && i < MAXREL; i++)
|
||||
{
|
||||
// must be file OK, non-empty record
|
||||
bad |= file(i).good() || file(i).curr().empty();
|
||||
@ -996,7 +999,7 @@ bool TCursor::has_simple_filter() const
|
||||
const KeyDes& kd = recd.Ky[_nkey-1]; // Elenco dei campi della chiave del cursore
|
||||
for (int i = _fexpr->numvar()-1; yes && i >= 0; i--)
|
||||
{
|
||||
const TString& vn = _fexpr->varname(i);
|
||||
const char * vn = _fexpr->varname(i);
|
||||
TFieldref f(vn, 0);
|
||||
yes = f.file() == 0;
|
||||
if (yes)
|
||||
@ -1145,7 +1148,9 @@ bool TCursor::simple_filtercursor(const char* key) const
|
||||
len -= f.from();
|
||||
char* val = (char*)(key+offset);
|
||||
char oldchar = '\0';
|
||||
for (int l = len; l >= 0; l--) // rtrim
|
||||
int l;
|
||||
|
||||
for (l = len; l >= 0; l--) // rtrim
|
||||
{
|
||||
if (l == 0 || val[l-1] != ' ')
|
||||
{
|
||||
@ -1162,7 +1167,8 @@ bool TCursor::simple_filtercursor(const char* key) const
|
||||
case _intfld:
|
||||
case _longfld:
|
||||
{
|
||||
for (const char* v = val; *v == ' ' || *v == '0'; v++);
|
||||
const char* v;
|
||||
for (v = val; *v == ' ' || *v == '0'; v++);
|
||||
_fexpr->setvar(i, v);
|
||||
}
|
||||
break;
|
||||
@ -1350,7 +1356,7 @@ void TCursor::filter(
|
||||
const int items = _fexpr->numvar();
|
||||
for (int i = 0 ; i < items; i++)
|
||||
{
|
||||
const TString & vn = _fexpr->varname(i);
|
||||
const char * vn = _fexpr->varname(i); //occhio
|
||||
if (vn[0] != '#')
|
||||
{
|
||||
TFieldref f(vn, 0);
|
||||
@ -1513,8 +1519,8 @@ TRecnotype TCursor::read(TIsamop op, TReclock lockop)
|
||||
|
||||
TCursor::TCursor(TRelation* r, const char* fil, int nkey,
|
||||
const TRectype *from, const TRectype* to, int tilde)
|
||||
: _if(r), _nkey(nkey), _frozen(FALSE), _filterfunction(NULL), _fexpr(NULL),
|
||||
_filter_update(FALSE), _filterfunction_update(FALSE), _filter_limit(0)
|
||||
: _if(r), _nkey(nkey), _fexpr(NULL), _frozen(FALSE), _filter_update(FALSE),
|
||||
_filterfunction_update(FALSE), _filter_limit(0), _filterfunction(NULL)
|
||||
{
|
||||
file().setkey(_nkey);
|
||||
_pos = 0;
|
||||
@ -1751,7 +1757,6 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
|
||||
{
|
||||
TRecnotype oldrecno=0,pos,ap = 0;
|
||||
int abspos=0,junk, l, pagecnt = 0;
|
||||
const bool filtered = has_filter();
|
||||
TString s;
|
||||
FILE* _f = NULL;
|
||||
|
||||
@ -2136,7 +2141,7 @@ static TString buffer;
|
||||
|
||||
const char* TFieldref::read(TConfig& ini, const char* defpar) const
|
||||
{
|
||||
ini.set_paragraph(_id.empty() ? defpar : _id);
|
||||
ini.set_paragraph(_id.empty() ? defpar : (const char *) _id);
|
||||
|
||||
if (!ini.exist(_name))
|
||||
return "";
|
||||
@ -2207,7 +2212,7 @@ void TFieldref::write(TConfig& ini, const char* defpar, const char* val) const
|
||||
if ((val == NULL || *val == '\0') && !ini.exist(_name))
|
||||
return;
|
||||
|
||||
const char* para = _id.empty() ? defpar : _id;
|
||||
const char* para = _id.empty() ? defpar : (const char *) _id;
|
||||
if (_from > 0 || _to > 0)
|
||||
{
|
||||
buffer = ini.get(_name, para);
|
||||
@ -2650,7 +2655,7 @@ const char* TRelation_description::get_field_description(const char* field)
|
||||
|
||||
|
||||
TRelation_description::TRelation_description(TRelation& r)
|
||||
: _rel(&r), _menu(FALSE), _cur_file(0), _cur_field(0),
|
||||
: _rel(&r), _cur_file(0), _cur_field(0), _menu(FALSE),
|
||||
_cfile(80), _cfield(80)
|
||||
{
|
||||
read_rel();
|
||||
|
@ -10,10 +10,14 @@ inline char match(char c)
|
||||
{ return (c == '{') ? '}' : c; }
|
||||
|
||||
TScanner::TScanner(const char* filename)
|
||||
: _pushed(FALSE), _line(0),
|
||||
_token(128), _key(2), _tmp(1024*8)
|
||||
: _token(128), _key(2),
|
||||
_tmp(1024*8), _pushed(FALSE), _line(0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
open(filename, ios::in | ios::nocreate, filebuf::sh_read);
|
||||
#else
|
||||
open(filename, ios::in);
|
||||
#endif
|
||||
if (fail())
|
||||
fatal_box("Impossibile leggere il file '%s'", filename);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef __SCANNER_H
|
||||
#define __SCANNER_H
|
||||
|
||||
#ifndef __FSTREAM_H
|
||||
#include <fstream.h>
|
||||
#ifndef INCSTR_H
|
||||
#include <incstr.h>
|
||||
#endif
|
||||
|
||||
#ifndef __STRINGS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user