Codechange: use iterators instead of 'subranges' when iterating from a specific window.
Using iterators makes it easier to include or exclude the start window in the iteration.
This commit is contained in:
@@ -896,7 +896,10 @@ static bool MayBeShown(const Window *w)
|
||||
*/
|
||||
static void DrawOverlappedWindow(Window *w, int left, int top, int right, int bottom)
|
||||
{
|
||||
for (const Window *v : Window::IterateFromBack(w->z_front)) {
|
||||
Window::IteratorToFront it(w);
|
||||
++it;
|
||||
for (; !it.IsEnd(); ++it) {
|
||||
const Window *v = *it;
|
||||
if (MayBeShown(v) &&
|
||||
right > v->left &&
|
||||
bottom > v->top &&
|
||||
@@ -2530,7 +2533,10 @@ static bool MaybeBringWindowToFront(Window *w)
|
||||
w_height = w->unshaded_size.height;
|
||||
}
|
||||
|
||||
for (Window *u : Window::IterateFromBack(w->z_front)) {
|
||||
Window::IteratorToFront it(w);
|
||||
++it;
|
||||
for (; !it.IsEnd(); ++it) {
|
||||
Window *u = *it;
|
||||
/* A modal child will prevent the activation of the parent window */
|
||||
if (u->parent == w && (u->window_desc->flags & WDF_MODAL)) {
|
||||
u->SetWhiteBorder();
|
||||
|
||||
Reference in New Issue
Block a user