From 8567eab09ac8a9fbee59e0fcbb5e5a3de5b19049 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 13 Mar 2018 09:26:34 +0100 Subject: [PATCH] Fix pasting BOARD_ITEMs containing Unicode characters Fixes: lp:1749549 * https://bugs.launchpad.net/kicad/+bug/1749549 --- pcbnew/kicad_clipboard.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index a6e5b40d28..9b8c2f0611 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -190,7 +190,8 @@ void CLIPBOARD_IO::SaveSelection( const SELECTION& aSelected ) BOARD_ITEM* CLIPBOARD_IO::Parse() { - std::string result; + BOARD_ITEM* item; + wxString result; if( wxTheClipboard->Open() ) { @@ -198,18 +199,18 @@ BOARD_ITEM* CLIPBOARD_IO::Parse() { wxTextDataObject data; wxTheClipboard->GetData( data ); - - result = data.GetText().mb_str(); + result = data.GetText(); } wxTheClipboard->Close(); } - BOARD_ITEM *item; try { item = PCB_IO::Parse( result ); - } catch (...) { + } + catch (...) + { item = nullptr; }