]> git.lyx.org Git - lyx.git/blobdiff - src/insets/updatableinset.C
fix #832
[lyx.git] / src / insets / updatableinset.C
index 9ba5820d56e1badcabcb2d92f58469d99237b31a..eb61360c69a585d1dcb5cbc15b5ecb5e268861e7 100644 (file)
 // some stuff for inset locking
 
 UpdatableInset::UpdatableInset()
-       : Inset(), cursor_visible_(false), block_drawing_(false)
+       : Inset(), block_drawing_(false)
 {}
 
 
 UpdatableInset::UpdatableInset(UpdatableInset const & in, bool same_id)
-       : Inset(in, same_id), cursor_visible_(false), block_drawing_(false)
+       : Inset(in, same_id), block_drawing_(false)
 {}
 
 
@@ -48,30 +48,10 @@ Inset::EDITABLE UpdatableInset::editable() const
 }
 
 
-void UpdatableInset::toggleInsetCursor(BufferView *)
-{}
-
-
-void UpdatableInset::showInsetCursor(BufferView *, bool)
-{}
-
-
-void UpdatableInset::hideInsetCursor(BufferView *)
-{}
-
-
 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
 {
@@ -160,9 +140,9 @@ Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
 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));
        }
@@ -172,15 +152,14 @@ int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
        // 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 (topx_set && owner()) {
-               w -= top_x;
-               w += owner()->x();
-       } else if (owner()) {
-               // this is needed as otherwise we might have a too large inset if
-               // its top_x afterwards changes to LeftMargin so we try to put at
-               // least the default margin as top_x
+
+       // Deep magic. I don't understand this either.
+       if (owner() && owner()->owner()) {
+               // add the right paper margin
                w -= 20;
        }
+
+       // FIXME: why ?
        if (w < 10) {
                w = 10;
        }