]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_unknowninset.C
Andreas' patch to prevent crash on click on previewd inset
[lyx.git] / src / mathed / math_unknowninset.C
index a8a0be9aa15546e65ac09b7bd4ebf3b43c5d351a..12a29cab568d8a34ba62b86d2c54640fd87db1a6 100644 (file)
@@ -16,7 +16,6 @@
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
-
 using std::string;
 using std::auto_ptr;
 
@@ -26,7 +25,7 @@ MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black)
 {}
 
 
-auto_ptr<InsetBase> MathUnknownInset::clone() const
+auto_ptr<InsetBase> MathUnknownInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathUnknownInset(*this));
 }
@@ -44,13 +43,6 @@ void MathUnknownInset::setName(string const & name)
 }
 
 
-bool MathUnknownInset::match(MathAtom const & at) const
-{
-       MathUnknownInset const * q = at->asUnknownInset();
-       return q && name_ == q->name_;
-}
-
-
 void MathUnknownInset::normalize(NormalStream & os) const
 {
        os << "[unknown " << name_ << ']';
@@ -60,6 +52,7 @@ void MathUnknownInset::normalize(NormalStream & os) const
 void MathUnknownInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        mathed_string_dim(mi.base.font, name_, dim);
+       dim_ = dim;
 }
 
 
@@ -69,6 +62,7 @@ void MathUnknownInset::draw(PainterInfo & pi, int x, int y) const
                drawStrBlack(pi, x, y, name_);
        else
                drawStrRed(pi, x, y, name_);
+       setPosCache(pi, x, y);
 }
 
 
@@ -89,6 +83,7 @@ void MathUnknownInset::maple(MapleStream & os) const
        os << name_;
 }
 
+
 void MathUnknownInset::mathematica(MathematicaStream & os) const
 {
        os << name_;