revert revision 23324 and implement a better more general fix in Cursor::insert().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23325 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-28 15:36:48 +00:00
parent f6e471fc8d
commit 78d63575ca
2 changed files with 10 additions and 8 deletions

View File

@ -362,6 +362,7 @@ void Cursor::pop()
void Cursor::push(Inset & p)
{
push_back(CursorSlice(p));
p.setBuffer(bv_->buffer());
}
@ -1022,8 +1023,10 @@ void Cursor::insert(Inset * inset)
{
if (inMathed())
insert(MathAtom(inset));
else
else {
text()->insertInset(*this, inset);
inset->setBuffer(bv_->buffer());
}
}

View File

@ -1114,15 +1114,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
else
c = par.getChar(pos - 1);
string arg = to_utf8(cmd.argument());
InsetQuotes * iq;
if (arg == "single")
iq = new InsetQuotes(c, bufparams.quotes_language,
InsetQuotes::SingleQ);
cur.insert(new InsetQuotes(c,
bufparams.quotes_language,
InsetQuotes::SingleQ));
else
iq = new InsetQuotes(c, bufparams.quotes_language,
InsetQuotes::DoubleQ);
iq->setBuffer(bv->buffer());
cur.insert(iq);
cur.insert(new InsetQuotes(c,
bufparams.quotes_language,
InsetQuotes::DoubleQ));
cur.posForward();
}
else