From 78d63575cacd102db07e0e45db3faf3b40324226 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 28 Feb 2008 15:36:48 +0000 Subject: [PATCH] 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 --- src/Cursor.cpp | 5 ++++- src/Text3.cpp | 13 ++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) 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 -- 2.39.5