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:
parent
04aa6ce768
commit
e581b5b559
@ -15,6 +15,7 @@ public:
|
|||||||
// ereditato da TAlmanac_mask
|
// ereditato da TAlmanac_mask
|
||||||
virtual bool is_date_void(int currpage, const TDate& cdate);
|
virtual bool is_date_void(int currpage, const TDate& cdate);
|
||||||
virtual void change_year(int newyear);
|
virtual void change_year(int newyear);
|
||||||
|
const TLavanderie_calendar & calendario() const { return _cal; }
|
||||||
|
|
||||||
// metodi di accesso
|
// metodi di accesso
|
||||||
void update_current_calendar(int year);
|
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())
|
switch (o.dlg())
|
||||||
{
|
{
|
||||||
case DLG_OK:
|
case DLG_OK:
|
||||||
if (e == fe_button)
|
|
||||||
_cal.write();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
TAlmanac_mask::on_field_event(o, e, jolly);
|
TAlmanac_mask::on_field_event(o, e, jolly);
|
||||||
break;
|
break;
|
||||||
@ -161,7 +159,8 @@ void TConf_Lavanderie::save_mask(bool tosave)
|
|||||||
v.remove(name);
|
v.remove(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
TMask& m=*get_mask();
|
TConf_lavanderie_mask & m = (TConf_lavanderie_mask &) *get_mask();
|
||||||
|
|
||||||
FOR_EACH_MASK_SHEET(m, i, s)
|
FOR_EACH_MASK_SHEET(m, i, s)
|
||||||
{
|
{
|
||||||
TMask& sm=s->sheet_mask();
|
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[])
|
int lv0300(int argc, char* argv[])
|
||||||
|
@ -482,7 +482,6 @@ void TLavanderie_calendar::set_holiday(const TDate & date, bool holiday)
|
|||||||
long ndays = date - inizio;
|
long ndays = date - inizio;
|
||||||
|
|
||||||
_days.set(ndays, holiday);
|
_days.set(ndays, holiday);
|
||||||
_dirty = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,8 +526,6 @@ int TLavanderie_calendar::read(int year)
|
|||||||
|
|
||||||
int TLavanderie_calendar::write() const
|
int TLavanderie_calendar::write() const
|
||||||
{
|
{
|
||||||
if (_dirty)
|
|
||||||
{
|
|
||||||
TString val(255);
|
TString val(255);
|
||||||
const TDate inizio(1, 1, _year);
|
const TDate inizio(1, 1, _year);
|
||||||
const TDate fine(31, 12, _year);
|
const TDate fine(31, 12, _year);
|
||||||
@ -538,8 +535,6 @@ int TLavanderie_calendar::write() const
|
|||||||
for (int i = 0; data <= fine; ++data, i++)
|
for (int i = 0; data <= fine; ++data, i++)
|
||||||
val << (_days[i] ? 'X' : ' ');
|
val << (_days[i] ? 'X' : ' ');
|
||||||
cfg.set("CAL", val, "lv", true, _year);
|
cfg.set("CAL", val, "lv", true, _year);
|
||||||
}
|
|
||||||
((TLavanderie_calendar *)this)->_dirty = false;
|
|
||||||
return NOERR;
|
return NOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +552,7 @@ int TLavanderie_calendar::remove() const
|
|||||||
return NOERR;
|
return NOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
TLavanderie_calendar::TLavanderie_calendar(const int year) : _year(year), _dirty(false)
|
TLavanderie_calendar::TLavanderie_calendar(const int year) : _year(year)
|
||||||
{
|
{
|
||||||
read();
|
read();
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,6 @@ class TLavanderie_calendar : public TObject
|
|||||||
{
|
{
|
||||||
int _year;
|
int _year;
|
||||||
TBit_array _days;
|
TBit_array _days;
|
||||||
bool _dirty;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int read(int year = 0);
|
int read(int year = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user