Am 08.12.2010 um 23:36 schrieb Enrico Forestieri:

> On Wed, Dec 08, 2010 at 10:05:32PM +0100, Vincent van Ravesteijn wrote:
>> This has the clue!
>> 
>>      case LFUN_PASTE: {
>> 
>>              // without argument?
>>              string const arg = to_utf8(cmd.argument());
>>              if (arg.empty()) {
>>                      if (theClipboard().isInternal())
>>                              pasteFromStack(cur, ... , 0);
>>                      else if (theClipboard().hasGraphicsContents()
>>                                   && !theClipboard().hasTextContents())
>>                              pasteClipboardGraphics(cur, ... );
>>                      else
>>                              pasteClipboardText(cur, ...);
>>              }
>> 
>> For Windows and Linux, theClipboard().isInternal () returns true,
>> while for Mac it doesn't.
> 
> Good catch!
> 
>> The following comment seems to be wrong:
>> 
>> bool GuiClipboard::isInternal() const
>> {
>>      // ownsClipboard() is also true for stuff coming from dialogs, e.g.
>>      // the preamble dialog
>>      // FIXME: This does only work on X11, since ownsClipboard() is
>>      // hardwired to return false on Windows and OS X.
>>      return qApp->clipboard()->ownsClipboard() && hasLyXContents();
>> }
> 
> Indeed. Looking at the Qt sources:
> 
> ...
> 
> So, perhaps the attached patch is right.

I don't know if there are any drawbacks - it works!

Stephan

Reply via email to