Eeschema: sheet filename renaming: fix a old issue that can set incorrect filenames in sheets inside a complex hierarchy.

Fixes: lp:1773500
https://bugs.launchpad.net/kicad/+bug/1773500
This commit is contained in:
jean-pierre charras 2018-05-29 19:57:18 +02:00
parent ce9cc4ea38
commit 52fceb3243
1 changed files with 6 additions and 1 deletions

View File

@ -214,7 +214,12 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy )
if( renameFile )
{
aSheet->GetScreen()->SetFileName( newFilename );
// If the the associated screen is shared by more than one sheet, do not
// change the filename of the corresponding screen here.
// (a new screen will be created later)
// if it is not shared, update the filename
if( aSheet->GetScreenCount() <= 1 )
aSheet->GetScreen()->SetFileName( newFilename );
try
{