[dia] Don't take clipboard request for BMP too literally



commit 9a8f86c0fa045c0f6368baf97537411d85544a9a
Author: Hans Breuer <hans breuer org>
Date:   Wed Jun 1 16:45:11 2011 +0200

    Don't take clipboard request for BMP too literally
    
    Although asked for bmp, deliver PNG because of potentially better renderer.
    Dropping 'bmp' in target would exclude many win32 programs, but Gtk+ can
    convert from PNG on demand ...

 app/commands.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/app/commands.c b/app/commands.c
index 0239a47..c9481f3 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -356,7 +356,11 @@ _clipboard_get_data_callback (GtkClipboard     *clipboard,
 {
   DiagramData *dia = owner_or_user_data; /* todo: check it's still valid */
   const gchar *ext = strchr (target_entries[info-1].target, '/')+1;
-  gchar *tmplate = g_strdup_printf ("dia-cb-XXXXXX.%s", ext);
+  /* Although asked for bmp, deliver png because of potentially better renderer
+   * Dropping 'bmp' in target would exclude many win32 programs, but gtk+ can
+   * convert from png on demand ... */
+  gchar *tmplate = g_strdup_printf ("dia-cb-XXXXXX.%s", 
+                     (strcmp (ext, "bmp") == 0) ? "png" : ext);
   gchar *outfname = NULL;
   GError *error = NULL;
   DiaExportFilter *ef = NULL;



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