diff --git a/uppsrc/CtrlCore/TopWindow.cpp b/uppsrc/CtrlCore/TopWindow.cpp index 0692818c4..33e1cc618 100644 --- a/uppsrc/CtrlCore/TopWindow.cpp +++ b/uppsrc/CtrlCore/TopWindow.cpp @@ -93,7 +93,6 @@ void TopWindow::Close() DefaultBreak(); return; } - backup.Clear(); if(IsOpen()) IgnoreMouseUp(); Ctrl::Close(); } diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 53c6d8474..19ca6e868 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -781,7 +781,7 @@ void GridCtrl::Paste(int mode) { if(!clipboard) return; - + GridClipboard gc = GetClipboard(); bool is_gc = !gc.data.IsEmpty(); @@ -802,8 +802,12 @@ void GridCtrl::Paste(int mode) Vector lines; + String s = FromUnicode(ReadClipboardUnicodeText()); + + WhenPasting(s); + if(is_tc && !is_gc) - lines = Upp::Split(FromUnicode(ReadClipboardUnicodeText()), '\n'); + lines = Upp::Split(s, '\n'); if(mode == 1) { diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index 17961a264..ed2ecbb89 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -1853,7 +1853,9 @@ class GridCtrl : public Ctrl Event ProcessSummaryValue; Event WhenPasteCell; - Event<> WhenPaste; + + Event WhenPasting; + Event<> WhenPaste; }; class GridText : Ctrl