> Hi all,
> >
> > A.
> > 1. create a new document (doc1),
> > 2. insert a label,
> > 3. insert a cross-ref
> > 4. create a new document (doc2)
> > 5. insert a cross-ref (in doc2)
> > then the labels in the cross-ref dialog are those from doc1.
> >
This is solved by the attached patch.
We should not restore the last used buffer if the active buffer has
changed. Especially not when you cannot choose the buffer which is now
still the case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27165
a592a061-630c-0410-9148-
cb99ea01b6c8
bc().addReadOnly(bufferCO);
restored_buffer_ = -1;
+ active_buffer_ = -1;
}
bufferCO->addItem(toqstr(makeDisplayPath(it->absFilename())));
}
+ int thebuffer = theBufferList().bufferNum(buffer().fileName());
// restore the buffer combo setting for new insets
if (params_["reference"].empty() && restored_buffer_ != -1
- && restored_buffer_ < bufferCO->count())
+ && restored_buffer_ < bufferCO->count() && thebuffer == active_buffer_)
bufferCO->setCurrentIndex(restored_buffer_);
else {
int num = theBufferList().bufferNum(buffer().fileName());
bufferCO->setCurrentIndex(num);
+ if (thebuffer != active_buffer_)
+ restored_buffer_ = num;
}
+ active_buffer_ = thebuffer;
updateRefs();
bc().setValid(false);
QString last_reference_;
/// store the buffer settings
int restored_buffer_;
+ /// store the last active buffer
+ int active_buffer_;
/// the references
std::vector<docstring> refs_;
};