Fixes how Batch Processing Add/Set values behave when count of entries in AdjusterBehavior in options file does not match ADDSET_PARAM_NUM, #2710

This commit is contained in:
Morgan Hardwood
2017-08-01 17:21:20 +02:00
parent 10822f5c2e
commit 15eb7e990c
2 changed files with 120 additions and 121 deletions

View File

@@ -1987,16 +1987,15 @@ void Preferences::fillPreferences ()
addc.block (true);
setc.block (true);
if (moptions.baBehav.size() == ADDSET_PARAM_NUM) {
for (size_t i = 0; i < moptions.baBehav.size(); i++)
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++)
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++)
if (adjs->get_value (behavColumns.addsetid) == (int)i) {
adjs->set_value (behavColumns.badd, moptions.baBehav[i] == 1);
adjs->set_value (behavColumns.bset, moptions.baBehav[i] != 1);
break;
}
}
moptions.baBehav.resize (ADDSET_PARAM_NUM);
for (size_t i = 0; i < moptions.baBehav.size(); i++)
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++)
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++)
if (adjs->get_value (behavColumns.addsetid) == (int)i) {
adjs->set_value (behavColumns.badd, moptions.baBehav[i] == 1);
adjs->set_value (behavColumns.bset, moptions.baBehav[i] != 1);
break;
}
addc.block (false);
setc.block (false);