* QMimeData::removeData will be new in Qt4.4, don't use it for Qt4.3
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 11:13:18 +0000 (11:13 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 11:13:18 +0000 (11:13 +0000)
* Provide a bad fallback implementation to filter the format list.

Signed-off-by: Lars Knoll <lars@trolltech.com>
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/ClipboardQt.cpp

index cb2941c9939e28a28dd2d0334c8fedad8d7b9999..785bc3d20ea81459f5ac870290db6bf3d091ca91 100644 (file)
@@ -1,3 +1,13 @@
+2007-10-31  Holger Freyther  <zecke@selfish.org>
+
+        Reviewed by Lars Knoll <lars@trolltech.com>.
+
+        * QMimeData::removeData will be new in Qt4.4, don't use it for Qt4.3 
+        * Provide a bad fallback implementation to filter the format list.
+
+        * platform/qt/ClipboardQt.cpp:
+        (WebCore::ClipboardQt::clearData):
+
 2007-10-31  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
@@ -5,8 +15,6 @@
         add an entitiy resolver to QXmlStream.
         Fixes fast/parser/entities-in-attributes.xhtml.
 
-        WARNING: NO TEST CASES ADDED OR CHANGED
-
         * dom/XMLTokenizer.cpp:
         (WebCore::EntityResolver::resolveUndeclaredEntity):
         (WebCore::XMLTokenizer::XMLTokenizer):
@@ -37,8 +45,6 @@
 
         add support for dragging images.
 
-        WARNING: NO TEST CASES ADDED OR CHANGED
-
         * platform/DragImage.h:
         * platform/qt/ClipboardQt.cpp:
         (WebCore::ClipboardQt::clearData):
@@ -55,8 +61,6 @@
 
         fix most of the issues I found with Clipboard and DnD.
 
-        WARNING: NO TEST CASES ADDED OR CHANGED
-
         * editing/qt/EditorQt.cpp:
         * platform/qt/ClipboardQt.cpp:
         (WebCore::ClipboardQt::ClipboardQt):
index 1dacf394bc7c1f536fa2bcd5e1e8328983e4075a..6f88ec19623496b967e1c5e8aa33c9cde102dade 100644 (file)
@@ -92,7 +92,21 @@ void ClipboardQt::clearData(const String& type)
         return;
 
     ASSERT(m_writableData);
+#if QT_VERSION >= 0x040400
     m_writableData->removeFormat(type);
+#else
+    const QString toClearType = type;
+    QMap<QString, QByteArray> formats;
+    foreach (QString format, m_writableData->formats()) {
+        if (format != toClearType)
+            formats[format] = m_writableData->data(format);
+    }
+
+    m_writableData->clear();
+    QMap<QString, QByteArray>::const_iterator it, end = formats.constEnd();
+    for (it = formats.begin(); it != end; ++it)
+        m_writableData->setData(it.key(), it.value());
+#endif
 }
 
 void ClipboardQt::clearAllData()