]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
* GuiTabular.cpp:
[lyx.git] / src / Text.cpp
index a0f4451ebb4529a2b8df3a89e3493213f09201f1..d00d2d5356ee710b7fa26a2e9df288173a89a118 100644 (file)
@@ -53,7 +53,6 @@
 #include "insets/InsetText.h"
 #include "insets/InsetBibitem.h"
 #include "insets/InsetCaption.h"
-#include "insets/InsetLine.h"
 #include "insets/InsetNewline.h"
 #include "insets/InsetNewpage.h"
 #include "insets/InsetArgument.h"
@@ -452,11 +451,6 @@ void Text::readParToken(Paragraph & par, Lexer & lex,
                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(*buf);
-               par.insertInset(par.size(), inset.release(), font, change);
        } else if (token == "\\change_unchanged") {
                change = Change(Change::UNCHANGED);
        } else if (token == "\\change_inserted" || token == "\\change_deleted") {
@@ -525,6 +519,9 @@ void Text::readParagraph(Paragraph & par, Lexer & lex,
 
        // Initialize begin_of_body_ on load; redoParagraph maintains
        par.setBeginOfBody();
+       
+       // mark paragraph for spell checking on load
+       // par.requestSpellCheck();
 }
 
 
@@ -739,10 +736,9 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
                        break; // the character couldn't be deleted physically due to change tracking
        }
 
-       cur.buffer()->updateBuffer();
-
        // A singlePar update is not enough in this case.
        cur.screenUpdateFlags(Update::Force);
+       cur.forceBufferUpdate();
 
        // This check is necessary. Otherwise the new empty paragraph will
        // be deleted automatically. And it is more friendly for the user!
@@ -940,23 +936,17 @@ void Text::insertChar(Cursor & cur, char_type c)
        // disable the double-space checking
        if (!freeSpacing && isLineSeparatorChar(c)) {
                if (cur.pos() == 0) {
-                       static bool sent_space_message = false;
-                       if (!sent_space_message) {
-                               cur.message(_("You cannot insert a space at the "
-                                                          "beginning of a paragraph. Please read the Tutorial."));
-                               sent_space_message = true;
-                       }
+                       cur.message(_(
+                                       "You cannot insert a space at the "
+                                       "beginning of a paragraph. Please read the Tutorial."));
                        return;
                }
                LASSERT(cur.pos() > 0, /**/);
                if ((par.isLineSeparator(cur.pos() - 1) || par.isNewline(cur.pos() - 1))
-                   && !par.isDeleted(cur.pos() - 1)) {
-                       static bool sent_space_message = false;
-                       if (!sent_space_message) {
-                               cur.message(_("You cannot type two spaces this way. "
-                                                          "Please read the Tutorial."));
-                               sent_space_message = true;
-                       }
+                               && !par.isDeleted(cur.pos() - 1)) {
+                       cur.message(_(
+                                       "You cannot type two spaces this way. "
+                                       "Please read the Tutorial."));
                        return;
                }
        }
@@ -1316,7 +1306,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
        cur.clearSelection();
        setCursorIntern(cur, begPit, begPos);
        cur.screenUpdateFlags(Update::Force);
-       cur.buffer()->updateBuffer();
+       cur.forceBufferUpdate();
 }
 
 
@@ -1467,7 +1457,7 @@ bool Text::handleBibitems(Cursor & cur)
                cur.recordUndo(ATOMIC_UNDO, prevcur.pit());
                mergeParagraph(bufparams, cur.text()->paragraphs(),
                                                        prevcur.pit());
-               cur.buffer()->updateBuffer();
+               cur.forceBufferUpdate();
                setCursorIntern(cur, prevcur.pit(), prevcur.pos());
                cur.screenUpdateFlags(Update::Force);
                return true;
@@ -1495,7 +1485,7 @@ bool Text::erase(Cursor & cur)
                        cur.top().forwardPos();
 
                if (was_inset)
-                       cur.buffer()->updateBuffer();
+                       cur.forceBufferUpdate();
                else
                        cur.checkBufferStructure();
                needsUpdate = true;
@@ -1571,7 +1561,7 @@ bool Text::backspacePos0(Cursor & cur)
        }
 
        if (needsUpdate) {
-               cur.buffer()->updateBuffer();
+               cur.forceBufferUpdate();
                setCursorIntern(cur, prevcur.pit(), prevcur.pos());
        }
 
@@ -1611,7 +1601,7 @@ bool Text::backspace(Cursor & cur)
                bool const was_inset = cur.paragraph().isInset(cur.pos());
                cur.paragraph().eraseChar(cur.pos(), cur.buffer()->params().trackChanges);
                if (was_inset)
-                       cur.buffer()->updateBuffer();
+                       cur.forceBufferUpdate();
                else
                        cur.checkBufferStructure();
        }
@@ -1667,9 +1657,7 @@ bool Text::dissolveInset(Cursor & cur)
                cur.pit() = min(cur.lastpit(), spit);
                cur.pos() = min(cur.lastpos(), spos);
        } else
-               // this is the least that needs to be done (bug 6003)
-               // in the above case, pasteParagraphList handles this
-               cur.buffer()->updateBuffer();
+               cur.forceBufferUpdate();
 
        // Ensure the current language is set correctly (bug 6292)
        cur.text()->setCursor(cur, cur.pit(), cur.pos());
@@ -2042,8 +2030,8 @@ bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/
        LASSERT(cur.bv().cursor() == cur, /**/);
        cur.insert(s);
        cur.bv().cursor() = cur;
-       if (!(cur.result().update() & Update::Force))
-               cur.screenUpdateFlags(cur.result().update() | Update::SinglePar);
+       if (!(cur.result().screenUpdate() & Update::Force))
+               cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
        return true;
 }