This patch removes the "other" setBuffer() calls that seem to have been added to deal with the sort of bug just fixed. I'm not proposing this for branch at all, necessarily, but for trunk. Brief testing suggests it's fine. The CutAndPaste calls seem useless, since the inset gets copied shortly thereafter; the one in updateLabels was put there only as a "hammer" and has now been replaced by the version Abdel originally wanted anyway. But let me not commit this without comment.

rh

--
-----------------------
Richard G Heck Jr
Professor of Philosophy
Brown University

Index: CutAndPaste.cpp
===================================================================
--- CutAndPaste.cpp     (revision 28711)
+++ CutAndPaste.cpp     (working copy)
@@ -221,12 +221,6 @@
 
        InsetIterator const i_end = inset_iterator_end(in);
        for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
-               // Insets store buffer references so need updating.
-               // FIXME This code can probably be deleted. The insets will get 
copied
-               // when they are pasted, at which point their buffer_ members 
will get 
-               // set back to zero.
-               it->setBuffer(const_cast<Buffer &>(buffer));
-
                switch (it->lyxCode()) {
  
                case LABEL_CODE: {
Index: Buffer.cpp
===================================================================
--- Buffer.cpp  (revision 28711)
+++ Buffer.cpp  (working copy)
@@ -2744,7 +2744,6 @@
 
        // update all caches
        clearReferenceCache();
-       inset().setBuffer(const_cast<Buffer &>(*this));
        updateMacros();
 
        Buffer & cbuf = const_cast<Buffer &>(*this);

Reply via email to