]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
prepare Qt 5.6 builds
[lyx.git] / src / Text3.cpp
index ca6ec5bc29279d7fce3c2ed7d7b8bcf407b16eee..fbcd9b7206a2dd4f0c51810fcabce05af22dc925 100644 (file)
@@ -370,7 +370,7 @@ static void outline(OutlineOp mode, Cursor & cur)
        ParagraphList & pars = buf.text().paragraphs();
        ParagraphList::iterator const bgn = pars.begin();
        // The first paragraph of the area to be copied:
-       ParagraphList::iterator start = next(bgn, pit);
+       ParagraphList::iterator start = lyx::next(bgn, pit);
        // The final paragraph of area to be copied:
        ParagraphList::iterator finish = start;
        ParagraphList::iterator const end = pars.end();
@@ -808,7 +808,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                ParagraphList & pars = buf.text().paragraphs();
                ParagraphList::iterator bgn = pars.begin();
                // The first paragraph of the area to be selected:
-               ParagraphList::iterator start = next(bgn, pit);
+               ParagraphList::iterator start = lyx::next(bgn, pit);
                // The final paragraph of area to be selected:
                ParagraphList::iterator finish = start;
                ParagraphList::iterator end = pars.end();
@@ -1048,22 +1048,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_CHAR_DELETE_FORWARD:
                if (!cur.selection()) {
-                       bool was_separator = cur.paragraph().isEnvSeparator(cur.pos());
                        if (cur.pos() == cur.paragraph().size())
                                // Par boundary, force full-screen update
                                singleParUpdate = false;
                        needsUpdate |= erase(cur);
                        cur.resetAnchor();
-                       if (was_separator && cur.pos() == cur.paragraph().size()
-                           && (!cur.paragraph().layout().isEnvironment()
-                               || cur.paragraph().size() > 0)) {
-                               // Force full-screen update
-                               singleParUpdate = false;
-                               needsUpdate |= erase(cur);
-                               cur.resetAnchor();
-                       }
-                       // It is possible to make it a lot faster still
-                       // just comment out the line below...
                } else {
                        cutSelection(cur, true, false);
                        singleParUpdate = false;
@@ -1107,23 +1096,21 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                prev = pit - 1;
                }
                if (prev < pit && cur.pos() == par.beginOfBody()
-                   && !par.isEnvSeparator(par.size() ? par.size() - 1 : 0)
+                   && !par.size() && !par.isEnvSeparator(cur.pos())
                    && !par.layout().isCommand()
                    && pars_[prev].layout() != par.layout()
                    && pars_[prev].layout().isEnvironment()
-                   && (!nextpar.isEnvSeparator(nextpar.size() ? nextpar.size() - 1 : 0)
-                           || nextpar.layout().isCommand()
-                           || nextpar.layout().isEnvironment())) {
+                   && !nextpar.isEnvSeparator(nextpar.beginOfBody())) {
                        if (par.layout().isEnvironment()
                            && pars_[prev].getDepth() == par.getDepth()) {
                                docstring const layout = par.layout().name();
                                DocumentClass const & tc = bv->buffer().params().documentClass();
                                lyx::dispatch(FuncRequest(LFUN_LAYOUT, tc.plainLayout().name()));
-                               lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "parbreak"));
+                               lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
                                lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK, "inverse"));
                                lyx::dispatch(FuncRequest(LFUN_LAYOUT, layout));
                        } else {
-                               lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "parbreak"));
+                               lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
                                breakParagraph(cur);
                        }
                        Font const f(inherit_font, cur.current_font.language());