Eeschema: fix sheet file name case sensitivity bug.

Apparently there are some issues with wxString::CmpNoCase() that was
causing the sheet file name case sensitivity test to incorrectly fail.
Converting the name strings to lower case before comparing resolved
the issue.

(cherry picked from commit 773f45aae3)
This commit is contained in:
Wayne Stambaugh 2019-11-19 16:06:18 -05:00
parent d7605f1449
commit be12aece5b
1 changed files with 6 additions and 2 deletions

View File

@ -1621,6 +1621,8 @@ bool SCH_SCREENS::HasSchematic( const wxString& aSchematicFileName )
bool SCH_SCREENS::CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const bool SCH_SCREENS::CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const
{ {
wxString lhsLower;
wxString rhsLower;
wxFileName lhs; wxFileName lhs;
wxFileName rhs = aSchematicFileName; wxFileName rhs = aSchematicFileName;
@ -1633,8 +1635,10 @@ bool SCH_SCREENS::CanCauseCaseSensitivityIssue( const wxString& aSchematicFileNa
if( lhs.GetPath() != rhs.GetPath() ) if( lhs.GetPath() != rhs.GetPath() )
continue; continue;
if( lhs.GetName().CmpNoCase( rhs.GetName() ) lhsLower = lhs.GetName().Lower();
&& lhs.GetName() != rhs.GetName() ) rhsLower = rhs.GetName().Lower();
if( lhsLower == rhsLower )
return true; return true;
} }