Sheets: check for duplicates using shown names

Otherwise sheet names using sheet variables may collide
This commit is contained in:
Mike Williams 2023-03-08 11:07:12 -05:00
parent bf59f1246b
commit 1bc4fc256a
2 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,7 @@ int ERC_TESTER::TestDuplicateSheetNames( bool aCreateMarker )
// We have found a second sheet: compare names
// we are using case insensitive comparison to avoid mistakes between
// similar names like Mysheet and mysheet
if( sheet->GetName().CmpNoCase( test_item->GetName() ) == 0 )
if( sheet->GetShownName().CmpNoCase( test_item->GetShownName() ) == 0 )
{
if( aCreateMarker )
{

View File

@ -100,6 +100,7 @@ public:
*/
void SetFields( const std::vector<SCH_FIELD>& aFields );
wxString GetShownName() const { return m_fields[SHEETNAME].GetShownText(); }
wxString GetName() const { return m_fields[ SHEETNAME ].GetText(); }
void SetName( const wxString& aName ) { m_fields[ SHEETNAME ].SetText( aName ); }