From: Abdelrazak Younes Date: Thu, 28 Feb 2008 15:36:48 +0000 (+0000) Subject: revert revision 23324 and implement a better more general fix in Cursor::insert(). X-Git-Tag: 1.6.10~6004 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=78d63575cacd102db07e0e45db3faf3b40324226;p=lyx.git 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 --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index de64c507fb..05617f4c19 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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()); + } } diff --git a/src/Text3.cpp b/src/Text3.cpp index 1e4d6fa272..f40d37f8d8 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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