]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
That didn't really work. So revert to old CSS for gray notes.
[lyx.git] / src / Text.cpp
index 54ee423d1ad56307864e2f5691d1ce03bd5cf592..d8436b2ddc7eed3cfa789a052477a5ef8401ac01 100644 (file)
@@ -274,8 +274,8 @@ InsetText const & Text::inset() const
 void Text::readParToken(Paragraph & par, Lexer & lex,
        string const & token, Font & font, Change & change, ErrorList & errorList)
 {
-       Buffer const & buf = owner_->buffer();
-       BufferParams const & bp = buf.params();
+       Buffer * buf = const_cast<Buffer *>(&owner_->buffer());
+       BufferParams const & bp = buf->params();
 
        if (token[0] != '\\') {
                docstring dstr = lex.getDocString();
@@ -397,18 +397,18 @@ void Text::readParToken(Paragraph & par, Lexer & lex,
                auto_ptr<Inset> inset;
                inset.reset(new InsetSpecialChar);
                inset->read(lex);
-               inset->setBuffer(const_cast<Buffer &>(buf));
+               inset->setBuffer(*buf);
                par.insertInset(par.size(), inset.release(), font, change);
        } else if (token == "\\backslash") {
                par.appendChar('\\', font, change);
        } else if (token == "\\LyXTable") {
-               auto_ptr<Inset> inset(new InsetTabular(const_cast<Buffer &>(buf)));
+               auto_ptr<Inset> inset(new InsetTabular(buf));
                inset->read(lex);
                par.insertInset(par.size(), inset.release(), font, change);
        } else if (token == "\\lyxline") {
                auto_ptr<Inset> inset;
                inset.reset(new InsetLine);
-               inset->setBuffer(const_cast<Buffer &>(buf));
+               inset->setBuffer(*buf);
                par.insertInset(par.size(), inset.release(), font, change);
        } else if (token == "\\change_unchanged") {
                change = Change(Change::UNCHANGED);
@@ -915,7 +915,8 @@ void Text::insertChar(Cursor & cur, char_type c)
        cur.checkBufferStructure();
 
 //             cur.updateFlags(Update::Force);
-       bool boundary = tm.isRTLBoundary(cur.pit(), cur.pos() + 1);
+       bool boundary = cur.boundary()
+               || tm.isRTLBoundary(cur.pit(), cur.pos() + 1);
        setCursor(cur, cur.pit(), cur.pos() + 1, false, boundary);
        charInserted(cur);
 }
@@ -1616,6 +1617,9 @@ bool Text::dissolveInset(Cursor & cur)
                // this is the least that needs to be done (bug 6003)
                // in the above case, pasteParagraphList handles this
                cur.buffer()->updateLabels();
+
+       // Ensure the current language is set correctly (bug 6292)
+       cur.text()->setCursor(cur, cur.pit(), cur.pos());
        cur.clearSelection();
        cur.resetAnchor();
        return true;