diff --git a/include/date.cpp b/include/date.cpp index 596b0f015..1c68f7f77 100755 --- a/include/date.cpp +++ b/include/date.cpp @@ -643,8 +643,7 @@ const char* itow( // giorno corrispondente a tale cifra (es. 15 = "Lunedi") { const char* nomi[7] = - { "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", - "Sabato", "Domenica" }; + { "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato", "Domenica" }; return nomi[(d-1) % 7]; } diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 6f0bae717..7de57fc03 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -1496,11 +1496,14 @@ void TSpreadsheet::mask2str(int rec) { r.add(f.get()); #if XVT_OS == XVT_OS_WIN - const int col = id-FIRST_FIELD; - if (!_column_disabled[col]) + if (active()) { - const bool on = f.enabled(); - enable_cell(rec, col, on); + const int col = id-FIRST_FIELD; + if (!_column_disabled[col]) + { + const bool on = f.enabled(); + enable_cell(rec, col, on); + } } #endif break; @@ -1741,7 +1744,7 @@ void TSpreadsheet::str2mask(int riga) const int index = (id % 100)-1; val = r.get(index); f.set(val); - const bool on = !cell_disabled(riga, index); + const bool on = active() && !cell_disabled(riga, index); if (f.enabled() != on) f.enable(on); } @@ -1786,17 +1789,6 @@ bool TSpreadsheet::notify(int rec, KEY k) return ok; } - -HIDDEN void enable_mask_fields(TMask& m, bool on) -{ - for (int i = m.fields()-1; i >= 0; i--) - { - TMask_field& f = m.fld(i); - if (f.dlg() >= FIRST_FIELD && f.enabled_default()) - f.enable(on); - } -} - // Certified 99% #if XVT_OS != XVT_OS_WIN KEY TSpreadsheet::edit(int n, KEY tasto) @@ -1840,13 +1832,7 @@ KEY TSpreadsheet::edit(int n, KEY tasto) } else { - if (!active()) // Se lo sheet e' read only ... - enable_mask_fields(sheet_mask(), FALSE); // ... disabilita tutti i campi - k = sheet_mask().run(); // Esegue la maschera dello sheet - - if (!active()) // Se lo sheet e' read only ... - enable_mask_fields(sheet_mask(), TRUE); // ... riabilita tutti i campi } if (active)