mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Introduce new function copyInsetToTemp
This is a version of copyInset that does touch the cut stack and the X selection. Part of bug #4582.
This commit is contained in:
parent
2c53f0315e
commit
0b27eb7deb
@ -1037,7 +1037,9 @@ void copySelection(Cursor const & cur)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext)
|
namespace {
|
||||||
|
|
||||||
|
void copyInsetToStack(Cursor const & cur, CutStack & cutstack, Inset * inset)
|
||||||
{
|
{
|
||||||
ParagraphList pars;
|
ParagraphList pars;
|
||||||
Paragraph par;
|
Paragraph par;
|
||||||
@ -1046,13 +1048,28 @@ void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext)
|
|||||||
Font font(inherit_font, bp.language);
|
Font font(inherit_font, bp.language);
|
||||||
par.insertInset(0, inset, font, Change(Change::UNCHANGED));
|
par.insertInset(0, inset, font, Change(Change::UNCHANGED));
|
||||||
pars.push_back(par);
|
pars.push_back(par);
|
||||||
theCuts.push(make_pair(pars, make_pair(bp.documentClassPtr(), bp.authors())));
|
cutstack.push(make_pair(pars, make_pair(bp.documentClassPtr(), bp.authors())));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext)
|
||||||
|
{
|
||||||
|
copyInsetToStack(cur, theCuts, inset);
|
||||||
|
|
||||||
// stuff the selection onto the X clipboard, from an explicit copy request
|
// stuff the selection onto the X clipboard, from an explicit copy request
|
||||||
|
BufferParams const & bp = cur.buffer()->params();
|
||||||
putClipboard(theCuts[0].first, theCuts[0].second, plaintext, bp);
|
putClipboard(theCuts[0].first, theCuts[0].second, plaintext, bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void copyInsetToTemp(Cursor const & cur, Inset * inset)
|
||||||
|
{
|
||||||
|
copyInsetToStack(cur, tempCut, inset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void copySelectionToStack(CursorData const & cur, CutStack & cutstack)
|
void copySelectionToStack(CursorData const & cur, CutStack & cutstack)
|
||||||
|
@ -79,6 +79,8 @@ void copySelection(Cursor const & cur);
|
|||||||
void copySelectionToTemp(Cursor const & cur);
|
void copySelectionToTemp(Cursor const & cur);
|
||||||
///
|
///
|
||||||
void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext);
|
void copyInset(Cursor const & cur, Inset * inset, docstring const & plaintext);
|
||||||
|
///
|
||||||
|
void copyInsetToTemp(Cursor const & cur, Inset * inset);
|
||||||
/**
|
/**
|
||||||
* Push the current selection to the cut buffer and the system clipboard.
|
* Push the current selection to the cut buffer and the system clipboard.
|
||||||
* \param plaintext plain text version of the selection for the system
|
* \param plaintext plain text version of the selection for the system
|
||||||
|
Loading…
Reference in New Issue
Block a user