mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
So we do, sometimes, need the setBuffer calls that were removed in r28720.
This patch encapsulates the needed call in Buffer::setBuffersForInsets(), and calls it from Undo::Private::textUndoOrRedo(). As noted in the FIXME, this is still a bit of a "hammer" and ought to be replaced with the sort of more refined approach taken in r28709. But I don't at the moment see how to do that. The place to do it, though, is in doTextUndoOrRed(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28757 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3aecc2c4ff
commit
22ba8256b2
@ -2729,6 +2729,12 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
|
||||
}
|
||||
|
||||
|
||||
void Buffer::setBuffersForInsets() const
|
||||
{
|
||||
inset().setBuffer(const_cast<Buffer &>(*this));
|
||||
}
|
||||
|
||||
|
||||
void Buffer::updateLabels(UpdateScope scope) const
|
||||
{
|
||||
// Use the master text class also for child documents
|
||||
|
@ -476,6 +476,11 @@ public:
|
||||
void setInsetLabel(docstring const & label, InsetLabel const * il);
|
||||
InsetLabel const * insetLabel(docstring const & label) const;
|
||||
|
||||
/// sets the buffer_ member for every inset in this buffer.
|
||||
// FIXME This really shouldn't be needed, but at the moment it's not
|
||||
// clear how to do it just for the individual pieces we need.
|
||||
void setBuffersForInsets() const;
|
||||
///
|
||||
enum UpdateScope {
|
||||
UpdateMaster,
|
||||
UpdateChildOnly
|
||||
|
@ -427,6 +427,7 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
|
||||
doTextUndoOrRedo(cur, stack, otherstack);
|
||||
|
||||
// Adapt the new material to current buffer.
|
||||
buffer_.setBuffersForInsets(); // FIXME This shouldn't be here.
|
||||
buffer_.updateLabels();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user