1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

Spreadsheet: Handle case when drag-and-drop location is out of bounds

When the drop location of a drag-and-drop operation is not valid, then
don't continue with the drop_event. For example, if the ending location
is the header row or header column, or is outside of the table, then
should not continue.
This commit is contained in:
martinfalisse 2022-03-06 22:40:28 +01:00 committed by Ali Mohammad Pur
parent 9e54815799
commit 5759b25ca8
Notes: sideshowbarker 2024-07-17 17:08:12 +09:00

View file

@ -246,9 +246,12 @@ void InfinitelyScrollableTableView::mouseup_event(GUI::MouseEvent& event)
void InfinitelyScrollableTableView::drop_event(GUI::DropEvent& event)
{
TableView::drop_event(event);
m_is_dragging_for_cut = false;
set_override_cursor(Gfx::StandardCursor::Arrow);
if (!index_at_event_position(event.position()).is_valid())
return;
TableView::drop_event(event);
auto drop_index = index_at_event_position(event.position());
if (selection().size() > 0) {
// Get top left index position of previous selection