]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathData.h
Only set buffer if it is not null.
[lyx.git] / src / mathed / MathData.h
index fa6e80d31b429acbb22375a2e6d2a97fc627e178..81d6cfcd787d602a67a8740689600b97c54a5078 100644 (file)
@@ -68,8 +68,9 @@ public:
 
 public:
        ///
-       explicit MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
-                                    sshift_(0), buffer_(buf) {}
+       MathData() = default;
+       ///
+       explicit MathData(Buffer * buf) : buffer_(buf) {}
        ///
        MathData(Buffer * buf, const_iterator from, const_iterator to);
        ///
@@ -140,8 +141,10 @@ public:
        void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
        /// redraw cell using cache metrics information
        void drawT(TextPainter & pi, int x, int y) const;
-       /// approximate the math class of the data
+       /// approximate mathclass of the data
        MathClass mathClass() const;
+       /// math class of last interesting element
+       MathClass lastMathClass() const;
 
        /// access to cached x coordinate of last drawing
        int xo(BufferView const & bv) const;
@@ -184,11 +187,11 @@ public:
 
 protected:
        /// cached values for super/subscript placement
-       mutable int minasc_;
-       mutable int mindes_;
-       mutable int slevel_;
-       mutable int sshift_;
-       Buffer * buffer_;
+       mutable int minasc_ = 0;
+       mutable int mindes_ = 0;
+       mutable int slevel_ = 0;
+       mutable int sshift_ = 0;
+       Buffer * buffer_ = nullptr;
 
 private:
        /// is this an exact match at this position?