* src/Clipboard.h:
* src/frontends/GuiClipboard.{cpp,h}:
- new member hasInternal() which indicates whether the OS knows
the concept of clipboard ownership.
* src/insets/InsetTabular.cpp (doDispatch):
- consider hasInternal() while pasting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22325
a592a061-630c-0410-9148-
cb99ea01b6c8
/// \returns true if the system clipboard has been set within LyX
/// (document contents, dialogs count as external here).
virtual bool isInternal() const = 0;
/// \returns true if the system clipboard has been set within LyX
/// (document contents, dialogs count as external here).
virtual bool isInternal() const = 0;
+ /// \returns true if the OS has the concept of clipboard ownership,
+ /// which is crucial for our concept of internal clipboard.
+ virtual bool hasInternal() const = 0;
/// Is the clipboard empty?
/// \returns true if both the LyX and the plaintext versions of the
/// clipboard are empty.
/// Is the clipboard empty?
/// \returns true if both the LyX and the plaintext versions of the
/// clipboard are empty.
+bool GuiClipboard::hasInternal() const
+{
+ // 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.
+#if (defined(Q_WS_X11))
+ return true;
+#else
+ return false;
+#endif
+}
+
+
void GuiClipboard::on_dataChanged()
{
text_clipboard_empty_ = qApp->clipboard()->
void GuiClipboard::on_dataChanged()
{
text_clipboard_empty_ = qApp->clipboard()->
void put(std::string const & lyx, docstring const & text);
bool hasLyXContents() const;
bool isInternal() const;
void put(std::string const & lyx, docstring const & text);
bool hasLyXContents() const;
bool isInternal() const;
+ bool hasInternal() const;
- if (tabularStackDirty() && theClipboard().isInternal()) {
+ if (tabularStackDirty() && theClipboard().isInternal() ||
+ !theClipboard().hasInternal() && theClipboard().hasLyXContents()) {
cur.recordUndoInset(INSERT_UNDO);
pasteClipboard(cur);
break;
cur.recordUndoInset(INSERT_UNDO);
pasteClipboard(cur);
break;