]> git.lyx.org Git - lyx.git/commitdiff
move code to unify graphics groups from GuiGraphics to InsetGraphics
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 25 Sep 2008 13:24:52 +0000 (13:24 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 25 Sep 2008 13:24:52 +0000 (13:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26540 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiGraphics.cpp
src/insets/InsetGraphics.cpp

index 09454b8f6c3a4fdc7567cbfc2a2fafdba1446ca2..2b6bf01908b8f67ac10e14f5b7200146fd92f57e 100644 (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();
 }
 
 
index 23fa3b1a59ff99a397a6bab35bd9907bd9dbb7a7..f7c55eab2f3782a298511f6ab9904d5d77b940af 100644 (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;
        }