Remove some hack code #2909
This commit is contained in:
parent
221a9a71c4
commit
4344b16a20
|
@ -95,7 +95,6 @@ OSXClipboard::synchronize()
|
||||||
void
|
void
|
||||||
OSXClipboard::add(EFormat format, const String & data)
|
OSXClipboard::add(EFormat format, const String & data)
|
||||||
{
|
{
|
||||||
bool emptied = false;
|
|
||||||
if (m_pboard == NULL)
|
if (m_pboard == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -121,24 +120,16 @@ OSXClipboard::add(EFormat format, const String & data)
|
||||||
CFStringRef flavorType = converter->getOSXFormat();
|
CFStringRef flavorType = converter->getOSXFormat();
|
||||||
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
|
||||||
|
|
||||||
// integ tests showed that if you call add(...) twice, then the
|
PasteboardPutItemFlavor(
|
||||||
// second call will actually fail to set clipboard data. calling
|
m_pboard,
|
||||||
// empty() seems to solve this problem. but, only clear the clipboard
|
(PasteboardItemID) 0,
|
||||||
// for the first converter, otherwise further converters will wipe out
|
flavorType,
|
||||||
// what we just added.
|
dataRef,
|
||||||
if (!emptied) {
|
kPasteboardFlavorNoFlags);
|
||||||
empty();
|
|
||||||
emptied = true;
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue