std::vector<MathArray> data_;
};
-Selection theSelection;
+Selection theSelection;
bool IsMacro(short tok, int id)
!(tok == LM_TK_SYM && id < 255);
}
-ostream & operator<<(ostream & os, MathCursorPos const & p)
+
+std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
{
- os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ")";
+ os << "(par: " << p.par_ << " idx: " << p.idx_
+ << " pos: " << p.pos_ << ")";
return os;
}
return Cursor_[i].par_;
}
+
void MathCursor::dump(char const * what) const
{
return;
<< "\n";
}
+
void MathCursor::seldump(char const *) const
{
//lyxerr << "SEL: " << str << ": '" << theSelection << "'\n";
return true;
}
+
bool MathCursor::plainLeft()
{
return array().prev(cursor().pos_);
}
}
+
void MathCursor::SelCut()
{
seldump("SelCut");
SelClear();
}
+
void MathCursor::SelHandle(bool sel)
{
if (sel && !selection)
}
-
void MathCursor::drawSelection(Painter & pain) const
{
if (!selection)
push(p, true);
}
+
void MathCursor::handleDelim(int l, int r)
{
MathDelimInset * p = new MathDelimInset(l, r);
return 0;
}
+
void MathCursor::pullArg()
{
// pullArg
}
*/
+
MathInset * MathCursor::prevInset() const
{
normalize();
return xarray().pos2x(cursor().pos_);
}
+
void MathCursor::gotoX(int x)
{
cursor().pos_ = xarray().x2pos(x);
}
+
void MathCursor::idxNext()
{
cursor().par_->idxNext(cursor().idx_, cursor().pos_);
}
+
void MathCursor::idxPrev()
{
cursor().par_->idxPrev(cursor().idx_, cursor().pos_);
}
+
void MathCursor::splitCell()
{
if (cursor().idx_ == cursor().par_->nargs() - 1)
array().insert(0, ar);
}
+
void MathCursor::breakLine()
{
MathMatrixInset * p = static_cast<MathMatrixInset *>(formula()->par());
}
}
+
char MathCursor::valign() const
{
int idx;
return p ? p->valign() : 0;
}
+
char MathCursor::halign() const
{
int idx;
////////////////////////////////////////////////////////////////////////
-bool MathCursorPos::operator==(const MathCursorPos & it) const
+bool operator==(MathCursorPos const & ti, MathCursorPos const & it)
{
- return par_ == it.par_ && idx_ == it.idx_ && pos_ == it.pos_;
+ return ti.par_ == it.par_ && ti.idx_ == it.idx_ && ti.pos_ == it.pos_;
}
-bool MathCursorPos::operator<(const MathCursorPos & it) const
+
+bool operator<(MathCursorPos const & ti, MathCursorPos const & it)
{
- if (par_ != it.par_) {
+ if (ti.par_ != it.par_) {
lyxerr << "can't compare cursor and anchor in different insets\n";
return true;
}
- if (idx_ != it.idx_)
- return idx_ < it.idx_;
- return pos_ < it.pos_;
+ if (ti.idx_ != it.idx_)
+ return ti.idx_ < it.idx_;
+ return ti.pos_ < it.pos_;
}
return par_->xcell(idx);
}
+
MathXArray & MathCursorPos::xcell() const
{
return par_->xcell(idx_);
}
+
MathCursorPos MathCursor::normalAnchor() const
{
// use Anchor on the same level as Cursor
MathCursorPos normal = Anchor_[Cursor_.size() - 1];
- if (Cursor_.size() < Anchor_.size() && !(cursor() > normal)) {
+ if (Cursor_.size() < Anchor_.size() && !(normal < cursor())) {
// anchor is behind cursor -> move anchor behind the inset
normal.cell().next(normal.pos_);
}
return normal;
}
+
bool MathCursorPos::idxUp()
{
return par_->idxUp(idx_, pos_);
}
+
bool MathCursorPos::idxDown()
{
return par_->idxDown(idx_, pos_);
}
+
bool MathCursorPos::idxLeft()
{
return par_->idxLeft(idx_, pos_);
}
+
bool MathCursorPos::idxRight()
{
return par_->idxRight(idx_, pos_);