]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Track change of label name
[lyx.git] / src / Text.cpp
index 1fdef6e2df3dfa3a3d596852097e8196956be16c..7b7e67bbb7cdd2ed4caece57093e61c543827005 100644 (file)
@@ -1812,6 +1812,9 @@ bool Text::dissolveInset(Cursor & cur)
                // but we'll try the cheaper solution here.
                cur.buffer()->clearReferenceCache();
 
+               // Do not revive deleted text
+               lyx::acceptChanges(plist, b.params());
+
                // ERT paragraphs have the Language latex_language.
                // This is invalid outside of ERT, so we need to
                // change it to the buffer language.
@@ -1820,14 +1823,16 @@ bool Text::dissolveInset(Cursor & cur)
                for (; it != it_end; ++it)
                        it->changeLanguage(b.params(), latex_language, b.language());
 
-               /* the inset is the only thing in paragraph, then the layout
-                * of the first paragraph of inset should be remembered.
+               /* If the inset is the only thing in paragraph and the layout
+                * is not plain, then the layout of the first paragraph of
+                * inset should be remembered.
                 * FIXME: this does not work as expected when change tracking
                 *   is on However, we do not really know what to do in this
                 *   case.
                 */
+               DocumentClass const & tclass = cur.buffer()->params().documentClass();
                if (inset_it.lastpos() == 1
-                   && inset_it.nextInset() && !inset_it.nextInset()->forcePlainLayout())
+                   && plist[0].layout().name() != tclass.plainLayoutName())
                        cur.paragraph().makeSameLayout(plist[0]);
 
                pasteParagraphList(cur, plist, b.params().documentClassPtr(),