From 35eda030a2c7ece4c93597fd3eb30f9d6e9063fe Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 24 Aug 2020 16:01:55 -0700 Subject: [PATCH] pcbnew: Ensure we are cloning pads When calling MODULE::Clone() we need to clone the pads as well or we will end up with scm churn when running undo/redo operations --- pcbnew/class_module.cpp | 2 +- pcbnew/class_pad.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 34aa160e44..2e5567870c 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -95,7 +95,7 @@ MODULE::MODULE( const MODULE& aModule ) : // Copy auxiliary data: Pads for( D_PAD* pad : aModule.Pads() ) - Add( new D_PAD( *pad ) ); + Add( static_cast( pad->Clone() ) ); // Copy auxiliary data: Zones for( MODULE_ZONE_CONTAINER* item : aModule.Zones() ) diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 1a2aa94825..2085eb9482 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -115,6 +115,7 @@ D_PAD::D_PAD( const D_PAD& aOther ) : m_effectiveBoundingRadius = aOther.m_effectiveBoundingRadius; m_removeUnconnectedLayer = aOther.m_removeUnconnectedLayer; m_keepTopBottomLayer = aOther.m_keepTopBottomLayer; + const_cast( m_Uuid ) = aOther.m_Uuid; }