]> git.lyx.org Git - lyx.git/blobdiff - src/insets/updatableinset.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / updatableinset.C
index d9ad5d2d105d89a14b437a83e98442ee739c035f..434450d0a68cb0014d76e5b3cebe474b398e84a9 100644 (file)
@@ -27,12 +27,12 @@ using namespace lyx::support;
 // some stuff for inset locking
 
 UpdatableInset::UpdatableInset()
-       : Inset(), block_drawing_(false)
+       : InsetOld(), block_drawing_(false)
 {}
 
 
 UpdatableInset::UpdatableInset(UpdatableInset const & in)
-       : Inset(in), block_drawing_(false)
+       : InsetOld(in), block_drawing_(false)
 {}
 
 
@@ -43,7 +43,7 @@ void UpdatableInset::insetUnlock(BufferView *)
 
 
 // An updatable inset is highly editable by definition
-Inset::EDITABLE UpdatableInset::editable() const
+InsetOld::EDITABLE UpdatableInset::editable() const
 {
        return HIGHLY_EDITABLE;
 }
@@ -63,7 +63,7 @@ void UpdatableInset::draw(PainterInfo &, int, int) const
 
 void UpdatableInset::scroll(BufferView * bv, float s) const
 {
-       LyXFont font;
+       //LyXFont font;
 
        if (!s) {
                scx = 0;
@@ -112,7 +112,7 @@ void UpdatableInset::scroll(BufferView * bv, int offset) const
 
 
 ///  An updatable inset could handle lyx editing commands
-Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
+InsetOld::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
 {
        if (ev.action == LFUN_MOUSE_RELEASE)
                return (editable() == IS_EDITABLE) ? DISPATCHED : UNDISPATCHED;
@@ -133,37 +133,7 @@ Inset::RESULT UpdatableInset::localDispatch(FuncRequest const & ev)
 }
 
 
-int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
-{
-       int w;
-
-       if (owner()) {
-               w = owner()->getMaxWidth(bv, this);
-       } else {
-               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;
-
-       // 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;
-       }
-       return w;
-}
-
-
-LyXCursor const & Inset::cursor(BufferView * bv) const
+LyXCursor const & InsetOld::cursor(BufferView * bv) const
 {
        if (owner())
                return owner()->getLyXText(bv, false)->cursor;