diff --git a/ci/ci2300.cpp b/ci/ci2300.cpp index 45a68ebb0..5ab6e55e5 100755 --- a/ci/ci2300.cpp +++ b/ci/ci2300.cpp @@ -519,7 +519,7 @@ TImporta_rilore_rec::TImporta_rilore_rec(TFilename& filename) class TImporta_rilore_msk : public TAutomask { TAssoc_array _matricole; - TAssoc_array _ore; + TArray _ore; protected: void importa(); @@ -528,7 +528,7 @@ protected: public: TAssoc_array & matricole() {return _matricole;} - TAssoc_array & ore() {return _ore;} + TArray & ore() {return _ore;} TImporta_rilore_msk(); }; @@ -570,8 +570,10 @@ void TImporta_rilore_msk::importa() { key = "R"; tpora = "0000"; - if (ore().is_key(tpora)) - tpora = (TString &) ore()[tpora]; + const int index = atoi(tpora); + + if (ore().objptr(index) != NULL) + tpora = (TString &) ore()[index]; msg_head = data.string(); msg_head << " Addetto - " << codice; key << codice << data.string(ANSI) << tpora; // cambiare @@ -594,11 +596,14 @@ void TImporta_rilore_msk::importa() { fieldname.format("%02d_%s%1d", i, CODGIU, t); tpora = recordset.get(fieldname).as_string(); - if (atoi(tpora) > 0) + + const int index = atoi(tpora); + + if (index > 0) { - if (ore().is_key(tpora)) + if (ore().objptr(index) != NULL) { - tpora = (TString &) ore()[tpora]; + tpora = (TString &) ore()[index]; fieldname.format("%02d_%s%1d", i, OREGIU, t); oreril = recordset.get(fieldname).as_real() / CENTO; @@ -685,14 +690,10 @@ static bool scan_rss(const TRelation & rel, void *pJolly) static bool scan_ore(const TRelation & rel, void *pJolly) { TImporta_rilore_msk & mask = *((TImporta_rilore_msk *)pJolly); - TString80 cod_est = rel.curr().get("S1"); - - if (cod_est.full()) - { - const TString16 codice = rel.curr().get("CODTAB"); + const int cod_est = atoi(rel.curr().get("S1")); + const TString& codice = rel.curr().get("CODTAB"); - mask.ore().add(cod_est, codice); - } + mask.ore().add(codice, cod_est); return true; }