MacroModeClose();
if (t == LM_TC_CR) {
- MathParInset * p = cursor->p;
+ MathParInset * p = cursor->getPar();
if (p == par && p->GetType()<LM_OT_MPAR && p->GetType()>LM_OT_MIN) {
short int type = LM_OT_MPAR;
int cols = 1;
cursor->addRow();
}
} else if (t == LM_TC_TAB) {
- MathParInset * p = cursor->p;
+ MathParInset * p = cursor->getPar();
if (p && p->Permit(LMPF_ALLOW_TAB)) {
if (c) {
- cursor->Insert(c, t);
+ cursor->insert(c, t);
cursor->checkTabs();
} else
cursor->goNextColumn();
if (accent) {
doAccent(c, t);
} else
- cursor->Insert(c, t);
+ cursor->insert(c, t);
lastcode = t;
return;
}
-void MathedCursor::Insert(MathedInset * p, int t)
+void MathedCursor::insertInset(MathedInset * p, int t)
{
if (macro_mode)
MacroModeClose();
if (accent && !MathIsActive(t)) {
doAccent(p);
} else {
- cursor->Insert(p, t);
+ cursor->insertInset(p, t);
if (MathIsActive(t)) {
cursor->Prev();
Push();
return;
}
- MathParInset * p = cursor->p;
+ MathParInset * p = cursor->getPar();
if (p && p->GetType() <= LM_OT_MATRIX && p->GetType() >= LM_OT_MPAR) {
cursor->delRow();
}
result = cursor->Up();
- if (!result && cursor->p) {
- MathParInset * p = cursor->p;
+ if (!result && cursor->getPar()) {
+ MathParInset * p = cursor->getPar();
if (p->GetType() == LM_OT_SCRIPT) {
MathedXIter * cx = mathstk.Item(1);
}
result = cursor->Down();
- if (!result && cursor->p) {
- MathParInset * p= cursor->p;
+ if (!result && cursor->getPar()) {
+ MathParInset * p= cursor->getPar();
if (p->GetType() == LM_OT_SCRIPT) {
MathedXIter * cx = mathstk.Item(1);
bool is_up = (cx->GetChar() == LM_TC_UP);
void MathedCursor::SetSize(short size)
{
- MathParInset * p = cursor->p;
+ MathParInset * p = cursor->getPar();
p->UserSetSize(size);
cursor->SetData(p);
}
void MathedCursor::setNumbered()
-{
+{
// another ugly hack
- MathedRowSt * crow = cursor->crow;
- if (!crow)
- return;
- crow->setNumbered(!crow->isNumbered());
+ MathedRowSt * crow = cursor->currentRow();
+ if (crow)
+ crow->setNumbered(!crow->isNumbered());
}
cursor->ipop();
}
p = new MathParInset(LM_ST_SCRIPT, "", LM_OT_SCRIPT);
- Insert (p, (s[0] == '_') ? LM_TC_DOWN: LM_TC_UP);
+ insertInset(p, (s[0] == '_') ? LM_TC_DOWN: LM_TC_UP);
return;
} else
if (s[0] == '!' || s[0] == ',' || s[0] == ':' || s[0] == ';') {
int sp = ((s[0] == ',') ? 1:((s[0] == ':') ? 2:((s[0] == ';') ? 3: 0)));
p = new MathSpaceInset(sp);
- Insert(p);
+ insertInset(p, LM_TC_INSET);
return;
} else
l = in_word_set(s);
}
if (p) {
- Insert(p, tcode);
+ insertInset(p, tcode);
par->Metrics();
}
}
{
if (!macro_mode) {
imacro = new MathFuncInset("");
- Insert (imacro);
+ insertInset(imacro, LM_TC_INSET);
macro_mode = true;
} else
lyxerr << "Mathed Warning: Already in macro mode" << endl;
void MathedCursor::SelCopy()
{
if (selection) {
- int p1 = (cursor->pos < selpos) ? cursor->pos : selpos;
- int p2 = (cursor->pos > selpos) ? cursor->pos : selpos;
+ int p1 = (cursor->getPos() < selpos) ? cursor->getPos() : selpos;
+ int p2 = (cursor->getPos() > selpos) ?
+ cursor->getPos() : selpos;
selarray = cursor->Copy(p1, p2);
cursor->Adjust();
SelClear();
void MathedCursor::SelCut()
{
if (selection) {
- if (cursor->pos == selpos)
+ if (cursor->getPos() == selpos)
return;
- int p1 = (cursor->pos < selpos) ? cursor->pos : selpos;
- int p2 = (cursor->pos > selpos) ? cursor->pos : selpos;
+ int p1 = (cursor->getPos() < selpos) ? cursor->getPos() : selpos;
+ int p2 = (cursor->getPos() > selpos) ? cursor->getPos() : selpos;
selarray = cursor->Copy(p1, p2);
cursor->Clean(selpos);
cursor->Adjust();
{
// lyxerr << "Deleting sel "
if (selection) {
- if (cursor->pos == selpos)
+ if (cursor->getPos() == selpos)
return;
cursor->Clean(selpos);
cursor->Adjust();
{
lyxerr[Debug::MATHED] << "Starting sel " << endl;
if (!anchor) {
- selpos = cursor->pos;
+ selpos = cursor->getPos();
selstk = new MathStackXIter(mathstk);
anchor = selstk->Item(-1);
- anchor->SetData(cursor->p);
+ anchor->SetData(cursor->getPar());
anchor->GoBegin();
anchor->goPosAbs(selpos);
selection = true;
}
// Once balanced the levels, check that they are at the same paragraph
- selpos = anchor->pos;
+ selpos = anchor->getPos();
}
return;
}
- // single row selection
- int i = 0;
- int a;
- int d;
- int a1;
- int d1;
-
// Balance anchor and cursor
SelBalance();
int xo;
int yo;
- cursor->p->GetXY(xo, yo);
- int w = cursor->p->Width();
+ cursor->getPar()->GetXY(xo, yo);
+ int w = cursor->getPar()->Width();
int x1;
int y1;
cursor->GetPos(x1, y1);
+ int a1;
+ int d1;
cursor->getAD(a1, d1);
int x;
int y;
anchor->GetPos(x, y);
+ int a;
+ int d;
anchor->getAD(a, d);
+ // single row selection
+ int i = 0;
xpoint[i] = x;
ypoint[i++] = y + d;
xpoint[i] = x;
}
if (ac)
- cursor->Insert(ac);
+ cursor->insertInset(ac, LM_TC_INSET);
accent = 0; // consumed!
}
}
if (ac)
- cursor->Insert(ac);
+ cursor->insertInset(ac, LM_TC_INSET);
accent = 0; // consumed!
}
MathParInset * MathedCursor::getCurrentPar() const
{
- return cursor->p;
+ return cursor->getPar();
}