From db33e1549b96a6bb7c19b54e3939ee44cea16ed7 Mon Sep 17 00:00:00 2001 From: ali kettab Date: Mon, 15 Feb 2021 15:38:21 +0100 Subject: [PATCH] Make wxWindow::TransferData{To,From}Window actually transfer to self --- src/common/wincmn.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index b949bbfebc..cad8c190bf 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2033,17 +2033,18 @@ public: // grandchildren, calling OnRecurse() for them. bool DoForSelfAndChildren() { + wxValidator* const validator = m_win->GetValidator(); + if ( validator && !OnDo(validator) ) + { + return false; + } + wxWindowList& children = m_win->GetChildren(); for ( wxWindowList::iterator i = children.begin(); i != children.end(); ++i ) { wxWindow* const child = static_cast(*i); - wxValidator* const validator = child->GetValidator(); - if ( validator && !OnDo(validator) ) - { - return false; - } // Notice that validation should never recurse into top level // children, e.g. some other dialog which might happen to be