[gnumeric] clipboard: dump also outgoing .gnumeric if requested.



commit 36586646761960f8935b2215845a4cba6692a178
Author: Morten Welinder <terra gnome org>
Date:   Fri Apr 20 14:17:12 2018 -0400

    clipboard: dump also outgoing .gnumeric if requested.

 src/gui-clipboard.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 3561658..1a78197 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -927,12 +927,17 @@ x_clipboard_get_cb (GtkClipboard *gclipboard, GtkSelectionData *selection_data,
                GsfOutputMemory *output  = gnm_cellregion_to_xml (clipboard);
                if (output) {
                        gsf_off_t size = gsf_output_size (GSF_OUTPUT (output));
+                       gconstpointer data = gsf_output_memory_get_bytes (output);
+                       if (gnm_debug_flag ("clipboard-dump")) {
+                               g_file_set_contents ("paste-from-gnumeric.dat",
+                                                    data, size, NULL);
+                       }
                        if (debug_clipboard ())
                                g_printerr ("clipboard .gnumeric of %d bytes\n",
                                           (int)size);
                        gtk_selection_data_set
                                (selection_data, target, 8,
-                                gsf_output_memory_get_bytes (output),
+                                data,
                                 size);
                        g_object_unref (output);
                        to_gnumeric = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]