]> git.lyx.org Git - lyx.git/blobdiff - src/insets/updatableinset.C
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / updatableinset.C
index 1772858e63cf15c96cc7aaeb75b1f7a579af6e84..ec6fa2ba81464e6a406acbb7fabf416cd48bd908 100644 (file)
@@ -30,8 +30,8 @@ UpdatableInset::UpdatableInset()
 {}
 
 
-UpdatableInset::UpdatableInset(UpdatableInset const & in, bool same_id)
-       : Inset(in, same_id), block_drawing_(false)
+UpdatableInset::UpdatableInset(UpdatableInset const & in)
+       : Inset(in), block_drawing_(false)
 {}
 
 
@@ -52,21 +52,11 @@ void UpdatableInset::fitInsetCursor(BufferView *) const
 {}
 
 
-void UpdatableInset::edit(BufferView *, int, int, mouse_button::state)
-{}
-
-
-void UpdatableInset::edit(BufferView *, bool)
-{}
-
-
-void UpdatableInset::draw(BufferView *, LyXFont const &,
-                         int /* baseline */, float & x) const
+void UpdatableInset::draw(PainterInfo &, int, int) const
 {
-       x += float(scx);
        // ATTENTION: don't do the following here!!!
-       //    top_x = int(x);
-       //    top_baseline = baseline;
+       //    top_x = x;
+       //    top_baseline = y;
 }
 
 
@@ -150,16 +140,16 @@ int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
        int w;
 
        if (owner()) {
-               w = static_cast<UpdatableInset*> (owner())->getMaxWidth(bv, this);
+               w = static_cast<UpdatableInset *>(owner())->getMaxWidth(bv, this);
        } else {
-               w = bv->text->workWidth(const_cast<UpdatableInset *>(this));
+               w = bv->text->workWidth(this);
        }
        if (w < 0) {
                return -1;
        }
        // check for margins left/right and extra right margin "const 5"
-       if ((w - ((2 * TEXT_TO_INSET_OFFSET) + 5)) >= 0)
-               w -= (2 * TEXT_TO_INSET_OFFSET) + 5;
+       if ((w - (2 * TEXT_TO_INSET_OFFSET + 5)) >= 0)
+               w -= 2 * TEXT_TO_INSET_OFFSET + 5;
 
        // Deep magic. I don't understand this either.
        if (owner() && owner()->owner()) {