Fix build against wxWidgets older than 3.1.1

This commit is contained in:
Lukas Matena 2021-03-01 10:03:49 +01:00
parent b10d064a24
commit 3f1299c9b7

View File

@ -819,7 +819,22 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
wxArrayInt sel_printers;
int sel_printers_count = list_printer->GetSelections(sel_printers);
if (sel_printers != sel_printers_prev) {
// Does our wxWidgets version support operator== for wxArrayInt ?
// https://github.com/prusa3d/PrusaSlicer/issues/5152#issuecomment-787208614
#if wxCHECK_VERSION(3, 1, 1)
if (sel_printers != sel_printers_prev) {
#else
auto are_equal = [](const wxArrayInt& arr_first, const wxArrayInt& arr_second) {
if (arr_first.GetCount() != arr_second.GetCount())
return false;
for (size_t i = 0; i < arr_first.GetCount(); i++)
if (arr_first[i] != arr_second[i])
return false;
return true;
};
if (!are_equal(sel_printers, sel_printers_prev)) {
#endif
// Refresh type list
list_type->Clear();
list_type->append(_L("(All)"), &EMPTY);