]> git.lyx.org Git - features.git/commitdiff
Merge paragraphs when pasted into an inset that forbids multipars
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 11 May 2018 11:17:39 +0000 (13:17 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 14 Oct 2018 07:06:38 +0000 (09:06 +0200)
Fixes: #8281
(cherry picked from commit 5dde4b1b3e69f132e2f27116cde377f80adb5ea3)

src/CutAndPaste.cpp
status.23x

index 43e6278b3ef65e60a694ee507b9418f06d09952f..9507b2b57f1fb70b7160da88b25ad212b3366d6d 100644 (file)
@@ -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) {
index dcee94718cdcaf73ea8bb22d9477e59d75e45a0f..76a9e7633f327e3e9701cc8ead73360688227a54 100644 (file)
@@ -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