return NOT_EDITABLE;
}
-bool Inset::IsTextInset() const
-{
- return ((LyxCode() == TEXT_CODE) ||
- (LyxCode() == ERT_CODE) ||
- (LyxCode() == FOOT_CODE) ||
- (LyxCode() == MARGIN_CODE));
-}
void Inset::Validate(LaTeXFeatures &) const
{
}
-LyXFont Inset::ConvertFont(LyXFont font)
+LyXFont Inset::ConvertFont(LyXFont const & font) const
{
- return font;
+ return LyXFont(font);
}
return _("Opened inset");
}
+
+LyXText * Inset::getLyXText(BufferView * bv) const
+{
+ if (owner())
+ return owner()->getLyXText(bv);
+ else
+ return bv->text;
+}
+
+
/* some stuff for inset locking */
void UpdatableInset::InsetButtonPress(BufferView *, int x, int y, int button)
{
}
+
void UpdatableInset::ShowInsetCursor(BufferView *)
{
}
+
void UpdatableInset::HideInsetCursor(BufferView *)
{
}
scx = 0;
- mx_scx = abs((width(bv->painter(), font) - bv->paperWidth()) / 2);
+ mx_scx = abs((width(bv, font) - bv->workWidth()) / 2);
}
-void UpdatableInset::draw(Painter &, LyXFont const &,
- int /* baseline */, float & x) const
+void UpdatableInset::draw(BufferView *, LyXFont const &,
+ int /* baseline */, float & x, bool/*cleared*/) const
{
if (scx) x += float(scx);
// ATTENTION: don't do the following here!!!
return UNDISPATCHED;
}
+
int UpdatableInset::getMaxWidth(Painter & pain, UpdatableInset const *) const
{
if (owner())