}
-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)
scx = 0;
- mx_scx = abs((width(bv->painter(), font) - bv->workWidth()) / 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!!!