[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tony at chromium.org tony at chromium.org
Wed Dec 22 11:21:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6c91dab13565f1432f7a0e5f5e82bb27f375c56f
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 08:43:44 2010 +0000

    2010-07-20  Tony Chang  <tony at chromium.org>
    
            Reviewed by Kent Tamura.
    
            clean up style in ClipboardWin and PasteboardWin
            https://bugs.webkit.org/show_bug.cgi?id=42609
    
            No new tests since this is just a style cleanup.
    
            * platform/win/ClipboardUtilitiesWin.cpp:
            (WebCore::createGlobalData):
            (WebCore::markupToCFHTML):
            (WebCore::getURL):
            (WebCore::getPlainText):
            (WebCore::getTextHTML):
            (WebCore::fragmentFromFilenames):
            (WebCore::containsFilenames):
            (WebCore::fragmentFromCFHTML):
            (WebCore::fragmentFromHTML):
            * platform/win/ClipboardUtilitiesWin.h:
            * platform/win/ClipboardWin.cpp:
            (WebCore::pathRemoveBadFSCharacters):
            (WebCore::createGlobalHDropContent):
            (WebCore::createGlobalUrlFileDescriptor):
            (WebCore::writeURL):
            (WebCore::ClipboardWin::clearData):
            (WebCore::ClipboardWin::clearAllData):
            (WebCore::ClipboardWin::getData):
            (WebCore::ClipboardWin::types):
            (WebCore::ClipboardWin::declareAndWriteDragImage):
            (WebCore::ClipboardWin::writeRange):
            * platform/win/ClipboardWin.h:
            (WebCore::ClipboardWin::create):
            (WebCore::ClipboardWin::dataObject):
            * platform/win/PasteboardWin.cpp:
            (WebCore::PasteboardOwnerWndProc):
            (WebCore::Pasteboard::writeSelection):
            (WebCore::Pasteboard::writeURL):
            (WebCore::Pasteboard::plainText):
            (WebCore::Pasteboard::documentFragment):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63734 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e4a04d0..f192f25 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-07-20  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        clean up style in ClipboardWin and PasteboardWin
+        https://bugs.webkit.org/show_bug.cgi?id=42609
+
+        No new tests since this is just a style cleanup.
+
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        (WebCore::createGlobalData):
+        (WebCore::markupToCFHTML):
+        (WebCore::getURL):
+        (WebCore::getPlainText):
+        (WebCore::getTextHTML):
+        (WebCore::fragmentFromFilenames):
+        (WebCore::containsFilenames):
+        (WebCore::fragmentFromCFHTML):
+        (WebCore::fragmentFromHTML):
+        * platform/win/ClipboardUtilitiesWin.h:
+        * platform/win/ClipboardWin.cpp:
+        (WebCore::pathRemoveBadFSCharacters):
+        (WebCore::createGlobalHDropContent):
+        (WebCore::createGlobalUrlFileDescriptor):
+        (WebCore::writeURL):
+        (WebCore::ClipboardWin::clearData):
+        (WebCore::ClipboardWin::clearAllData):
+        (WebCore::ClipboardWin::getData):
+        (WebCore::ClipboardWin::types):
+        (WebCore::ClipboardWin::declareAndWriteDragImage):
+        (WebCore::ClipboardWin::writeRange):
+        * platform/win/ClipboardWin.h:
+        (WebCore::ClipboardWin::create):
+        (WebCore::ClipboardWin::dataObject):
+        * platform/win/PasteboardWin.cpp:
+        (WebCore::PasteboardOwnerWndProc):
+        (WebCore::Pasteboard::writeSelection):
+        (WebCore::Pasteboard::writeURL):
+        (WebCore::Pasteboard::plainText):
+        (WebCore::Pasteboard::documentFragment):
+
 2010-07-20  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index fbd0011..e6af7ef 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -32,10 +32,10 @@
 #include "TextEncoding.h"
 #include "markup.h"
 #include <CoreFoundation/CoreFoundation.h>
+#include <shlwapi.h>
+#include <wininet.h> // for INTERNET_MAX_URL_LENGTH
 #include <wtf/RetainPtr.h>
 #include <wtf/text/CString.h>
-#include <shlwapi.h>
-#include <wininet.h>    // for INTERNET_MAX_URL_LENGTH
 
 namespace WebCore {
 
@@ -97,7 +97,7 @@ static String extractURL(const String &inURL, String* title)
     return url;
 }
 
-//Firefox text/html
+// Firefox text/html
 static FORMATETC* texthtmlFormat() 
 {
     static UINT cf = RegisterClipboardFormat(L"text/html");
@@ -109,7 +109,7 @@ HGLOBAL createGlobalData(const KURL& url, const String& title)
 {
     String mutableURL(url.string());
     String mutableTitle(title);
-    SIZE_T size = mutableURL.length() + mutableTitle.length() + 2;  // +1 for "\n" and +1 for null terminator
+    SIZE_T size = mutableURL.length() + mutableTitle.length() + 2; // +1 for "\n" and +1 for null terminator
     HGLOBAL cbData = ::GlobalAlloc(GPTR, size * sizeof(UChar));
 
     if (cbData) {
@@ -155,7 +155,7 @@ static void append(Vector<char>& vector, const CString& string)
 }
 
 // Documentation for the CF_HTML format is available at http://msdn.microsoft.com/workshop/networking/clipboard/htmlclipboard.asp
-void markupToCF_HTML(const String& markup, const String& srcURL, Vector<char>& result)
+void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result)
 {
     if (markup.isEmpty())
         return;
@@ -256,7 +256,7 @@ FORMATETC* filenameFormat()
     return &urlFormat;
 }
 
-//MSIE HTML Format
+// MSIE HTML Format
 FORMATETC* htmlFormat() 
 {
     static UINT cf = RegisterClipboardFormat(L"HTML Format");
@@ -294,18 +294,17 @@ String getURL(IDataObject* dataObject, DragData::FilenameConversionPolicy filena
     STGMEDIUM store;
     String url;
     success = false;
-    if (getWebLocData(dataObject, url, title)) {
+    if (getWebLocData(dataObject, url, title))
         success = true;
-        return url;
-    } else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) {
-        //URL using unicode
+    else if (SUCCEEDED(dataObject->GetData(urlWFormat(), &store))) {
+        // URL using Unicode
         UChar* data = (UChar*)GlobalLock(store.hGlobal);
         url = extractURL(String(data), title);
         GlobalUnlock(store.hGlobal);      
         ReleaseStgMedium(&store);
         success = true;
     } else if (SUCCEEDED(dataObject->GetData(urlFormat(), &store))) {
-        //URL using ascii
+        // URL using ASCII
         char* data = (char*)GlobalLock(store.hGlobal);
         url = extractURL(String(data), title);
         GlobalUnlock(store.hGlobal);      
@@ -349,14 +348,14 @@ String getPlainText(IDataObject* dataObject, bool& success)
     String text;
     success = false;
     if (SUCCEEDED(dataObject->GetData(plainTextWFormat(), &store))) {
-        //unicode text
+        // Unicode text
         UChar* data = (UChar*)GlobalLock(store.hGlobal);
         text = String(data);
         GlobalUnlock(store.hGlobal);
         ReleaseStgMedium(&store);
         success = true;
     } else if (SUCCEEDED(dataObject->GetData(plainTextFormat(), &store))) {
-        //ascii text
+        // ASCII text
         char* data = (char*)GlobalLock(store.hGlobal);
         text = String(data);
         GlobalUnlock(store.hGlobal);
@@ -372,40 +371,55 @@ String getPlainText(IDataObject* dataObject, bool& success)
     return text;
 }
 
+String getTextHTML(IDataObject* data, bool& success)
+{
+    STGMEDIUM store;
+    String html;
+    success = false;
+    if (SUCCEEDED(data->GetData(texthtmlFormat(), &store))) {
+        UChar* data = static_cast<UChar*>(GlobalLock(store.hGlobal));
+        html = String(data);
+        GlobalUnlock(store.hGlobal);
+        ReleaseStgMedium(&store);
+        success = true;
+    }
+    return html;
+}
+
 PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*)
 {
-    //FIXME: We should be able to create fragments from files
+    // FIXME: We should be able to create fragments from files
     return 0;
 }
 
 bool containsFilenames(const IDataObject*)
 {
-    //FIXME: We'll want to update this once we can produce fragments from files
+    // FIXME: We'll want to update this once we can produce fragments from files
     return false;
 }
 
-//Convert a String containing CF_HTML formatted text to a DocumentFragment
-PassRefPtr<DocumentFragment> fragmentFromCF_HTML(Document* doc, const String& cf_html)
+// Convert a String containing CF_HTML formatted text to a DocumentFragment
+PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document* doc, const String& cfhtml)
 {        
     // obtain baseURL if present
     String srcURLStr("sourceURL:");
     String srcURL;
-    unsigned lineStart = cf_html.find(srcURLStr, 0, false);
+    unsigned lineStart = cfhtml.find(srcURLStr, 0, false);
     if (lineStart != -1) {
-        unsigned srcEnd = cf_html.find("\n", lineStart, false);
+        unsigned srcEnd = cfhtml.find("\n", lineStart, false);
         unsigned srcStart = lineStart+srcURLStr.length();
-        String rawSrcURL = cf_html.substring(srcStart, srcEnd-srcStart);
+        String rawSrcURL = cfhtml.substring(srcStart, srcEnd-srcStart);
         replaceNBSPWithSpace(rawSrcURL);
         srcURL = rawSrcURL.stripWhiteSpace();
     }
 
     // find the markup between "<!--StartFragment -->" and "<!--EndFragment -->", accounting for browser quirks
-    unsigned markupStart = cf_html.find("<html", 0, false);
-    unsigned tagStart = cf_html.find("startfragment", markupStart, false);
-    unsigned fragmentStart = cf_html.find('>', tagStart) + 1;
-    unsigned tagEnd = cf_html.find("endfragment", fragmentStart, false);
-    unsigned fragmentEnd = cf_html.reverseFind('<', tagEnd);
-    String markup = cf_html.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
+    unsigned markupStart = cfhtml.find("<html", 0, false);
+    unsigned tagStart = cfhtml.find("startfragment", markupStart, false);
+    unsigned fragmentStart = cfhtml.find('>', tagStart) + 1;
+    unsigned tagEnd = cfhtml.find("endfragment", fragmentStart, false);
+    unsigned fragmentEnd = cfhtml.reverseFind('<', tagEnd);
+    String markup = cfhtml.substring(fragmentStart, fragmentEnd - fragmentStart).stripWhiteSpace();
 
     return createFragmentFromMarkup(doc, markup, srcURL, FragmentScriptingNotAllowed);
 }
@@ -420,23 +434,19 @@ PassRefPtr<DocumentFragment> fragmentFromHTML(Document* doc, IDataObject* data)
     String html;
     String srcURL;
     if (SUCCEEDED(data->GetData(htmlFormat(), &store))) {
-        //MS HTML Format parsing
+        // MS HTML Format parsing
         char* data = (char*)GlobalLock(store.hGlobal);
         SIZE_T dataSize = ::GlobalSize(store.hGlobal);
-        String cf_html(UTF8Encoding().decode(data, dataSize));         
+        String cfhtml(UTF8Encoding().decode(data, dataSize));         
         GlobalUnlock(store.hGlobal);
         ReleaseStgMedium(&store); 
-        if (PassRefPtr<DocumentFragment> fragment = fragmentFromCF_HTML(doc, cf_html))
+        if (PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(doc, cfhtml))
             return fragment;
     } 
-    if (SUCCEEDED(data->GetData(texthtmlFormat(), &store))) {
-        //raw html
-        UChar* data = (UChar*)GlobalLock(store.hGlobal);
-        html = String(data);
-        GlobalUnlock(store.hGlobal);      
-        ReleaseStgMedium(&store);
+    bool success = false;
+    html = getTextHTML(data, success);
+    if (success)
         return createFragmentFromMarkup(doc, html, srcURL, FragmentScriptingNotAllowed);
-    } 
 
     return 0;
 }
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.h b/WebCore/platform/win/ClipboardUtilitiesWin.h
index ac5efd8..4ca46f9 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.h
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.h
@@ -49,7 +49,7 @@ FORMATETC* htmlFormat();
 FORMATETC* cfHDropFormat();
 FORMATETC* smartPasteFormat();
 
-void markupToCF_HTML(const String& markup, const String& srcURL, Vector<char>& result);
+void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& result);
 
 void replaceNewlinesWithWindowsStyleNewlines(String&);
 void replaceNBSPWithSpace(String&);
@@ -59,12 +59,12 @@ bool containsHTML(IDataObject*);
 
 PassRefPtr<DocumentFragment> fragmentFromFilenames(Document*, const IDataObject*);
 PassRefPtr<DocumentFragment> fragmentFromHTML(Document*, IDataObject*);
-PassRefPtr<DocumentFragment> fragmentFromCF_HTML(Document*, const String& cf_html);
+PassRefPtr<DocumentFragment> fragmentFromCFHTML(Document*, const String& cfhtml);
 
 String getURL(IDataObject*, DragData::FilenameConversionPolicy, bool& success, String* title = 0);
 String getPlainText(IDataObject*, bool& success);
+String getTextHTML(IDataObject*, bool& success);
 
 } // namespace WebCore
 
 #endif // ClipboardUtilitiesWin_h
