#include "latexrunparams.h"
#include "lyxlex.h"
#include "lyxrc.h"
+#include "metricsinfo.h"
#include "frontends/Alert.h"
+#include "frontends/LyXView.h"
#include "support/filetools.h"
#include "support/lyxalgo.h" // lyx::count
}
+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 = graphic_->view();
+ BufferView * bv = view();
if (bv)
bv->updateInset(this);
}
return DISPATCHED;
default:
- return InsetOld::localDispatch(cmd);
+ return UNDISPATCHED;
}
}
void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
{
+ cache(pi.base.bv);
graphic_->draw(pi, x, y);
}