From f1e6f8042cbc7e7b12f33d939e58dc9a276adda2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 7 Sep 2019 23:53:33 +0100 Subject: [PATCH] Check for dup layer names in the GUI, not in the internals. Doing so in the internals keeps users from being able to swap layer names as the dialog does each layer name change individually. Fixes: lp:1842665 * https://bugs.launchpad.net/kicad/+bug/1842665 (cherry picked from commit f491b7fff7205fba6868bd25b4b12886101c1d88) --- pcbnew/class_board.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 22695994c9..a119df23fa 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -628,26 +628,7 @@ bool BOARD::SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName ) if( IsLayerEnabled( aLayer ) ) { -#if 0 - for( LAYER_NUM i = FIRST_COPPER_LAYER; i < NB_COPPER_LAYERS; ++i ) - { - if( i != aLayer && IsLayerEnabled( i ) && nameTemp == m_Layer[i].m_Name ) - return false; - } -#else - for( LSEQ cu = GetEnabledLayers().CuStack(); cu; ++cu ) - { - PCB_LAYER_ID id = *cu; - - // veto changing the name if it exists elsewhere. - if( id != aLayer && nameTemp == m_Layer[id].m_name ) -// if( id != aLayer && nameTemp == wxString( m_Layer[id].m_name ) ) - return false; - } -#endif - m_Layer[aLayer].m_name = nameTemp; - return true; }