]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbutton.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetbutton.C
index 832dae795c77828b0a4e27a6ecbde3fa9774e4c3..53ea6738142499dbaf65642d0ecb4aa797712c6f 100644 (file)
@@ -16,6 +16,7 @@
 #include "insetbutton.h"
 #include "debug.h"
 #include "BufferView.h"
+#include "frontends/LyXView.h"
 #include "frontends/Painter.h"
 #include "support/LAssert.h"
 #include "lyxfont.h"
@@ -92,9 +93,10 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const
 
 
 void InsetButton::draw(BufferView * bv, LyXFont const &,
-                       int baseline, float & x, bool) const
+                       int baseline, float & x) const
 {
        lyx::Assert(bv);
+       cache(bv);
 
        Painter & pain = bv->painter();
        // Draw it as a box with the LaTeX text
@@ -112,3 +114,16 @@ void InsetButton::draw(BufferView * bv, LyXFont const &,
 
        x += width(bv, font);
 }
+
+
+void InsetButton::cache(BufferView * bv) const
+{
+       view_ = bv->owner()->view();
+}
+
+
+#warning Shouldnt this really return a shared_ptr<BufferView>? (Lgb)
+BufferView * InsetButton::view() const
+{
+       return view_.lock().get();
+}