mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Fix bug 2746: http://bugzilla.lyx.org/show_bug.cgi?id=2746
References autoupdate is not undone during UNDO operation * InsetLabel.cpp (updateCommand): record undo for each of the label changes (and put everything in a group to make sure it will be undone in one step). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26432 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
00c0933502
commit
32a3da1a84
@ -66,15 +66,19 @@ void InsetLabel::updateCommand(docstring const & new_label, bool updaterefs)
|
||||
"it will be changed to %2$s."), new_label, label));
|
||||
}
|
||||
|
||||
buffer().undo().beginUndoGroup();
|
||||
setParam("name", label);
|
||||
|
||||
if (updaterefs) {
|
||||
Buffer::References & refs = buffer().references(old_label);
|
||||
Buffer::References::iterator it = refs.begin();
|
||||
Buffer::References::iterator end = refs.end();
|
||||
for (; it != end; ++it)
|
||||
for (; it != end; ++it) {
|
||||
buffer().undo().recordUndo(it->second);
|
||||
it->first->setParam("reference", label);
|
||||
}
|
||||
}
|
||||
buffer().undo().endUndoGroup();
|
||||
|
||||
// We need an update of the Buffer reference cache. This is achieved by
|
||||
// updateLabel().
|
||||
|
Loading…
Reference in New Issue
Block a user