[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:34:14 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 3b3587fedd6349fd4275f244801f94a76cd21211
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 25 15:47:56 2009 +0000

    2009-09-25  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Dan Bernstein.
    
            Enable Pasteboard::writePlainText for Chromium and fix code style nits.
            https://bugs.webkit.org/show_bug.cgi?id=29734
    
            * platform/chromium/PasteboardChromium.cpp:
            (WebCore::Pasteboard::writePlainText):
            * platform/gtk/PasteboardGtk.cpp:
            (WebCore::Pasteboard::writePlainText):
            (WebCore::Pasteboard::writeURL):
            * platform/mac/PasteboardMac.mm:
            (WebCore::Pasteboard::writeSelection):
            (WebCore::Pasteboard::writePlainText):
            (WebCore::Pasteboard::writeURL):
            * platform/qt/PasteboardQt.cpp:
            (WebCore::Pasteboard::writePlainText):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48755 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a302df4..5082ad1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-09-25  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Enable Pasteboard::writePlainText for Chromium and fix code style nits.
+        https://bugs.webkit.org/show_bug.cgi?id=29734
+
+        * platform/chromium/PasteboardChromium.cpp:
+        (WebCore::Pasteboard::writePlainText):
+        * platform/gtk/PasteboardGtk.cpp:
+        (WebCore::Pasteboard::writePlainText):
+        (WebCore::Pasteboard::writeURL):
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::writeSelection):
+        (WebCore::Pasteboard::writePlainText):
+        (WebCore::Pasteboard::writeURL):
+        * platform/qt/PasteboardQt.cpp:
+        (WebCore::Pasteboard::writePlainText):
+
 2009-09-25  Yongjun Zhang  <yongjun.zhang at nokia.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/platform/chromium/PasteboardChromium.cpp b/WebCore/platform/chromium/PasteboardChromium.cpp
index 598dcbf..7702730 100644
--- a/WebCore/platform/chromium/PasteboardChromium.cpp
+++ b/WebCore/platform/chromium/PasteboardChromium.cpp
@@ -98,13 +98,13 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
 
 void Pasteboard::writePlainText(const String& text)
 {
-    String plainText = text;
-
 #if PLATFORM(WIN_OS)
+    String plainText(text);
     replaceNewlinesWithWindowsStyleNewlines(plainText);
+    ChromiumBridge::clipboardWritePlainText(plainText);
+#else
+    ChromiumBridge::clipboardWritePlainText(text);
 #endif
-    // FIXME: uncomment when Chromium CL http://codereview.chromium.org/211052 is closed.
-    //ChromiumBridge::clipboardWritePlainText(plainText);
 }
 
 void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index f1ebe7c..0ff26f7 100644
--- a/WebCore/platform/gtk/PasteboardGtk.cpp
+++ b/WebCore/platform/gtk/PasteboardGtk.cpp
@@ -110,8 +110,9 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
 
 void Pasteboard::writePlainText(const String& text)
 {
+    CString utf8 = text.utf8();
     GtkClipboard* clipboard = gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD);
-    gtk_clipboard_set_text(clipboard, text.utf8().data(), text.utf8().length());
+    gtk_clipboard_set_text(clipboard, utf8.data(), utf8.length());
 }
 
 void Pasteboard::writeURL(const KURL& url, const String&, Frame* frame)
@@ -121,8 +122,9 @@ void Pasteboard::writeURL(const KURL& url, const String&, Frame* frame)
 
     GtkClipboard* clipboard = m_helper->getClipboard(frame);
     GtkClipboard* primary = m_helper->getPrimary(frame);
-    gtk_clipboard_set_text(clipboard, url.string().utf8().data(), url.string().utf8().length());
-    gtk_clipboard_set_text(primary, url.string().utf8().data(), url.string().utf8().length());
+    CString utf8 = url.string().utf8();
+    gtk_clipboard_set_text(clipboard, utf8.data(), utf8.length());
+    gtk_clipboard_set_text(primary, utf8.data(), utf8.length());
 }
 
 void Pasteboard::writeImage(Node* node, const KURL&, const String&)
diff --git a/WebCore/platform/mac/PasteboardMac.mm b/WebCore/platform/mac/PasteboardMac.mm
index 657a329..f048791 100644
--- a/WebCore/platform/mac/PasteboardMac.mm
+++ b/WebCore/platform/mac/PasteboardMac.mm
@@ -135,8 +135,8 @@ static NSAttributedString *stripAttachmentCharacters(NSAttributedString *string)
 
 void Pasteboard::writeSelection(NSPasteboard* pasteboard, Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
 {
-    if (WebArchivePboardType == nil)
-        Pasteboard::generalPasteboard(); //Initialises pasteboard types
+    if (!WebArchivePboardType)
+        Pasteboard::generalPasteboard(); // Initialises pasteboard types
     ASSERT(selectedRange);
     
     NSAttributedString *attributedString = [[[NSAttributedString alloc] _initWithDOMRange:kit(selectedRange)] autorelease];
@@ -205,11 +205,11 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
 
 void Pasteboard::writePlainText(const String& text)
 {
-    if (WebArchivePboardType == nil)
-        Pasteboard::generalPasteboard(); //Initialises pasteboard types
+    if (!WebArchivePboardType)
+        Pasteboard::generalPasteboard(); // Initialises pasteboard types
 
-    NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil];
-    NSPasteboard* pasteboard = m_pasteboard.get();
+    NSArray *types = [NSArray arrayWithObject:NSStringPboardType];
+    NSPasteboard *pasteboard = m_pasteboard.get();
     [pasteboard declareTypes:types owner:nil];
 
     [pasteboard setString:text forType:NSStringPboardType];
@@ -217,10 +217,10 @@ void Pasteboard::writePlainText(const String& text)
 
 void Pasteboard::writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame)
 {
-    if (WebArchivePboardType == nil)
-        Pasteboard::generalPasteboard(); //Initialises pasteboard types
+    if (!WebArchivePboardType)
+        Pasteboard::generalPasteboard(); // Initialises pasteboard types
    
-    if (types == nil) {
+    if (!types) {
         types = writableTypesForURL();
         [pasteboard declareTypes:types owner:nil];
     }
diff --git a/WebCore/platform/qt/PasteboardQt.cpp b/WebCore/platform/qt/PasteboardQt.cpp
index 92879dd..209a573 100644
--- a/WebCore/platform/qt/PasteboardQt.cpp
+++ b/WebCore/platform/qt/PasteboardQt.cpp
@@ -121,7 +121,6 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
 
 void Pasteboard::writePlainText(const String& text)
 {
-
 #ifndef QT_NO_CLIPBOARD
     QMimeData* md = new QMimeData;
     QString qtext = text;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list