From c22a247dbc5e5513da94e045ecd1b930ef47e21e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 17 Oct 2018 13:09:58 +0100 Subject: [PATCH] Fix undo issue primarily with libedit. Fixes: lp:1797900 * https://bugs.launchpad.net/kicad/+bug/1797900 --- common/legacy_gal/block.cpp | 3 +++ eeschema/libedit/block_libedit.cpp | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common/legacy_gal/block.cpp b/common/legacy_gal/block.cpp index 14714f0399..15621610be 100644 --- a/common/legacy_gal/block.cpp +++ b/common/legacy_gal/block.cpp @@ -148,18 +148,21 @@ void BLOCK_SELECTOR::InitData( EDA_DRAW_PANEL* aPanel, const wxPoint& startpos ) void BLOCK_SELECTOR::ClearItemsList() { m_items.ClearItemsList(); + m_appendUndo = false; } void BLOCK_SELECTOR::ClearListAndDeleteItems() { m_items.ClearListAndDeleteItems(); + m_appendUndo = false; } void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem ) { m_items.PushItem( aItem ); + m_appendUndo = false; } diff --git a/eeschema/libedit/block_libedit.cpp b/eeschema/libedit/block_libedit.cpp index d7a5bd32ad..e3987411a6 100644 --- a/eeschema/libedit/block_libedit.cpp +++ b/eeschema/libedit/block_libedit.cpp @@ -440,30 +440,28 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC ) case BLOCK_DRAG_ITEM: case BLOCK_MOVE: // Move case BLOCK_DUPLICATE: // Duplicate - block->ClearItemsList(); - if( GetCurPart() && !block->AppendUndo() ) SaveCopyInUndoList( GetCurPart() ); pt = block->GetMoveVector(); - //pt.y *= -1; if( GetCurPart() ) BlockMoveSelectedItems( pt, GetCurPart(), block ); + block->ClearItemsList(); m_canvas->Refresh( true ); break; case BLOCK_PASTE: // Paste (recopy the last block saved) - block->ClearItemsList(); - if( GetCurPart() ) SaveCopyInUndoList( GetCurPart() ); pt = block->GetMoveVector(); - //pt.y = -pt.y; pasteClipboard( pt ); + + block->ClearItemsList(); + m_canvas->Refresh( true ); break; case BLOCK_ZOOM: // Handled by HandleBlockEnd