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 f491b7fff7)
This commit is contained in:
Jeff Young 2019-09-07 23:53:33 +01:00
parent 848873d87e
commit f1e6f8042c
1 changed files with 0 additions and 19 deletions

View File

@ -628,26 +628,7 @@ bool BOARD::SetLayerName( PCB_LAYER_ID aLayer, const wxString& aLayerName )
if( IsLayerEnabled( aLayer ) ) 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; m_Layer[aLayer].m_name = nameTemp;
return true; return true;
} }