]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
fix msvc warning, somehow msvc thinks !line[0] is a boolean
[lyx.git] / src / CutAndPaste.cpp
index 9bed935d38eff7ec348cbb6ae179293b26bad45e..99f8383e6b027abf14a4fa222942e182cb34ccf8 100644 (file)
@@ -97,7 +97,7 @@ bool checkPastePossible(int index)
 
 
 pair<PitPosPair, pit_type>
-pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
+pasteSelectionHelper(Cursor const & cur, ParagraphList const & parlist,
                     DocumentClass const * const oldDocClass, ErrorList & errorlist)
 {
        Buffer const & buffer = *cur.buffer();
@@ -537,7 +537,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
                // PassThru paragraphs have the Language
                // latex_language. This is invalid for others, so we
                // need to change it to the buffer language.
-               if (text.inset().getLayout().isPassThru())
+               if (it->isPassThru())
                        it->changeLanguage(buf.params(), 
                                           latex_language, buf.language());
        }
@@ -784,7 +784,12 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
 
                // need a valid cursor. (Lgb)
                cur.clearSelection();
-               cur.forceBufferUpdate();
+
+               // After a cut operation, we must make sure that the Buffer is updated
+               // because some further operation might need updated label information for
+               // example. So we cannot just use "cur.forceBufferUpdate()" here.
+               // This fixes #7071.
+               cur.buffer()->updateBuffer();
 
                // tell tabular that a recent copy happened
                dirtyTabularStack(false);