Browse Source

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
pull/15/head
Jeff Young 6 years ago
parent
commit
f491b7fff7
  1. 19
      pcbnew/class_board.cpp

19
pcbnew/class_board.cpp

@ -316,26 +316,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;
}

Loading…
Cancel
Save