diff --git a/include/config.cpp b/include/config.cpp index 7cb8485bb..98bce36e5 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -53,7 +53,7 @@ bool TConfig::_read_paragraph() if (val[0] == '%') { if (val == "%yr%") val.format("%04d", TDate(TODAY).year()); else - if (val == "%frm%") val.format("%05ld", main_app().get_firm()); + if (val == "%frm%") val.format("%05ld", prefix().get_codditta()); } // sostituzione abilitata _data.add(key,val,TRUE); @@ -431,7 +431,7 @@ TConfig::TConfig(int which_config, const char* paragraph) break; case CONFIG_USER: case CONFIG_STAMPE: - _file = main_app().get_firm_dir(); + _file = firm2dir(0); if (_file.not_empty()) { for (int i = _file.len()-1; i >= 0; i--) diff --git a/include/relapp.h b/include/relapp.h index 0e4875bab..644f396fd 100755 --- a/include/relapp.h +++ b/include/relapp.h @@ -95,7 +95,7 @@ protected: virtual void init_modify_mode(TMask&) { } // Inizializza la maschera per il modo modifica virtual bool force_cursor_usage() const { return FALSE;} - virtual void write_enable(const bool on = TRUE) { get_relation()->write_enable(-1, on); } + virtual void write_enable(bool on = TRUE) { get_relation()->write_enable(0, on); } void write_disable() { write_enable(FALSE); } virtual bool save_and_new() const; diff --git a/include/relation.cpp b/include/relation.cpp index cb4362662..952cbf28d 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1,4 +1,4 @@ -// $Id: relation.cpp,v 1.43 1995-05-30 16:01:34 guy Exp $ +// $Id: relation.cpp,v 1.44 1995-06-01 09:09:18 guy Exp $ // relation.cpp // fv 12/8/93 // relation class for isam files @@ -87,18 +87,18 @@ public: TRelationdef(const TRelation* rel, int file, byte key, int linkto, const char* relexprs, int alias, - bool allow_lock, bool write_enable = FALSE); + bool allow_lock); virtual ~TRelationdef() {} }; TRelationdef::TRelationdef(const TRelation* rel, int idx_file, byte key, int idx_to, const char* relexprs, int alias, - bool allow_lock, bool write_enable) + bool allow_lock) : _num(idx_file), _key(key), _numto(idx_to), _rel(rel), _fields(4), _exprs(4), _alias(alias), _first_match(FALSE), _allow_lock(allow_lock), - _write_enable(write_enable) + _write_enable(FALSE) { TToken_string rels(relexprs); int i = 0; @@ -374,7 +374,7 @@ TLocalisamfile& TRelation::lfile(const char* name) const void TRelation::write_enable(int logicnum, const bool on) { - if (logicnum == - 1) + if (logicnum == 0) { for (int i = 0; i < _reldefs.items(); i++) reldef(i).write_enable(on); @@ -382,8 +382,8 @@ void TRelation::write_enable(int logicnum, const bool on) else { const int idx = log2ind(logicnum); - CHECKD(idx != NOTFOUND, "File not found n. ", logicnum); - reldef(idx).write_enable(on); + CHECKD(idx > 0, "File not found n. ", logicnum); + reldef(idx-1).write_enable(on); } } @@ -391,8 +391,8 @@ void TRelation::write_enable(const char* name, const bool on) { const int idx = name2ind(name); - CHECKS(idx != NOTFOUND, "File or Table not found:", name); - reldef(idx).write_enable(on); + CHECKS(idx > 0, "File or Table not found:", name); + reldef(idx-1).write_enable(on); } @@ -442,9 +442,7 @@ TRectype& TRelationdef::load_rec(TRectype& r, const TBaseisamfile& from) const for (int j = 0 ; j < _fields.items(); j++) // for each field { - TFieldref& s = (TFieldref&) _fields[j]; - s.write(s.read(from.curr()),r); } diff --git a/include/relation.h b/include/relation.h index a991605a1..beb4fe61e 100755 --- a/include/relation.h +++ b/include/relation.h @@ -1,4 +1,4 @@ -/* $Id: relation.h,v 1.19 1995-05-30 16:01:36 guy Exp $ */ +/* $Id: relation.h,v 1.20 1995-06-01 09:09:21 guy Exp $ */ // join.h // fv 12/8/93 // join class for isam files @@ -52,9 +52,9 @@ public: TLocalisamfile& lfile(int logicnum = 0) const; TLocalisamfile& lfile(const char* name) const; - void write_enable(int logicnum = -1, const bool on = TRUE) ; + void write_enable(int logicnum = 0, const bool on = TRUE) ; void write_enable(const char* name, const bool on = TRUE) ; - void write_disable(int logicnum = -1) { write_enable(logicnum, FALSE); } + void write_disable(int logicnum = 0) { write_enable(logicnum, FALSE); } void write_disable(const char* name) { write_enable(name, FALSE); } TRectype& curr(int logicnum = 0) const { return lfile(logicnum).curr(); } diff --git a/include/viswin.cpp b/include/viswin.cpp index d7b213365..4a94b72f0 100755 --- a/include/viswin.cpp +++ b/include/viswin.cpp @@ -2287,9 +2287,9 @@ TViswin::TViswin(const char *fname, if (_toplevel) { // load info from config on buttons and rulers - TConfig cnf (CONFIG_GENERAL, "Visualizzazione"); - _showbuts = cnf.get("Bottoni",NULL,-1,"X") == "X"; - _rulers = cnf.get("Righelli",NULL,-1,"X") == "X"; + TConfig cnf(CONFIG_USER, "Visualizzazione"); + _showbuts = cnf.get_bool("Bottoni", NULL, -1,TRUE); + _rulers = cnf.get_bool("Righelli", NULL, -1,TRUE); } const int larg = 76; diff --git a/include/xvtility.cpp b/include/xvtility.cpp index f329d85a9..23133a8d7 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -557,7 +557,7 @@ void dispatch_e_scroll(WINDOW win, KEY key) void customize_controls(bool on) { - TConfig colors(CONFIG_GENERAL, "Colors"); + TConfig colors(CONFIG_USER, "Colors"); MASK_BACK_COLOR = colors.get_color("MaskBack", NULL, -1, MASK_BACK_COLOR); MASK_LIGHT_COLOR = colors.get_color("MaskLight", NULL, -1, MASK_LIGHT_COLOR); @@ -630,7 +630,7 @@ XVT_FNTID xvt_default_font() NormalFont = GetStockObject(ANSI_FIXED_FONT); GetObject(NormalFont, sizeof(LOGFONT), &LogFont); - TConfig font(CONFIG_GENERAL, "Font"); + TConfig font(CONFIG_USER, "Font"); CHARY = (int)font.get_long("Height"); if (CHARY > 0) {