From aa17e7919e2eb377254180545fb914e049c0c8a0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 26 Jul 2018 19:42:43 +0200 Subject: [PATCH] Fix a serious issue in DIALOG_EDIT_LIBRARY_TABLES, on wxWidgets 3.1.x. * in DIALOG_EDIT_LIBRARY_TABLES::TransferDataFromWindow(), m_contentPanel->TransferDataFromWindow * is explicitly called to update library tables. * Before wxWidgets 3.1.x, m_contentPanel->TransferDataFromWindow is not called by wxDialog::TransferDataFromWindow() * and explicit call is needed. * Since wxWidgets 3.1.x, m_contentPanel->TransferDataFromWindow is called by wxDialog::TransferDataFromWindow() * thus creating two successive calls, not supported by m_contentPanel->TransferDataFromWindow. * The call to wxDialog::TransferDataFromWindow() was just removed, as it is useless in this dialog --- common/dialogs/dialog_edit_library_tables.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/common/dialogs/dialog_edit_library_tables.cpp b/common/dialogs/dialog_edit_library_tables.cpp index 01b5d25f5d..c2ae903974 100644 --- a/common/dialogs/dialog_edit_library_tables.cpp +++ b/common/dialogs/dialog_edit_library_tables.cpp @@ -68,18 +68,21 @@ void DIALOG_EDIT_LIBRARY_TABLES::InstallPanel( wxPanel* aPanel ) bool DIALOG_EDIT_LIBRARY_TABLES::TransferDataToWindow() { - if( !DIALOG_SHIM::TransferDataToWindow() ) - return false; - return m_contentPanel->TransferDataToWindow(); } bool DIALOG_EDIT_LIBRARY_TABLES::TransferDataFromWindow() { - if( !DIALOG_SHIM::TransferDataFromWindow() ) - return false; - + /* Transfer tables edited in dialog to the global and project tables: + * A good way is to use m_contentPanel->TransferDataFromWindow to do that. + * But be carefull: + * Since wxWidgets 3.1, it is called by wxDialog::TransferDataFromWindow() + * Before wxWidgets 3.1, it is *not* called by wxDialog::TransferDataFromWindow() + * m_contentPanel->TransferDataFromWindow do not works with two calls. + * Therefore *do not* call wxDialog::TransferDataFromWindow(), + * because m_contentPanel->TransferDataFromWindow() is called here. + */ return m_contentPanel->TransferDataFromWindow(); }