class InsetMathScript : public InsetMathNest {
public:
/// create inset without scripts
- InsetMathScript(Buffer * buf);
+ explicit InsetMathScript(Buffer * buf);
/// create inset with single script
explicit InsetMathScript(Buffer * buf, bool up);
/// create inset with single script and given nucleus
bool idxForward(Cursor & cur) const;
/// move cursor up or down
bool idxUpDown(Cursor & cur, bool up) const;
- /// Target pos when we enter the inset while moving forward
- bool idxFirst(Cursor & cur) const;
- /// Target pos when we enter the inset while moving backwards
- bool idxLast(Cursor & cur) const;
+ /// The index of the cell entered while moving backward
+ size_type lastIdx() const { return 0; }
/// write LaTeX and Lyx code
void write(WriteStream & os) const;
///
InsetMathScript * asScriptInset();
- /// set limits
- void limits(int lim) { limits_ = lim; }
- /// get limits
- int limits() const { return limits_; }
/// returns subscript. Always run 'hasDown' or 'has(false)' before!
MathData const & down() const;
/// returns subscript. Always run 'hasDown' or 'has(false)' before!
InsetCode lyxCode() const { return MATH_SCRIPT_CODE; }
///
void validate(LaTeXFeatures &features) const;
-protected:
- virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
- /// do we want to handle this event?
- bool getStatus(Cursor & cur, FuncRequest const & cmd,
- FuncStatus & status) const;
private:
virtual Inset * clone() const;
/// returns x offset for main part
/// shifts the superscript to the right, and a negative value shifts the
/// subscript to the left.
int nker(BufferView const * bv) const;
- /// where do we have to draw the scripts?
- bool hasLimits() const;
+ /// do we we have to draw the scripts above/below nucleus?
+ bool hasLimits(FontInfo const &) const;
/// clean up empty cells and return true if a cell has been deleted.
bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
/// possible subscript (index 0) and superscript (index 1)
bool cell_1_is_up_;
- /// 1 - "limits", -1 - "nolimits", 0 - "default"
- int limits_;
+ /// remember whether we are in display mode (used by mathml output)
+ mutable bool has_limits_ = false;
};