diff -r 3099bf907e21 -r bedd499b640d ui/winui/table.cpp --- a/ui/winui/table.cpp Tue Nov 26 15:53:57 2024 +0100 +++ b/ui/winui/table.cpp Wed Nov 27 13:28:21 2024 +0100 @@ -339,22 +339,14 @@ dnd.drageventargs = { nullptr }; dnd.data = args.Data(); - UiListDnd dndevt; - dndevt.selection = uiselection(); - dndevt.dnd = &dnd; - UiEvent evt; evt.obj = this->obj; evt.window = evt.obj->window; evt.document = obj->ctx->document; - evt.eventdata = &dndevt; + evt.eventdata = &dnd; evt.intval = 0; this->ondragstart(&evt, this->ondragstartdata); - - if (dndevt.selection.rows) { - free(dndevt.selection.rows); - } }); cellBorder.DropCompleted([this](IInspectable const& sender, DropCompletedEventArgs args) { UiDnD dnd; @@ -364,23 +356,16 @@ dnd.drageventargs = { nullptr }; dnd.data = { nullptr }; - UiListDnd dndevt; - dndevt.selection = uiselection(); - dndevt.dnd = &dnd; - UiEvent evt; evt.obj = this->obj; evt.window = evt.obj->window; evt.document = obj->ctx->document; - evt.eventdata = &dndevt; + evt.eventdata = &dnd; evt.intval = 0; if (this->ondragcomplete) { this->ondragcomplete(&evt, this->ondragcompletedata); } - if (dndevt.selection.rows) { - free(dndevt.selection.rows); - } }); } if (ondrop) { @@ -393,22 +378,14 @@ dnd.drageventargs = args; dnd.dataview = args.DataView(); - UiListDnd dndevt; - dndevt.selection = uiselection(); - dndevt.dnd = &dnd; - UiEvent evt; evt.obj = this->obj; evt.window = evt.obj->window; evt.document = obj->ctx->document; - evt.eventdata = &dndevt; + evt.eventdata = &dnd; evt.intval = 0; this->ondrop(&evt, this->ondropdata); - - if (dndevt.selection.rows) { - free(dndevt.selection.rows); - } })); cellBorder.DragOver(DragEventHandler([this](winrt::Windows::Foundation::IInspectable const& sender, DragEventArgs const& args){ args.AcceptedOperation(winrt::Windows::ApplicationModel::DataTransfer::DataPackageOperation::Copy);