From 4344b16a201929755880d3fdac96dff06d427e55 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 2 Dec 2015 10:28:11 -0800 Subject: [PATCH] Remove some hack code #2909 --- src/lib/platform/OSXClipboard.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/lib/platform/OSXClipboard.cpp b/src/lib/platform/OSXClipboard.cpp index b384f853..5b7ebb09 100644 --- a/src/lib/platform/OSXClipboard.cpp +++ b/src/lib/platform/OSXClipboard.cpp @@ -95,7 +95,6 @@ OSXClipboard::synchronize() void OSXClipboard::add(EFormat format, const String & data) { - bool emptied = false; if (m_pboard == NULL) return; @@ -121,24 +120,16 @@ OSXClipboard::add(EFormat format, const String & data) CFStringRef flavorType = converter->getOSXFormat(); CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size()); - // integ tests showed that if you call add(...) twice, then the - // second call will actually fail to set clipboard data. calling - // empty() seems to solve this problem. but, only clear the clipboard - // for the first converter, otherwise further converters will wipe out - // what we just added. - if (!emptied) { - empty(); - emptied = true; - } - - PasteboardPutItemFlavor( - m_pboard, - (PasteboardItemID) 0, - flavorType, - dataRef, - kPasteboardFlavorNoFlags); - LOG((CLOG_DEBUG "added %d bytes to clipboard format: %d", data.size(), format)); - } + PasteboardPutItemFlavor( + m_pboard, + (PasteboardItemID) 0, + flavorType, + dataRef, + kPasteboardFlavorNoFlags); + + LOG((CLOG_DEBUG "added %d bytes to clipboard format: %d", data.size(), format)); + } + } }