Skip to content

Commit

Permalink
[win32] RP_ShellPropSheetExt_Private::initDialog(): Revert the ranged…
Browse files Browse the repository at this point in the history
… `for` loop change for RomFields.

It has the same issue as the GTK version, requiring an iterator to
determine if it's at the end of the tab or not.

There's also iter_desc, which could have worked, but I accidentally
deleted the iter_desc definition.

TODO: Fix this.

This fixes a regression from commit 2d51365.
([librpbase] RomFields, RomMetaData: Add begin()/end() aliases that return const_iterator.)
  • Loading branch information
GerbilSoft committed Nov 2, 2024
1 parent e67ea9f commit d164e8b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/win32/RP_ShellPropSheetExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,11 +1922,12 @@ void RP_ShellPropSheetExt_Private::initDialog(void)
}

int fieldIdx = 0; // needed for control IDs
for (const RomFields::Field &field : *pFields) {
auto iter_desc = t_desc_text.cbegin();
for (auto iter = pFields->cbegin(); iter != pFields_cend; ++iter, ++iter_desc, fieldIdx++) {
assert(iter_desc != t_desc_text.cend());
const RomFields::Field &field = *iter;
assert(field.isValid());
if (!field.isValid()) {
++iter_desc;
fieldIdx++;
continue;
}

Expand All @@ -1935,13 +1936,9 @@ void RP_ShellPropSheetExt_Private::initDialog(void)
assert(tabIdx >= 0 && tabIdx < (int)tabs.size());
if (tabIdx < 0 || tabIdx >= (int)tabs.size()) {
// Tab index is out of bounds.
++iter_desc;
fieldIdx++;
continue;
} else if (!tabs[tabIdx].hDlg) {
// Tab name is empty. Tab is hidden.
++iter_desc;
fieldIdx++;
continue;
}

Expand Down Expand Up @@ -2073,9 +2070,6 @@ void RP_ShellPropSheetExt_Private::initDialog(void)
// Remove the description label.
DestroyWindow(hStatic);
}

++iter_desc;
fieldIdx++;
}

// Update scrollbar settings.
Expand Down

0 comments on commit d164e8b

Please sign in to comment.