diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm')
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm b/src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm index 78fb6594c0..f4321ad263 100644 --- a/src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm +++ b/src/3rdparty/webkit/WebCore/platform/mac/ClipboardMac.mm @@ -107,11 +107,15 @@ static String utiTypeFromCocoaType(NSString *type) static void addHTMLClipboardTypesForCocoaType(HashSet<String>& resultTypes, NSString *cocoaType, NSPasteboard *pasteboard) { // UTI may not do these right, so make sure we get the right, predictable result - if ([cocoaType isEqualToString:NSStringPboardType]) + if ([cocoaType isEqualToString:NSStringPboardType]) { resultTypes.add("text/plain"); - else if ([cocoaType isEqualToString:NSURLPboardType]) + return; + } + if ([cocoaType isEqualToString:NSURLPboardType]) { resultTypes.add("text/uri-list"); - else if ([cocoaType isEqualToString:NSFilenamesPboardType]) { + return; + } + if ([cocoaType isEqualToString:NSFilenamesPboardType]) { // If file list is empty, add nothing. // Note that there is a chance that the file list count could have changed since we grabbed the types array. // However, this is not really an issue for us doing a sanity check here. @@ -122,12 +126,15 @@ static void addHTMLClipboardTypesForCocoaType(HashSet<String>& resultTypes, NSSt resultTypes.add("text/uri-list"); resultTypes.add("Files"); } - } else if (String utiType = utiTypeFromCocoaType(cocoaType)) + return; + } + String utiType = utiTypeFromCocoaType(cocoaType); + if (!utiType.isEmpty()) { resultTypes.add(utiType); - else { - // No mapping, just pass the whole string though - resultTypes.add(cocoaType); + return; } + // No mapping, just pass the whole string though + resultTypes.add(cocoaType); } void ClipboardMac::clearData(const String& type) |