PNS: Do not create an undo buffer entry when there is nothing to save.

This commit is contained in:
Maciej Suminski 2016-06-07 14:42:42 +02:00
parent 71aade6b51
commit 553899b79b
1 changed files with 6 additions and 3 deletions

View File

@ -532,9 +532,12 @@ bool ROUTER_TOOL::finishInteractive()
m_router->StopRouting();
// Save the recent changes in the undo buffer
m_frame->SaveCopyInUndoList( m_router->GetUndoBuffer(), UR_UNSPECIFIED );
m_router->ClearUndoBuffer();
m_frame->OnModify();
if( m_router->GetUndoBuffer().GetCount() > 0 )
{
m_frame->SaveCopyInUndoList( m_router->GetUndoBuffer(), UR_UNSPECIFIED );
m_router->ClearUndoBuffer();
m_frame->OnModify();
}
m_ctls->SetAutoPan( false );
m_ctls->ForceCursorPosition( false );