move code to unify graphics groups from GuiGraphics to InsetGraphics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26540 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-09-25 13:24:52 +00:00
parent 1db80d4df6
commit 6cd921678b
2 changed files with 10 additions and 8 deletions

View File

@ -716,12 +716,7 @@ void GuiGraphics::dispatchParams()
{
InsetGraphicsParams tmp_params(params_);
string const lfun = InsetGraphics::params2string(tmp_params, buffer());
buffer().undo().beginUndoGroup();
dispatch(FuncRequest(getLfun(), lfun));
if (!params_.groupId.empty())
dispatch(FuncRequest(LFUN_GRAPHICS_GROUPS_UNIFY,
InsetGraphics::params2string(params_, buffer())));
buffer().undo().endUndoGroup();
}

View File

@ -197,10 +197,17 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_INSET_MODIFY: {
InsetGraphicsParams p;
string2params(to_utf8(cmd.argument()), buffer(), p);
if (!p.filename.empty())
setParams(p);
else
if (p.filename.empty()) {
cur.noUpdate();
break;
}
setParams(p);
// if the inset is part of a graphics group, all the
// other members should be updated too.
if (!params_.groupId.empty())
graphics::unifyGraphicsGroups(cur.buffer(),
to_utf8(cmd.argument()));
break;
}