Merge branch 'master' into jgrpp
# Conflicts: # regression/regression/result.txt # src/autoreplace_cmd.cpp # src/industry_gui.cpp # src/landscape.cpp # src/network/network_content.cpp # src/newgrf_roadstop.cpp # src/pathfinder/yapf/yapf_ship.cpp # src/road_gui.cpp # src/saveload/ai_sl.cpp # src/saveload/saveload.h # src/saveload/vehicle_sl.cpp # src/station.cpp # src/station_gui.cpp # src/video/cocoa/cocoa_ogl.h # src/video/sdl2_opengl_v.h # src/video/video_driver.hpp # src/video/win32_v.h # src/widget_type.h # src/widgets/dropdown.cpp # src/widgets/dropdown_type.h # src/window.cpp
This commit is contained in:
@@ -1040,12 +1040,12 @@ void Window::SetShaded(bool make_shaded)
|
||||
* @param wc Window class of the window to remove; #WC_INVALID if class does not matter
|
||||
* @return a Window pointer that is the child of \a w, or \c nullptr otherwise
|
||||
*/
|
||||
static Window *FindChildWindow(const Window *w, WindowClass wc)
|
||||
Window *Window::FindChildWindow(WindowClass wc) const
|
||||
{
|
||||
if (wc < WC_END && !_present_window_types[wc]) return nullptr;
|
||||
|
||||
for (Window *v : Window::IterateFromBack()) {
|
||||
if ((wc == WC_INVALID || wc == v->window_class) && v->parent == w) return v;
|
||||
if ((wc == WC_INVALID || wc == v->window_class) && v->parent == this) return v;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -1057,10 +1057,10 @@ static Window *FindChildWindow(const Window *w, WindowClass wc)
|
||||
*/
|
||||
void Window::CloseChildWindows(WindowClass wc) const
|
||||
{
|
||||
Window *child = FindChildWindow(this, wc);
|
||||
Window *child = this->FindChildWindow(wc);
|
||||
while (child != nullptr) {
|
||||
child->Close();
|
||||
child = FindChildWindow(this, wc);
|
||||
child = this->FindChildWindow(wc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user