]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbolinset.h
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_symbolinset.h
index 174e59cc686ea88ab1899fe7f0c295341ce2741c..d25260409a9ff174a421a6f8bf484ec7eb9ac054 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "math_inset.h"
 
-struct latexkeys;
+class latexkeys;
 
 
 /** "normal" symbols that don't take limits and don't grow in displayed
@@ -29,11 +29,12 @@ public:
        ///
        explicit MathSymbolInset(std::string const & name);
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
-       ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo &, int x, int y) const;
+       ///
+       int width() const { return width_; }
+
        ///
        bool isRelOp() const;
        /// do we take scripts?
@@ -44,8 +45,6 @@ public:
        MathSymbolInset const * asSymbolInset() const { return this; }
        /// the LaTeX name of the symbol (without the backslash)
        std::string name() const;
-       ///
-       bool match(MathAtom const &) const;
        /// request "external features"
        void validate(LaTeXFeatures & features) const;
 
@@ -67,10 +66,13 @@ public:
        void infoize2(std::ostream & os) const;
 
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
        ///
        latexkeys const * sym_;
        ///
        mutable int h_;
+       /// cached width
+       mutable int width_;
        ///
        mutable bool scriptable_;
 };