Patch level : 10.0 204

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

0001095: Calendario festività non tiene in memoria modifiche


git-svn-id: svn://10.65.10.50/trunk@18000 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-01-09 12:42:52 +00:00
parent 04aa6ce768
commit e581b5b559
3 changed files with 13 additions and 20 deletions

View File

@ -15,6 +15,7 @@ public:
// ereditato da TAlmanac_mask
virtual bool is_date_void(int currpage, const TDate& cdate);
virtual void change_year(int newyear);
const TLavanderie_calendar & calendario() const { return _cal; }
// metodi di accesso
void update_current_calendar(int year);
@ -33,9 +34,6 @@ bool TConf_lavanderie_mask::on_field_event(TOperable_field& o, TField_event e, l
switch (o.dlg())
{
case DLG_OK:
if (e == fe_button)
_cal.write();
break;
default:
TAlmanac_mask::on_field_event(o, e, jolly);
break;
@ -161,7 +159,8 @@ void TConf_Lavanderie::save_mask(bool tosave)
v.remove(name);
}
TMask& m=*get_mask();
TConf_lavanderie_mask & m = (TConf_lavanderie_mask &) *get_mask();
FOR_EACH_MASK_SHEET(m, i, s)
{
TMask& sm=s->sheet_mask();
@ -178,8 +177,8 @@ void TConf_Lavanderie::save_mask(bool tosave)
}
}
}
m.calendario().write();
}
int lv0300(int argc, char* argv[])

View File

@ -482,7 +482,6 @@ void TLavanderie_calendar::set_holiday(const TDate & date, bool holiday)
long ndays = date - inizio;
_days.set(ndays, holiday);
_dirty = true;
}
}
@ -527,19 +526,15 @@ int TLavanderie_calendar::read(int year)
int TLavanderie_calendar::write() const
{
if (_dirty)
{
TString val(255);
const TDate inizio(1, 1, _year);
const TDate fine(31, 12, _year);
TDate data(inizio);
TConfig cfg(CONFIG_DITTA);
TString val(255);
const TDate inizio(1, 1, _year);
const TDate fine(31, 12, _year);
TDate data(inizio);
TConfig cfg(CONFIG_DITTA);
for (int i = 0; data <= fine; ++data, i++)
val << (_days[i] ? 'X' : ' ');
cfg.set("CAL", val, "lv", true, _year);
}
((TLavanderie_calendar *)this)->_dirty = false;
for (int i = 0; data <= fine; ++data, i++)
val << (_days[i] ? 'X' : ' ');
cfg.set("CAL", val, "lv", true, _year);
return NOERR;
}
@ -557,7 +552,7 @@ int TLavanderie_calendar::remove() const
return NOERR;
}
TLavanderie_calendar::TLavanderie_calendar(const int year) : _year(year), _dirty(false)
TLavanderie_calendar::TLavanderie_calendar(const int year) : _year(year)
{
read();
}

View File

@ -105,7 +105,6 @@ class TLavanderie_calendar : public TObject
{
int _year;
TBit_array _days;
bool _dirty;
public:
int read(int year = 0);