From: Friedrich Beckmann Date: Sun, 12 Jul 2020 19:32:28 +0000 (+0200) Subject: gui: normalize clipboard cut selection rectangle (#58756) X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=937088dfc8284801e50c2068d0764575d2260000;p=pspp 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 --- 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);