This particular implementation was chosen to simplify potential Windows implementations of Clipboard::clearData(). It also helps with copy-and-paste as drag-and-drop; though that part of the spec is current in flux, it doesn't hurt keep it in mind when making patches in this area. Calling writeToPasteboard() should do the following: if (!isForDragging()) return false; if (!isDirty()) return true; // Dirty bit is tracked by each implementation. /* copy data to system pasteboard */ Since the first two lines should be common to all implementations, should I split it into two functions, writeToPasteboard() and virtual writeToPasteboardImpl()?
Created attachment 47656 [details] Patch
After talking with dimich, I have decided to refactor the Clipboard class instead.