]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
* Paragraph: erase unused some method and move some members to Paragraph::Private.
[lyx.git] / src / Text.cpp
index 50b6a83f7611ee4fedbfab10d5a9d509ff4bd780..67c60affb0f0171271409827d9cc29a2bc19fa1e 100644 (file)
@@ -102,17 +102,9 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
        BufferParams const & bp = buf.params();
 
        if (token[0] != '\\') {
-#if 0
-               string::const_iterator cit = token.begin();
-               for (; cit != token.end(); ++cit)
-                       par.insertChar(par.size(), (*cit), font, change);
-#else
                docstring dstr = lex.getDocString();
-               docstring::const_iterator cit = dstr.begin();
-               docstring::const_iterator cend = dstr.end();
-               for (; cit != cend; ++cit)
-                       par.insertChar(par.size(), *cit, font, change);
-#endif
+               par.appendString(dstr, font, change);
+
        } else if (token == "\\begin_layout") {
                lex.eatLine();
                docstring layoutname = lex.getDocString();
@@ -216,12 +208,12 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                // Insets don't make sense in a free-spacing context! ---Kayvan
                if (par.isFreeSpacing()) {
                        if (token == "\\InsetSpace")
-                               par.insertChar(par.size(), ' ', font, change);
+                               par.appendChar(' ', font, change);
                        else if (lex.isOK()) {
                                lex.next();
                                string const next_token = lex.getString();
                                if (next_token == "\\-")
-                                       par.insertChar(par.size(), '-', font, change);
+                                       par.appendChar('-', font, change);
                                else {
                                        lex.printError("Token `$$Token' "
                                                       "is in free space "
@@ -239,7 +231,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                                        font, change);
                }
        } else if (token == "\\backslash") {
-               par.insertChar(par.size(), '\\', font, change);
+               par.appendChar('\\', font, change);
        } else if (token == "\\newline") {
                auto_ptr<Inset> inset(new InsetNewline);
                inset->read(buf, lex);
@@ -807,7 +799,7 @@ void Text::deleteWordForward(Cursor & cur)
 {
        BOOST_ASSERT(this == cur.text());
        if (cur.lastpos() == 0)
-               cursorRight(cur);
+               cursorForward(cur);
        else {
                cur.resetAnchor();
                cur.selection() = true;
@@ -823,7 +815,7 @@ void Text::deleteWordBackward(Cursor & cur)
 {
        BOOST_ASSERT(this == cur.text());
        if (cur.lastpos() == 0)
-               cursorLeft(cur);
+               cursorBackward(cur);
        else {
                cur.resetAnchor();
                cur.selection() = true;
@@ -1086,9 +1078,9 @@ bool Text::backspace(Cursor & cur)
                // this is the code for a normal backspace, not pasting
                // any paragraphs
                cur.recordUndo(DELETE_UNDO);
-               // We used to do cursorLeftIntern() here, but it is
+               // We used to do cursorBackwardIntern() here, but it is
                // not a good idea since it triggers the auto-delete
-               // mechanism. So we do a cursorLeftIntern()-lite,
+               // mechanism. So we do a cursorBackwardIntern()-lite,
                // without the dreaded mechanism. (JMarc)
                setCursorIntern(cur, cur.pit(), cur.pos() - 1,
                                false, cur.boundary());