From: Richard Heck Date: Sun, 23 Mar 2008 14:26:13 +0000 (+0000) Subject: Revert 23899 and introduce the correct fix. X-Git-Tag: 1.6.10~5482 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ec5ac0486af98ac871be2335e2460682035768dc;p=features.git Revert 23899 and introduce the correct fix. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23904 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 8cd2d66906..6772c0668d 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -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; } diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index de06ea4983..0953912cf9 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -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; }