eeschema: Avoid modifying the schematic in undo

OnModify() is called when staging the undo/redo modifications.  This
requires  that it not create changes that themselves need to be placed
in the undo/redo stack
This commit is contained in:
Seth Hillbrand 2019-04-12 19:46:12 -07:00
parent 2529346940
commit 94470f7da6
2 changed files with 9 additions and 6 deletions

View File

@ -798,7 +798,7 @@ void SCH_EDIT_FRAME::OnModify()
if( ADVANCED_CFG::GetCfg().m_realTimeConnectivity )
RecalculateConnections();
RecalculateConnections( false );
m_canvas->Refresh();
}
@ -1476,15 +1476,18 @@ void SCH_EDIT_FRAME::UpdateTitle()
}
void SCH_EDIT_FRAME::RecalculateConnections()
void SCH_EDIT_FRAME::RecalculateConnections( bool aDoCleanup )
{
SCH_SHEET_LIST list( g_RootSheet );
PROF_COUNTER timer;
// Ensure schematic graph is accurate
if( aDoCleanup )
{
for( const auto& sheet : list )
SchematicCleanUp( false, sheet.LastScreen() );
}
timer.Stop();
wxLogTrace( "CONN_PROFILE", "SchematicCleanUp() %0.4f ms", timer.msecs() );

View File

@ -517,7 +517,7 @@ public:
* @param aScreen is the screen to examine, or nullptr to examine the current screen
* @return True if any wires or buses were broken.
*/
bool BreakSegmentsOnJunctions( bool aApped = false,
bool BreakSegmentsOnJunctions( bool aAppend = false,
SCH_SCREEN* aScreen = nullptr );
/**
@ -1557,7 +1557,7 @@ public:
/**
* Generates the connection data for the entire schematic hierarchy.
*/
void RecalculateConnections();
void RecalculateConnections( bool aDoCleanup = true );
void SetCurrentSheet( SCH_SHEET_PATH *aSheet );