]> git.lyx.org Git - lyx.git/commitdiff
Revert 23899 and introduce the correct fix.
authorRichard Heck <rgheck@comcast.net>
Sun, 23 Mar 2008 14:26:13 +0000 (14:26 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 23 Mar 2008 14:26:13 +0000 (14:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23904 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp
src/insets/InsetGraphics.cpp

index 8cd2d66906122667452902f9d5ad33cc3d584ddd..6772c0668de687d76af18f35652007641f35cd01 100644 (file)
@@ -1449,7 +1449,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                case LFUN_GRAPHICS_EDIT: {
                        FuncRequest fr(action, argument);
-                       InsetGraphics().dispatch(view()->cursor(), fr);
+                       InsetGraphics ig;
+                       ig.setBuffer(*lyx_view_->buffer());
+                       ig.dispatch(view()->cursor(), fr);
                        break;
                }
 
index de06ea498383da131923dfa1d25691b3b4537e36..0953912cf970e013586565a1d8ccaf50cef3e333 100644 (file)
@@ -175,12 +175,9 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
        case LFUN_GRAPHICS_EDIT: {
-               // use buffer() from cursor because this inset may not
-               // have an initialized buffer_.
-               Buffer const & buf = cur.bv().buffer();
                InsetGraphicsParams p;
-               InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buf, p);
-               editGraphics(p, buf);
+               InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer(), p);
+               editGraphics(p, buffer());
                break;
        }