]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetgraphics.C
index 43128342690f21076c3a5ac11d9cf0ae9afff393..754f6a6116edc743a726c6b4bcf6b0d6fbd4a846 100644 (file)
@@ -64,6 +64,7 @@ TODO
 #include "gettext.h"
 #include "LaTeXFeatures.h"
 #include "latexrunparams.h"
+#include "lyx_main.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "metricsinfo.h"
@@ -183,27 +184,14 @@ InsetGraphics::~InsetGraphics()
 }
 
 
-void InsetGraphics::cache(BufferView * view) const
-{
-       BOOST_ASSERT(view);
-       view_ = view->owner()->view();
-}
-
-BufferView * InsetGraphics::view() const
-{
-       return view_.lock().get();
-}
-
-
 void InsetGraphics::statusChanged() const
 {
-       BufferView * bv = view();
-       if (bv)
-               bv->updateInset(this);
+       LyX::cref().updateInset(this);
 }
 
 
-dispatch_result InsetGraphics::localDispatch(FuncRequest const & cmd)
+dispatch_result
+InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY: {
@@ -241,7 +229,6 @@ void InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
 {
-       cache(pi.base.bv);
        graphic_->draw(pi, x, y);
 }