Support smart copy and paste during drag and drop
[WebKit-https.git] / WebCore / platform / win / ClipboardWin.cpp
index 197dcf6cdec0ee974808dc7294fd992bce01af56..fbbbedb625d97cc1157820ba5ad5ad36f165cf40 100644 (file)
@@ -33,6 +33,7 @@
 #include "DeprecatedString.h"
 #include "Document.h"
 #include "DragData.h"
 #include "DeprecatedString.h"
 #include "Document.h"
 #include "DragData.h"
+#include "Editor.h"
 #include "Element.h"
 #include "EventHandler.h"
 #include "Frame.h"
 #include "Element.h"
 #include "EventHandler.h"
 #include "Frame.h"
@@ -728,6 +729,10 @@ void ClipboardWin::writeRange(Range* selectedRange, Frame* frame)
     medium.hGlobal = createGlobalData(str);
     if (medium.hGlobal && FAILED(m_writableDataObject->SetData(plainTextWFormat(), &medium, TRUE)))
         ::GlobalFree(medium.hGlobal);
     medium.hGlobal = createGlobalData(str);
     if (medium.hGlobal && FAILED(m_writableDataObject->SetData(plainTextWFormat(), &medium, TRUE)))
         ::GlobalFree(medium.hGlobal);
+
+    medium.hGlobal = 0;
+    if (frame->editor()->canSmartCopyOrDelete())
+        m_writableDataObject->SetData(smartPasteFormat(), &medium, TRUE);
 }
 
 bool ClipboardWin::hasData()
 }
 
 bool ClipboardWin::hasData()