From 528f933ad59bbe4297c5b520c68d9510224ccb07 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 4 Mar 2021 19:15:52 +0000 Subject: [PATCH] Don't revert commit after user has OK'ed the dialog. Fixes https://gitlab.com/kicad/code/kicad/issues/7799 --- pcbnew/dialogs/dialog_copper_zones.cpp | 27 ++++++++------------------ pcbnew/edit_zone_helpers.cpp | 4 ++-- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 2a0a27742f..8dec6b3409 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -101,7 +101,6 @@ int InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ) return dlg.ShowQuasiModal(); } -#define MIN_THICKNESS ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) : DIALOG_COPPER_ZONE_BASE( aParent ), @@ -194,7 +193,7 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow() m_NetFiltering = false; m_NetSortingByPadCount = true; - auto cfg = m_Parent->GetPcbNewSettings(); + PCBNEW_SETTINGS* cfg = m_Parent->GetPcbNewSettings(); int opt = cfg->m_Zones.net_sort_mode; m_NetFiltering = opt >= 2; @@ -214,10 +213,8 @@ bool DIALOG_COPPER_ZONE::TransferDataToWindow() switch( m_settings.m_FillMode ) { - case ZONE_FILL_MODE::HATCH_PATTERN: - m_GridStyleCtrl->SetSelection( 1 ); break; - default: - m_GridStyleCtrl->SetSelection( 0 ); break; + case ZONE_FILL_MODE::HATCH_PATTERN: m_GridStyleCtrl->SetSelection( 1 ); break; + default: m_GridStyleCtrl->SetSelection( 0 ); break; } m_gridStyleRotation.SetUnits( EDA_UNITS::DEGREES ); @@ -355,18 +352,10 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly ) switch( m_PadInZoneOpt->GetSelection() ) { - case 3: - m_settings.SetPadConnection( ZONE_CONNECTION::NONE ); - break; - case 2: - m_settings.SetPadConnection( ZONE_CONNECTION::THT_THERMAL ); - break; - case 1: - m_settings.SetPadConnection( ZONE_CONNECTION::THERMAL ); - break; - case 0: - m_settings.SetPadConnection( ZONE_CONNECTION::FULL ); - break; + case 3: m_settings.SetPadConnection( ZONE_CONNECTION::NONE ); break; + case 2: m_settings.SetPadConnection( ZONE_CONNECTION::THT_THERMAL ); break; + case 1: m_settings.SetPadConnection( ZONE_CONNECTION::THERMAL ); break; + case 0: m_settings.SetPadConnection( ZONE_CONNECTION::FULL ); break; } switch( m_OutlineDisplayCtrl->GetSelection() ) @@ -376,7 +365,7 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aUseExportableSetupOnly ) case 2: m_settings.m_ZoneBorderDisplayStyle = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL; break; } - auto cfg = m_Parent->GetPcbNewSettings(); + PCBNEW_SETTINGS* cfg = m_Parent->GetPcbNewSettings(); cfg->m_Zones.hatching_style = static_cast( m_settings.m_ZoneBorderDisplayStyle ); cfg->m_Zones.net_filter = m_DoNotShowNetNameFilter->GetValue().ToStdString(); diff --git a/pcbnew/edit_zone_helpers.cpp b/pcbnew/edit_zone_helpers.cpp index 04a71ae7a1..ba68f1d508 100644 --- a/pcbnew/edit_zone_helpers.cpp +++ b/pcbnew/edit_zone_helpers.cpp @@ -135,8 +135,8 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone ) if( !filler.Fill( zones_to_refill ) ) { - commit.Revert(); - return; + // User has already OK'ed dialog so we're going to go ahead and commit even if the + // fill was cancelled. } }