#include <cstddef>
#include <vector>
-#include <map>
namespace lyx {
public:
///
- MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
- sshift_(0), kerning_(0), buffer_(buf) {}
+ explicit MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
+ sshift_(0), buffer_(buf) {}
///
MathData(Buffer * buf, const_iterator from, const_iterator to);
///
/// Add this array to a math row. Return true if contents got added
bool addToMathRow(MathRow &, MetricsInfo & mi) const;
- // return true if caret is in this cell in this buffer view
- bool hasCaret(BufferView * bv) const;
-
/// rebuild cached metrics information
/** When \c tight is true, the height of the cell will be at least
* the x height of the font. Otherwise, it will be the max height
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;
/// additional super/subscript shift
int sshift() const { return sshift_; }
/// Italic correction as described in InsetMathScript.h
- int kerning(BufferView const *) const { return kerning_; }
+ int kerning(BufferView const *) const;
///
void swap(MathData & ar) { base_type::swap(ar); }
/// stay visually at the same position (cur==0 is allowed)
void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType, int nesting);
///
- void updateBuffer(ParIterator const &, UpdateType);
+ void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
///
- void setBuffer(Buffer & b) { buffer_ = &b; }
+ void setBuffer(Buffer & b);
protected:
/// cached values for super/subscript placement
mutable int mindes_;
mutable int slevel_;
mutable int sshift_;
- mutable int kerning_;
Buffer * buffer_;
- /// cached object that describes typeset data
- mutable std::map<BufferView*, MathRow> mrow_cache_;
-
private:
/// is this an exact match at this position?
bool find1(MathData const & ar, size_type pos) const;