Eeschema: do not change schematic UUID on file overwrite.

This commit is contained in:
Wayne Stambaugh 2021-04-06 15:42:22 -04:00
parent df186a2049
commit 866c58a6d6
1 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,7 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName )
{
wxString msg;
wxFileName schematicFileName;
wxFileName oldFileName;
bool success;
if( aSheet == NULL )
@ -80,6 +81,7 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName )
// Construct the name of the file to be saved
schematicFileName = Prj().AbsolutePath( screen->GetFileName() );
oldFileName = schematicFileName;
if( aSaveUnderNewName )
{
@ -110,7 +112,7 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName )
return false;
// This is a new schematic file so make sure it has a unique ID.
if( aSaveUnderNewName )
if( aSaveUnderNewName && schematicFileName != oldFileName )
screen->AssignNewUuid();
wxFileName tempFile( schematicFileName );