From 3969699f20b15b74f86c5ce5e5e53a1b8442826a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 29 Oct 2014 21:49:45 +0000 Subject: [PATCH] [GB.QT4] * BUG: Fix Clipboard.Paste() when there are both a text and a qt image in the clipboard. git-svn-id: svn://localhost/gambas/trunk@6587 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/src/CClipboard.cpp | 8 +++++++- gb.qt4/src/cpaint_impl.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gb.qt4/src/CClipboard.cpp b/gb.qt4/src/CClipboard.cpp index df7181683..60388baa6 100644 --- a/gb.qt4/src/CClipboard.cpp +++ b/gb.qt4/src/CClipboard.cpp @@ -126,6 +126,7 @@ static void paste(const QMimeData *data, const char *fmt) { QString format; QByteArray ba; + int type; if (fmt) format = fmt; @@ -138,7 +139,12 @@ static void paste(const QMimeData *data, const char *fmt) return; } - switch(get_type(data)) + if (format.startsWith("text/")) + type = MIME_TEXT; + else + type = get_type(data); + + switch(type) { case MIME_TEXT: ba = data->data(format); diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index 8dbba4b1a..dba064a2a 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -370,7 +370,7 @@ static void Font(GB_PAINT *d, int set, GB_FONT *font) QFont f(*((CFONT *)(*font))->font); PAINTER(d)->setFont(f); - // Strange bug of QT. Sometimes the font does not applies (cf. DrawTextShadow) + // Strange bug of QT. Sometimes the font does not apply (cf. DrawTextShadow) if (f != PAINTER(d)->font()) { f.fromString(f.toString());