Eeschema: fix partial schematic load bug in the legacy plugin.
Move the hierarchical sheet loading outside of the try exception block
so that any sheets that were loaded when a schematic file load fails
are loaded rather than skipped. This allows more of the schematic to
be loaded when any parser errors occur.
(cherry picked from commit 1a8082c6d6
)
This commit is contained in:
parent
3f717f3baf
commit
f61c692929
|
@ -687,6 +687,19 @@ void SCH_LEGACY_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
|
|||
try
|
||||
{
|
||||
loadFile( fileName.GetFullPath(), aSheet->GetScreen() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
// If there is a problem loading the root sheet, there is no recovery.
|
||||
if( aSheet == m_rootSheet )
|
||||
throw( ioe );
|
||||
|
||||
// For all subsheets, queue up the error message for the caller.
|
||||
if( !m_error.IsEmpty() )
|
||||
m_error += "\n";
|
||||
|
||||
m_error += ioe.What();
|
||||
}
|
||||
|
||||
EDA_ITEM* item = aSheet->GetScreen()->GetDrawItems();
|
||||
|
||||
|
@ -710,19 +723,6 @@ void SCH_LEGACY_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
|
|||
item = item->Next();
|
||||
}
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
// If there is a problem loading the root sheet, there is no recovery.
|
||||
if( aSheet == m_rootSheet )
|
||||
throw( ioe );
|
||||
|
||||
// For all subsheets, queue up the error message for the caller.
|
||||
if( !m_error.IsEmpty() )
|
||||
m_error += "\n";
|
||||
|
||||
m_error += ioe.What();
|
||||
}
|
||||
}
|
||||
|
||||
m_currentPath.pop();
|
||||
wxLogTrace( traceSchLegacyPlugin, "Restoring path \"%s\"", m_currentPath.top() );
|
||||
|
|
Loading…
Reference in New Issue