]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.cpp
* disable some invalid insets in description items (covers bug 5937).
[lyx.git] / src / CutAndPaste.cpp
index e7a17f17200eedce34dca0f2c9e4cc9ce562e7eb..6ecc49a4aa138a0075ff752dab43628c58ff58d4 100644 (file)
@@ -221,8 +221,12 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
 
        InsetIterator const i_end = inset_iterator_end(in);
        for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
+               // Even though this will also be done later, it has to be done here 
+               // since, e.g., InsetLabel::updateCommand() is going to try to access
+               // the buffer() member.
+               it->setBuffer(const_cast<Buffer &>(buffer));
                switch (it->lyxCode()) {
+
                case LABEL_CODE: {
                        // check for duplicates
                        InsetCommand & lab = static_cast<InsetCommand &>(*it);