-
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 3c3a205..2cd6feb 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -105,9 +105,8 @@ static inline void pathRemoveBadFSCharacters(PWSTR psz, size_t length)
     size_t readFrom = 0;
     while (readFrom < length) {
         UINT type = PathGetCharType(psz[readFrom]);
-        if (psz[readFrom] == 0 || type & (GCT_LFNCHAR | GCT_SHORTCHAR)) {
+        if (!psz[readFrom] || type & (GCT_LFNCHAR | GCT_SHORTCHAR))
             psz[writeTo++] = psz[readFrom];
-        }
 
         readFrom++;
     }
@@ -215,7 +214,7 @@ static HGLOBAL createGlobalImageFileContent(SharedBuffer* data)
 
 static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, SharedBuffer* data)
 {
-    if (fileName.isEmpty() || !data )
+    if (fileName.isEmpty() || !data)
         return 0;
 
     WCHAR filePath[MAX_PATH];
@@ -290,7 +289,7 @@ static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& ti
     fgd->cItems = 1;
     fgd->fgd[0].dwFlags = FD_FILESIZE;
     int fileSize = ::WideCharToMultiByte(CP_ACP, 0, url.characters(), url.length(), 0, 0, 0, 0);
-    fileSize += strlen(szShellDotUrlTemplate) - 2;  // -2 is for getting rid of %s in the template string
+    fileSize += strlen(szShellDotUrlTemplate) - 2; // -2 is for getting rid of %s in the template string
     fgd->fgd[0].nFileSizeLow = fileSize;
     estimatedSize = fileSize;
     fsPath = filesystemPathFromUrlOrTitle(url, title, L".URL", true);
@@ -437,7 +436,7 @@ static bool writeURL(WCDataObject *data, const KURL& url, String title, bool wit
 
     if (withHTML) {
         Vector<char> cfhtmlData;
-        markupToCF_HTML(urlToMarkup(url, title), "", cfhtmlData);
+        markupToCFHTML(urlToMarkup(url, title), "", cfhtmlData);
         medium.hGlobal = createGlobalData(cfhtmlData);
         if (medium.hGlobal && FAILED(data->SetData(htmlFormat(), &medium, TRUE)))
             ::GlobalFree(medium.hGlobal);
@@ -458,7 +457,7 @@ static bool writeURL(WCDataObject *data, const KURL& url, String title, bool wit
 
 void ClipboardWin::clearData(const String& type)
 {
-    //FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
+    // FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
     ASSERT(isForDragging());
     if (policy() != ClipboardWritable || !m_writableDataObject)
         return;
@@ -478,7 +477,7 @@ void ClipboardWin::clearData(const String& type)
 
 void ClipboardWin::clearAllData()
 {
-    //FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
+    // FIXME: Need to be able to write to the system clipboard <rdar://problem/5015941>
     ASSERT(isForDragging());
     if (policy() != ClipboardWritable)
         return;
@@ -491,14 +490,13 @@ void ClipboardWin::clearAllData()
 String ClipboardWin::getData(const String& type, bool& success) const
 {     
     success = false;
-    if (policy() != ClipboardReadable || !m_dataObject) {
+    if (policy() != ClipboardReadable || !m_dataObject)
         return "";
-    }
 
     ClipboardDataType dataType = clipboardTypeFromMIMEType(type);
     if (dataType == ClipboardDataTypeText)
         return getPlainText(m_dataObject.get(), success);
-    else if (dataType == ClipboardDataTypeURL) 
+    if (dataType == ClipboardDataTypeURL)
         return getURL(m_dataObject.get(), DragData::DoNotConvertFilenames, success);
     
     return "";
@@ -568,9 +566,8 @@ HashSet<String> ClipboardWin::types() const
     FORMATETC data;
 
     // IEnumFORMATETC::Next returns S_FALSE if there are no more items.
-    while (itr->Next(1, &data, 0) == S_OK) {
+    while (itr->Next(1, &data, 0) == S_OK)
         addMimeTypesForFormat(results, data);
-    }
 
     return results;
 }
@@ -720,7 +717,7 @@ void ClipboardWin::declareAndWriteDragImage(Element* element, const KURL& url, c
 
     // Put img tag on the clipboard referencing the image
     Vector<char> data;
-    markupToCF_HTML(imageToMarkup(fullURL), "", data);
+    markupToCFHTML(imageToMarkup(fullURL), "", data);
     medium.hGlobal = createGlobalData(data);
     if (medium.hGlobal && FAILED(m_writableDataObject->SetData(htmlFormat(), &medium, TRUE)))
         ::GlobalFree(medium.hGlobal);
@@ -757,7 +754,7 @@ void ClipboardWin::writeRange(Range* selectedRange, Frame* frame)
     ExceptionCode ec = 0;
 
     Vector<char> data;
-    markupToCF_HTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
+    markupToCFHTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
         selectedRange->startContainer(ec)->document()->url().string(), data);
     medium.hGlobal = createGlobalData(data);
     if (medium.hGlobal && FAILED(m_writableDataObject->SetData(htmlFormat(), &medium, TRUE)))
diff --git a/WebCore/platform/win/ClipboardWin.h b/WebCore/platform/win/ClipboardWin.h
index 49fdcfe..1b139ed 100644
--- a/WebCore/platform/win/ClipboardWin.h
+++ b/WebCore/platform/win/ClipboardWin.h
@@ -26,66 +26,66 @@
 #ifndef ClipboardWin_h
 #define ClipboardWin_h
 
+#include "COMPtr.h"
 #include "CachedResourceClient.h"
 #include "Clipboard.h"
-#include "COMPtr.h"
 
 struct IDataObject;
 
 namespace WebCore {
 
-    class CachedImage;
-    class IntPoint;
-    class WCDataObject;
-
-    // State available during IE's events for drag and drop and copy/paste
-    class ClipboardWin : public Clipboard, public CachedResourceClient {
-    public:
-        static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
-        {
-            return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
-        }
-        static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
-        {
-            return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
-        }
-        ~ClipboardWin();
-    
-        void clearData(const String& type);
-        void clearAllData();
-        String getData(const String& type, bool& success) const;
-        bool setData(const String& type, const String& data);
-    
-        // extensions beyond IE's API
-        virtual HashSet<String> types() const;
-        virtual PassRefPtr<FileList> files() const;
-    
-        void setDragImage(CachedImage*, const IntPoint&);
-        void setDragImageElement(Node*, const IntPoint&);
-
-        virtual DragImageRef createDragImage(IntPoint& dragLoc) const;
-        virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
-        virtual void writeURL(const KURL&, const String&, Frame*);
-        virtual void writeRange(Range*, Frame*);
-        virtual void writePlainText(const String&);
-
-        virtual bool hasData();
-
-        COMPtr<IDataObject> dataObject() { return m_dataObject; }
-
-        void setExternalDataObject(IDataObject *dataObject);
-
-    private:
-        ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
-        ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
-
-        void resetFromClipboard();
-        void setDragImage(CachedImage*, Node*, const IntPoint&);
-
-        COMPtr<IDataObject> m_dataObject;
-        COMPtr<WCDataObject> m_writableDataObject;
-        Frame* m_frame;
-    };
+class CachedImage;
+class IntPoint;
+class WCDataObject;
+
+// State available during IE's events for drag and drop and copy/paste
+class ClipboardWin : public Clipboard, public CachedResourceClient {
+public:
+    static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
+    {
+        return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+    }
+    static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
+    {
+        return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+    }
+    ~ClipboardWin();
+
+    void clearData(const String& type);
+    void clearAllData();
+    String getData(const String& type, bool& success) const;
+    bool setData(const String& type, const String& data);
+
+    // extensions beyond IE's API
+    virtual HashSet<String> types() const;
+    virtual PassRefPtr<FileList> files() const;
+
+    void setDragImage(CachedImage*, const IntPoint&);
+    void setDragImageElement(Node*, const IntPoint&);
+
+    virtual DragImageRef createDragImage(IntPoint& dragLoc) const;
+    virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
+    virtual void writeURL(const KURL&, const String&, Frame*);
+    virtual void writeRange(Range*, Frame*);
+    virtual void writePlainText(const String&);
+
+    virtual bool hasData();
+
+    COMPtr<IDataObject> dataObject() { return m_dataObject; }
+
+    void setExternalDataObject(IDataObject *dataObject);
+
+private:
+    ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
+    ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
+
+    void resetFromClipboard();
+    void setDragImage(CachedImage*, Node*, const IntPoint&);
+
+    COMPtr<IDataObject> m_dataObject;
+    COMPtr<WCDataObject> m_writableDataObject;
+    Frame* m_frame;
+};
 
 } // namespace WebCore
 
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index 512f6cf..808c863 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -54,7 +54,7 @@ static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM w
     LRESULT lresult = 0;
     LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
 
-    switch(message) {
+    switch (message) {
     case WM_RENDERFORMAT:
         // This message comes when SetClipboardData was sent a null data handle 
         // and now it's come time to put the data on the clipboard.
@@ -117,7 +117,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
     if (::OpenClipboard(m_owner)) {
         ExceptionCode ec = 0;
         Vector<char> data;
-        markupToCF_HTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
+        markupToCFHTML(createMarkup(selectedRange, 0, AnnotateForInterchange),
             selectedRange->startContainer(ec)->document()->url().string(), data);
         HGLOBAL cbData = createGlobalData(data);
         if (!::SetClipboardData(HTMLClipboardFormat, cbData))
@@ -139,7 +139,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
     // enable smart-replacing later on by putting dummy data on the pasteboard
     if (canSmartCopyOrDelete) {
         if (::OpenClipboard(m_owner)) {
-            ::SetClipboardData(WebSmartPasteFormat, NULL);
+            ::SetClipboardData(WebSmartPasteFormat, 0);
             ::CloseClipboard();
         }
         
@@ -185,7 +185,7 @@ void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
     // write to clipboard in format CF_HTML to be able to paste into contenteditable areas as a link
     if (::OpenClipboard(m_owner)) {
         Vector<char> data;
-        markupToCF_HTML(urlToMarkup(url, title), "", data);
+        markupToCFHTML(urlToMarkup(url, title), "", data);
         HGLOBAL cbData = createGlobalData(data);
         if (!::SetClipboardData(HTMLClipboardFormat, cbData))
             ::GlobalFree(cbData);
@@ -260,8 +260,8 @@ String Pasteboard::plainText(Frame* frame)
             ::GlobalUnlock(cbData);
             ::CloseClipboard();
             return fromClipboard;
-        } else
-            ::CloseClipboard();
+        }
+        ::CloseClipboard();
     }
 
     if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) {
@@ -272,8 +272,8 @@ String Pasteboard::plainText(Frame* frame)
             ::GlobalUnlock(cbData);
             ::CloseClipboard();
             return fromClipboard;
-        } else
-            ::CloseClipboard();
+        }
+        ::CloseClipboard();
     }
 
     return String();
@@ -288,11 +288,11 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
         HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat);
         if (cbData) {
             SIZE_T dataSize = ::GlobalSize(cbData);
-            String cf_html(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
+            String cfhtml(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
             ::GlobalUnlock(cbData);
             ::CloseClipboard();
 
-            PassRefPtr<DocumentFragment> fragment = fragmentFromCF_HTML(frame->document(), cf_html);
+            PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(frame->document(), cfhtml);
             if (fragment)
                 return fragment;
         } else 
@@ -306,7 +306,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
             if (cbData) {
                 UChar* buffer = (UChar*)GlobalLock(cbData);
                 String str(buffer);
-                ::GlobalUnlock( cbData );
+                ::GlobalUnlock(cbData);
                 ::CloseClipboard();
                 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
                 if (fragment)
@@ -323,7 +323,7 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
             if (cbData) {
                 char* buffer = (char*)GlobalLock(cbData);
                 String str(buffer);
-                ::GlobalUnlock( cbData );
+                ::GlobalUnlock(cbData);
                 ::CloseClipboard();
                 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
                 if (fragment)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list