case LFUN_GRAPHICS_GROUPS_UNIFY: {
if (cmd.argument().empty())
break;
- //view()->cursor().recordUndoFullDocument(); let inset-apply do that job
graphics::unifyGraphicsGroups(cur.buffer(), to_utf8(cmd.argument()));
processUpdateFlags(Update::Force | Update::FitCursor);
break;
}
-void unifyGraphicsGroups(Buffer const & b, string const & argument)
+void unifyGraphicsGroups(Buffer & b, string const & argument)
{
InsetGraphicsParams params;
InsetGraphics::string2params(argument, b, params);
+ b.undo().beginUndoGroup();
Inset & inset = b.inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);
InsetGraphics & ins = static_cast<InsetGraphics &>(*it);
InsetGraphicsParams inspar = ins.getParams();
if (params.groupId == inspar.groupId) {
+ b.undo().recordUndo(it);
params.filename = inspar.filename;
ins.setParams(params);
}
}
}
-
+ b.undo().endUndoGroup();
}
/** Synchronize all Graphics insets of the group.
Both groupId and params are taken from argument.
*/
- void unifyGraphicsGroups(Buffer const &, std::string const &);
+ void unifyGraphicsGroups(Buffer &, std::string const &);
InsetGraphics * getCurrentGraphicsInset(Cursor const &);
}