mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
Fix multiple cell pasting on Windows and Mac (bug 4436):
* src/frontends/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/branches/BRANCH_1_5_X@22326 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
80410d0386
commit
762a38c282
@ -55,6 +55,9 @@ public:
|
||||
/// \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.
|
||||
|
@ -118,6 +118,19 @@ bool GuiClipboard::isInternal() const
|
||||
}
|
||||
|
||||
|
||||
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()->
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
void put(std::string const & lyx, docstring const & text);
|
||||
bool hasLyXContents() const;
|
||||
bool isInternal() const;
|
||||
bool hasInternal() const;
|
||||
bool empty() const;
|
||||
//@}
|
||||
|
||||
|
@ -3449,7 +3449,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
case LFUN_PASTE:
|
||||
if (tabularStackDirty() && theClipboard().isInternal()) {
|
||||
if (tabularStackDirty() && (theClipboard().isInternal() ||
|
||||
!theClipboard().hasInternal() && theClipboard().hasLyXContents())) {
|
||||
recordUndoInset(cur, Undo::INSERT);
|
||||
pasteClipboard(cur);
|
||||
break;
|
||||
|
@ -80,6 +80,8 @@ What's new
|
||||
- Overwrite selected text when inserting from the math panel (bug 4055,
|
||||
part 2).
|
||||
|
||||
- Fix pasting of multiple tabular cells on Mac and Windows (bug 4436).
|
||||
|
||||
- Fix the function "mark-on" (bug 2913).
|
||||
|
||||
- Fix rows alignment in the gather environment (part of bug 1497).
|
||||
|
Loading…
x
Reference in New Issue
Block a user