> pasteClipboardText [CutAndPaste.cpp, 912]
> Buffer::readString [Buffer.cpp, 695]
> Buffer::readFile(Lexer,...) [Buffer.cpp, 752]
> Buffer::readDocument [Buffer.cpp, 568]
> Text::read [Text.cpp, 1311]
> readParagraph [Text.cpp, 248]
> readParToken [Text.cpp, 84]
> readInset [factory.cpp, 420]
> InsetGraphics::read [InsetGraphics.cpp, 286]
> readInsetGraphics [InsetGraphics.cpp, 127]
> InsetGraphicsParams::Read [InsetGraphicsParams.cpp, 188]
> DocFileName::set [FileName.cpp, 1073]


Thanks,

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.

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();
}

According to the Qt documentation:

Windows and Mac OS X does not have the concept of ownership; the
clipboard is a fully global resource so all applications are notified
of changes.

http://doc.trolltech.com/stable/qclipboard.html#notes-for-mac-os-x-users

Anyway, when I hardwire isInternal() to return false, I can reproduce
the bug. Indeed, because in pasteClipboardText, we do not use the path
of the target buffer, but the path of the dummy buffer.

Vincent

Reply via email to