Check for ".SchDoc" before replacing to ".kicad_sch" for subsheet

This commit is contained in:
WhiteChairFromIkea 2021-03-02 21:39:47 +00:00 committed by Jeff Young
parent f83b9236ac
commit 2c289b3f35
1 changed files with 9 additions and 2 deletions

View File

@ -1982,9 +1982,16 @@ void SCH_ALTIUM_PLUGIN::ParseFileName( const std::map<wxString, wxString>& aProp
SCH_FIELD& filenameField = sheet->second->GetFields()[SHEETFILENAME];
filenameField.SetPosition( elem.location + m_sheetOffset );
elem.text.RemoveLast( 6 );
elem.text += "kicad_sch";
// If last symbols are ".sChDoC", change them to ".kicad_sch"
if( ( elem.text.Right( GetFileExtension().length() + 1 ).Lower() ) == ( "." + GetFileExtension().Lower() ))
{
elem.text.RemoveLast( 6 );
elem.text += "kicad_sch";
}
filenameField.SetText( elem.text );
filenameField.SetVisible( !elem.isHidden );
filenameField.SetHorizJustify( EDA_TEXT_HJUSTIFY_T::GR_TEXT_HJUSTIFY_LEFT );