From 39d5cd2aca56f4f22aa2f9edbb800e5140b27332 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 21 Jun 2016 13:47:43 +0200 Subject: [PATCH] Unified BOARD::Duplicate() --- pcbnew/class_board.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index bfdebdc0d0..4e1898cff1 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -2778,11 +2778,6 @@ BOARD_ITEM* BOARD::Duplicate( const BOARD_ITEM* aItem, switch( aItem->Type() ) { case PCB_MODULE_T: - { - MODULE* new_module = new MODULE( *static_cast( aItem ) ); - new_item = new_module; - break; - } case PCB_TEXT_T: case PCB_LINE_T: case PCB_TRACE_T: @@ -2799,11 +2794,8 @@ BOARD_ITEM* BOARD::Duplicate( const BOARD_ITEM* aItem, break; } - if( new_item ) - { - if( aAddToBoard ) - Add( new_item ); - } + if( new_item && aAddToBoard ) + Add( new_item ); return new_item; }