// 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)
{}
// An updatable inset is highly editable by definition
-Inset::EDITABLE UpdatableInset::editable() const
+InsetOld::EDITABLE UpdatableInset::editable() const
{
return HIGHLY_EDITABLE;
}
void UpdatableInset::scroll(BufferView * bv, float s) const
{
- LyXFont font;
+ //LyXFont font;
if (!s) {
scx = 0;
/// 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;
}
-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;