]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
Fix text frame drawing.
[lyx.git] / src / insets / Inset.cpp
index 09be84e480dc524cd37f9e0077acae8568c427ec..033764b307f055b44b962cf6f0da6fefe664492a 100644 (file)
@@ -17,6 +17,7 @@
 #include "Inset.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "BufferView.h"
 #include "Color.h"
 #include "CoordCache.h"
@@ -29,6 +30,7 @@
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "Text.h"
+#include "TextClass.h"
 #include "MetricsInfo.h"
 #include "MetricsInfo.h"
 
@@ -117,18 +119,10 @@ static TranslatorMap const build_translator()
 
 /// pretty arbitrary dimensions
 Inset::Inset()
-       : dim_(10, 10, 10), background_color_(Color::background)
+       : dim_(10, 10, 10)
 {}
 
 
-std::auto_ptr<Inset> Inset::clone() const
-{
-       std::auto_ptr<Inset> b = doClone();
-       BOOST_ASSERT(typeid(*b) == typeid(*this));
-       return b;
-}
-
-
 Inset::Code Inset::translate(std::string const & name)
 {
        static TranslatorMap const translator = build_translator();
@@ -344,22 +338,22 @@ bool Inset::covers(BufferView const & bv, int x, int y) const
 }
 
 
-void Inset::dump() const
+InsetLayout const & Inset::getLayout(BufferParams const & bp) const
 {
-       Buffer buf("foo", 1);
-       write(buf, lyxerr);
+       return bp.getTextClass().insetlayout(name());  
 }
 
 
-void Inset::setBackgroundColor(Color_color color)
+void Inset::dump() const
 {
-       background_color_ = color;
+       Buffer buf("foo", 1);
+       write(buf, lyxerr);
 }
 
 
 Color_color Inset::backgroundColor() const
 {
-       return Color::color(background_color_);
+       return Color::background;
 }