]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_charinset.h
Fix math cursor positioning bug
[lyx.git] / src / mathed / math_charinset.h
index 0f4509bbd3addf4485d065d21f76da5e65c9eecf..7c63e71dc013b3f9c1722e02c52820dd914f63e0 100644 (file)
@@ -21,8 +21,6 @@ public:
        ///
        explicit MathCharInset(char c);
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
-       ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
@@ -30,6 +28,9 @@ public:
        void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
        ///
        void drawT(TextPainter &, int x, int y) const;
+       ///
+       int width() const { return width_; }
+
        ///
        void write(WriteStream & os) const;
        ///
@@ -42,11 +43,12 @@ public:
        char getChar() const { return char_; }
        ///
        bool isRelOp() const;
-       ///
-       bool match(MathInset const *) const;
 
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
        /// the character
        char char_;
+       /// cached width
+       mutable int width_;
 };
 #endif