From 6cd921678b0b02c428939b70677ce12c4230692a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 25 Sep 2008 13:24:52 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiGraphics.cpp | 5 ----- src/insets/InsetGraphics.cpp | 13 ++++++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index 09454b8f6c..2b6bf01908 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -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(); } diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 23fa3b1a59..f7c55eab2f 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -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; } -- 2.39.5