Simplify PLATFORM ifdefs within Editor around writing selections
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Sep 2017 00:15:30 +0000 (00:15 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Sep 2017 00:15:30 +0000 (00:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177624

Reviewed by Alex Christensen.

No new tests. No change in behavior.

* editing/Editor.cpp:
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::copyImage):
* editing/Editor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h

index 074c4cc..7754ab0 100644 (file)
@@ -1,3 +1,17 @@
+2017-09-28  Don Olmstead  <don.olmstead@sony.com>
+
+        Simplify PLATFORM ifdefs within Editor around writing selections
+        https://bugs.webkit.org/show_bug.cgi?id=177624
+
+        Reviewed by Alex Christensen.
+
+        No new tests. No change in behavior.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::performCutOrCopy):
+        (WebCore::Editor::copyImage):
+        * editing/Editor.h:
+
 2017-09-28  Joanmarie Diggs  <jdiggs@igalia.com>
 
         AX: [ATK] object:state-changed notifications missing for multiple ARIA attributes
index 368c244..1655254 100644 (file)
@@ -1302,16 +1302,17 @@ void Editor::performCutOrCopy(EditorActionSpecifier action)
             imageElement = imageElementFromImageDocument(document());
 
         if (imageElement) {
-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
+#if !PLATFORM(WIN)
             writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *imageElement, document().url(), document().title());
 #else
+            // FIXME: Delete after <http://webkit.org/b/177618> lands.
             Pasteboard::createForCopyAndPaste()->writeImage(*imageElement, document().url(), document().title());
 #endif
         } else {
-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
+#if !PLATFORM(WIN)
             writeSelectionToPasteboard(*Pasteboard::createForCopyAndPaste());
 #else
-            // FIXME: Convert all other platforms to match Mac and delete this.
+            // FIXME: Delete after <http://webkit.org/b/177618> lands.
             Pasteboard::createForCopyAndPaste()->writeSelection(*selection, canSmartCopyOrDelete(), m_frame, IncludeImageAltTextForDataTransfer);
 #endif
         }
@@ -1433,9 +1434,10 @@ void Editor::copyImage(const HitTestResult& result)
     if (url.isEmpty())
         url = result.absoluteImageURL();
 
-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
+#if !PLATFORM(WIN)
     writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *element, url, result.altDisplayString());
 #else
+    // FIXME: Delete after <http://webkit.org/b/177618> lands.
     Pasteboard::createForCopyAndPaste()->writeImage(*element, url, result.altDisplayString());
 #endif
 }
index 3c0feea..84405cb 100644 (file)
@@ -479,7 +479,7 @@ public:
     WEBCORE_EXPORT void replaceSelectionWithAttributedString(NSAttributedString *, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
 #endif
 
-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
+#if !PLATFORM(WIN)
     WEBCORE_EXPORT void writeSelectionToPasteboard(Pasteboard&);
     WEBCORE_EXPORT void writeImageToPasteboard(Pasteboard&, Element& imageElement, const URL&, const String& title);
     void writeSelection(PasteboardWriterData&);