[gnumeric] clipboard: fix debug code.



commit 1ed47aca439f37b61c1f2ac5a9cd387d28d0446a
Author: Morten Welinder <terra gnome org>
Date:   Thu Jun 24 22:00:35 2010 -0400

    clipboard: fix debug code.

 src/gui-clipboard.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index d3ca652..e7c5b22 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -196,9 +196,11 @@ text_content_received (GtkClipboard *clipboard,  GtkSelectionData *sel,
 			    sel->length,
 			    name);
 		g_free (name);
-		gsf_mem_dump (sel->data, MAX (sel->length, maxlen));
-		if (sel->length > maxlen)
-			g_printerr ("...\n");
+		if (sel->length > 0) {
+			gsf_mem_dump (sel->data, MIN (sel->length, maxlen));
+			if (sel->length > maxlen)
+				g_printerr ("...\n");
+		}
 	}
 
 	/* Nothing on clipboard? */
@@ -347,9 +349,11 @@ image_content_received (GtkClipboard *clipboard, GtkSelectionData *sel,
 			    sel->length,
 			    name);
 		g_free (name);
-		gsf_mem_dump (sel->data, MAX (sel->length, maxlen));
-		if (sel->length > maxlen)
-			g_printerr ("...\n");
+		if (sel->length > 0) {
+			gsf_mem_dump (sel->data, MIN (sel->length, maxlen));
+			if (sel->length > maxlen)
+				g_printerr ("...\n");
+		}
 	}
 
 	if (sel->length > 0) {
@@ -383,9 +387,11 @@ table_content_received (GtkClipboard *clipboard, GtkSelectionData *sel,
 			    sel->length,
 			    name);
 		g_free (name);
-		gsf_mem_dump (sel->data, MAX (sel->length, maxlen));
-		if (sel->length > maxlen)
-			g_printerr ("...\n");
+		if (sel->length > 0) {
+			gsf_mem_dump (sel->data, MIN (sel->length, maxlen));
+			if (sel->length > maxlen)
+				g_printerr ("...\n");
+		}
 	}
 
 	/* Nothing on clipboard? */



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