commit e00b11355d640c9ce2b279bc7ae7d33a8caebdf9
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri May 11 13:17:39 2018 +0200

    Merge paragraphs when pasted into an inset that forbids multipars
    
    Fixes: #8281
    (cherry picked from commit 5dde4b1b3e69f132e2f27116cde377f80adb5ea3)
---
 src/CutAndPaste.cpp |    8 ++++++++
 status.23x          |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 43e6278..9507b2b 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -142,6 +142,14 @@ pasteSelectionHelper(DocIterator const & cur, 
ParagraphList const & parlist,
        // Now remove all out of the pars which is NOT allowed in the
        // new environment and set also another font if that is required.
 
+       // Merge paragraphs that are to be pasted into a text inset
+       // that does not allow multiple pars.
+       InsetText * inset_text = target_inset->asInsetText();
+       if (inset_text && !inset_text->allowMultiPar()) {
+               while (insertion.size() > 1)
+                       mergeParagraph(buffer.params(), insertion, 0);
+       }
+
        // Convert newline to paragraph break in ParbreakIsNewline
        if (target_inset->getLayout().parbreakIsNewline()
            || pars[pit].layout().parbreak_is_newline) {
diff --git a/status.23x b/status.23x
index dcee947..76a9e76 100644
--- a/status.23x
+++ b/status.23x
@@ -173,6 +173,9 @@ What's new
 
 - Fix suprious comma in book and thesis bib preview (bug 11272).
 
+- Merge paragraphs when pasted into an inset that forbids multiple
+  paragraphs (bug 8281).
+
 
 * INTERNALS
 

Reply via email to