]> git.lyx.org Git - features.git/commitdiff
revert revision 23324 and implement a better more general fix in Cursor::insert().
authorAbdelrazak Younes <younes@lyx.org>
Thu, 28 Feb 2008 15:36:48 +0000 (15:36 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 28 Feb 2008 15:36:48 +0000 (15:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23325 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp
src/Text3.cpp

index de64c507fb6c82cf58dd5901e6de8b42ced891c0..05617f4c19dd093032849249f7e88fd19cc0babf 100644 (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());
+       }
 }
 
 
index 1e4d6fa272e750f454e2e29b9635cb54c945d2d4..f40d37f8d86ce504f7a725550eb42b90f08ce959 100644 (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