mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
When pasting text, keep line breaks when "parbreak is newline"
This is much easier for listings, ERT or Verbatim. Fixes bug #8026.
This commit is contained in:
parent
51e92a5a97
commit
542445d07d
@ -2269,6 +2269,12 @@ bool Paragraph::isPassThru() const
|
||||
}
|
||||
|
||||
|
||||
bool Paragraph::parbreakIsNewline() const
|
||||
{
|
||||
return inInset().getLayout().parbreakIsNewline() || d->layout_->parbreak_is_newline;
|
||||
}
|
||||
|
||||
|
||||
bool Paragraph::isPartOfTextSequence() const
|
||||
{
|
||||
for (pos_type i = 0; i < size(); ++i) {
|
||||
|
@ -239,6 +239,8 @@ public:
|
||||
///
|
||||
bool isPassThru() const;
|
||||
///
|
||||
bool parbreakIsNewline() const;
|
||||
///
|
||||
bool isPartOfTextSequence() const;
|
||||
///
|
||||
pos_type size() const;
|
||||
|
@ -1521,7 +1521,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
pasteFromStack(cur, bv->buffer().errorList("Paste"), 0);
|
||||
else if (theClipboard().hasTextContents()) {
|
||||
if (pasteClipboardText(cur, bv->buffer().errorList("Paste"),
|
||||
true, Clipboard::AnyTextType))
|
||||
!cur.paragraph().parbreakIsNewline(),
|
||||
Clipboard::AnyTextType))
|
||||
tryGraphics = false;
|
||||
}
|
||||
if (tryGraphics && theClipboard().hasGraphicsContents())
|
||||
|
Loading…
Reference in New Issue
Block a user