GridCtrl: WhenPasting (called before paste)

git-svn-id: svn://ultimatepp.org/upp/trunk@15959 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-05-24 15:00:35 +00:00
parent 51bc11ed7f
commit 87b78019a2
3 changed files with 9 additions and 4 deletions

View file

@ -93,7 +93,6 @@ void TopWindow::Close()
DefaultBreak();
return;
}
backup.Clear();
if(IsOpen()) IgnoreMouseUp();
Ctrl::Close();
}

View file

@ -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<String> 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)
{

View file

@ -1853,7 +1853,9 @@ class GridCtrl : public Ctrl
Event<Value&> ProcessSummaryValue;
Event<int, int, Value&> WhenPasteCell;
Event<> WhenPaste;
Event<String&> WhenPasting;
Event<> WhenPaste;
};
class GridText : Ctrl