Juergen Spitzmueller wrote:
> So LFUN_PASTE for multiple tabular cells isn't supposed to work both for
> Mac and Windows.

The attached patch fixes it, according to Bennett's testing. The patch is 
against branch.

Opinions?

Jürgen
Index: src/insets/InsetTabular.cpp
===================================================================
--- src/insets/InsetTabular.cpp	(Revision 22213)
+++ src/insets/InsetTabular.cpp	(Arbeitskopie)
@@ -3449,7 +3449,8 @@
 	}
 
 	case LFUN_PASTE:
-		if (tabularStackDirty() && theClipboard().isInternal()) {
+		if (tabularStackDirty() && (theClipboard().isInternal() ||
+		    !theClipboard().hasInternal() && theClipboard().hasLyXContents())) {
 			recordUndoInset(cur, Undo::INSERT);
 			pasteClipboard(cur);
 			break;
Index: src/frontends/Clipboard.h
===================================================================
--- src/frontends/Clipboard.h	(Revision 22213)
+++ src/frontends/Clipboard.h	(Arbeitskopie)
@@ -55,6 +55,9 @@
 	/// \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.
Index: src/frontends/qt4/GuiClipboard.cpp
===================================================================
--- src/frontends/qt4/GuiClipboard.cpp	(Revision 22213)
+++ src/frontends/qt4/GuiClipboard.cpp	(Arbeitskopie)
@@ -118,6 +118,19 @@
 }
 
 
+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()->
Index: src/frontends/qt4/GuiClipboard.h
===================================================================
--- src/frontends/qt4/GuiClipboard.h	(Revision 22213)
+++ src/frontends/qt4/GuiClipboard.h	(Arbeitskopie)
@@ -39,6 +39,7 @@
 	void put(std::string const & lyx, docstring const & text);
 	bool hasLyXContents() const;
 	bool isInternal() const;
+	bool hasInternal() const;
 	bool empty() const;
 	//@}
 

Reply via email to