]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / inset.C
index 00c226cdc00eb9c182854668cedeb4a22cd5f030..1f6014002595ee05dd85830a1b494c3409255767 100644 (file)
 #include "lyxtext.h"
 #include "LColor.h"
 #include "metricsinfo.h"
+#include "coordcache.h"
 
 using std::string;
 
 
 InsetOld::InsetOld()
-       : InsetBase(),
-         xo_(0), yo_(0), scx(0), owner_(0),
+       : scx(0),
          //background_color_(LColor::inherit)
          background_color_(LColor::background)
 {}
 
 
 InsetOld::InsetOld(InsetOld const & in)
-       : InsetBase(),
-         xo_(0), yo_(0), scx(0), owner_(0), name_(in.name_),
+       : InsetBase(in), scx(0), name_(in.name_),
          background_color_(in.background_color_)
 {}
 
@@ -53,10 +52,8 @@ LColor_color InsetOld::backgroundColor() const
 }
 
 
-bool InsetOld::forceDefaultParagraphs(InsetBase const * inset) const
+bool InsetOld::forceDefaultParagraphs(InsetBase const *) const
 {
-       if (owner())
-               return owner()->forceDefaultParagraphs(inset);
        return false;
 }
 
@@ -79,17 +76,14 @@ int InsetOld::width() const
 }
 
 
-int InsetOld::scroll(bool recursive) const
+int InsetOld::scroll(bool) const
 {
-       if (!recursive || !owner_)
-               return scx;
-       return 0;
+       return scx;
 }
 
 
 void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
 {
        //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
-       xo_ = x;
-       yo_ = y + pi.base.bv->top_y();
+       theCoords.insets_.add(this, x, y);
 }