]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.C
more changes...read the Changelog
[lyx.git] / src / insets / inset.C
index 19249a574e4bf9a6ad7af379ba157397b4dec113..333c1a6b2c6dd91db3bba031e1f99187c78efe8e 100644 (file)
@@ -42,15 +42,6 @@ Inset::EDITABLE Inset::Editable() const
 }
 
 
-bool Inset::IsTextInset() const
-{
-       return ((LyxCode() == TEXT_CODE) ||
-               (LyxCode() == ERT_CODE) ||
-               (LyxCode() == FOOT_CODE) ||
-               (LyxCode() == MARGIN_CODE));
-}
-
-
 void Inset::Validate(LaTeXFeatures &) const
 {
 }
@@ -67,9 +58,9 @@ void Inset::Edit(BufferView *, int, int, unsigned int)
 }
 
 
-LyXFont Inset::ConvertFont(LyXFont font)
+LyXFont Inset::ConvertFont(LyXFont const & font) const
 {
-  return font;
+       return LyXFont(font);
 }
 
 
@@ -78,6 +69,16 @@ char const * Inset::EditMessage() const
        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)
@@ -141,12 +142,12 @@ void UpdatableInset::Edit(BufferView * bv, int, int, unsigned int)
 
     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!!!