From 937088dfc8284801e50c2068d0764575d2260000 Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Sun, 12 Jul 2020 21:32:28 +0200 Subject: [PATCH] gui: normalize clipboard cut selection rectangle (#58756) With this patch the selection rectangle for the clipboard cut operation is normalize, i.e. it does not matter in which corner you start the selection. Closes: https://savannah.gnu.org/bugs/index.php?58756 --- src/ui/gui/psppire-data-window.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 2f31923af2..c43c65d120 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -1076,6 +1076,19 @@ on_cut (PsppireDataWindow *dw) if (ssw_sheet_try_cut (sheet)) return; + if (sel.start_x > sel.end_x) + { + gint tmp = sel.start_x; + sel.start_x = sel.end_x; + sel.end_x = tmp; + } + if (sel.start_y > sel.end_y) + { + gint tmp = sel.start_y; + sel.start_y = sel.end_y; + sel.end_y = tmp; + } + GtkClipboard *clip = gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (dw)), GDK_SELECTION_CLIPBOARD); -- 2.30.2