From 9fe7bfb5965ce2be0bdecd274a841c5c0d5e54dc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 8 Aug 2019 11:12:04 +0100 Subject: [PATCH] Check for focus loss from dialog before doing cut/copy/paste in edit frame. Fixes: lp:1838708 * https://bugs.launchpad.net/kicad/+bug/1838708 --- eeschema/tools/sch_editor_control.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 1a231da776..4f5fe0a006 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -853,6 +853,14 @@ bool SCH_EDITOR_CONTROL::doCopy() int SCH_EDITOR_CONTROL::Cut( const TOOL_EVENT& aEvent ) { + wxTextEntry* textEntry = dynamic_cast( wxWindow::FindFocus() ); + + if( textEntry ) + { + textEntry->Cut(); + return 0; + } + if( doCopy() ) m_toolMgr->RunAction( EE_ACTIONS::doDelete, true ); @@ -862,6 +870,14 @@ int SCH_EDITOR_CONTROL::Cut( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::Copy( const TOOL_EVENT& aEvent ) { + wxTextEntry* textEntry = dynamic_cast( wxWindow::FindFocus() ); + + if( textEntry ) + { + textEntry->Copy(); + return 0; + } + doCopy(); return 0; @@ -870,6 +886,14 @@ int SCH_EDITOR_CONTROL::Copy( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) { + wxTextEntry* textEntry = dynamic_cast( wxWindow::FindFocus() ); + + if( textEntry ) + { + textEntry->Paste(); + return 0; + } + EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); DLIST& dlist = m_frame->GetScreen()->GetDrawList();