]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
More general fix for part of 5403.
[lyx.git] / src / BufferView.cpp
index 9daa2aaa55ec5bfae5aca6f79438a45dc443f8db..314631cadd0ec344868a6bee54ab2156f19879e8 100644 (file)
@@ -873,7 +873,6 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
        case LFUN_SCREEN_RECENTER:
        case LFUN_BIBTEX_DATABASE_ADD:
        case LFUN_BIBTEX_DATABASE_DEL:
-       case LFUN_GRAPHICS_GROUPS_UNIFY:
        case LFUN_NOTES_MUTATE:
        case LFUN_ALL_INSETS_TOGGLE:
        case LFUN_STATISTICS:
@@ -1155,11 +1154,15 @@ bool BufferView::dispatch(FuncRequest const & cmd)
 
        case LFUN_CHANGE_NEXT:
                findNextChange(this);
+               // FIXME: Move this LFUN to Buffer so that we don't have to do this:
+               processUpdateFlags(Update::Force | Update::FitCursor);
                break;
 
        case LFUN_CHANGES_MERGE:
-               if (findNextChange(this))
+               if (findNextChange(this)) {
+                       processUpdateFlags(Update::Force | Update::FitCursor);
                        showDialog("changes");
+               }
                break;
 
        case LFUN_ALL_CHANGES_ACCEPT:
@@ -1189,6 +1192,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                FuncRequest req = cmd;
                if (cmd.argument().empty() && !d->search_request_cache_.argument().empty())
                        req = d->search_request_cache_;
+               if (req.argument().empty()) {
+                       theLyXFunc().dispatch(FuncRequest(LFUN_DIALOG_SHOW, "findreplace"));
+                       break;
+               }
                if (find(this, req))
                        showCursor();
                else
@@ -1427,16 +1434,8 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                processUpdateFlags(Update::Force);
                break;
 
-       // These two could be rewriten using some command like forall <insetname> <command>
+       // This could be rewriten using some command like forall <insetname> <command>
        // once the insets refactoring is done.
-       case LFUN_GRAPHICS_GROUPS_UNIFY: {
-               if (cmd.argument().empty())
-                       break;
-               graphics::unifyGraphicsGroups(cur.buffer(), to_utf8(cmd.argument()));
-               processUpdateFlags(Update::Force | Update::FitCursor);
-               break;
-       }
-
        case LFUN_NOTES_MUTATE: {
                if (cmd.argument().empty())
                        break;
@@ -1753,9 +1752,8 @@ bool BufferView::setCursorFromInset(Inset const * inset)
        // Inset is not at cursor position. Find it in the document.
        Cursor cur(*this);
        cur.reset(buffer().inset());
-       do 
+       while (cur && cur.nextInset() != inset)
                cur.forwardInset();
-       while (cur && cur.nextInset() != inset);
 
        if (cur) {
                setCursor(cur);
@@ -2226,7 +2224,7 @@ void BufferView::draw(frontend::Painter & pain)
 
                // Clear background.
                pain.fillRectangle(0, 0, width_, height_,
-                       buffer_.inset().backgroundColor());
+                       pi.backgroundColor(&buffer_.inset()));
 
                // Draw everything.
                tm.draw(pi, 0, y);