]> git.lyx.org Git - features.git/commitdiff
Move the screen redraw call out of the selection-setting routine. This
authorRichard Heck <rgheck@comcast.net>
Thu, 14 Oct 2010 15:02:48 +0000 (15:02 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 14 Oct 2010 15:02:48 +0000 (15:02 +0000)
avoids multiple screen redraws in some cases.

If someone knows how to fix the FIXMEs in GuiErrorList and
GuiSpellcheker, I'd really appreciate it.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35651 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/frontends/qt4/GuiErrorList.cpp
src/frontends/qt4/GuiSpellchecker.cpp

index 4fcadeb824fcb16cb48cf1a74d3599b315e0844a..b58a980ecc6bf2c945118a05dc9ff74e0309b682 100644 (file)
@@ -1532,9 +1532,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                istringstream iss(to_utf8(cmd.argument()));
                iss >> opt;
                if (findAdv(this, opt))
-                       cur.dispatched();
-               else
-                       cur.undispatched();
+                       dr.screenUpdate(Update::Force | Update::FitCursor);
                break;
        }
 
@@ -2344,9 +2342,6 @@ void BufferView::putSelectionAt(DocIterator const & cur,
                } else
                        d->cursor_.setSelection(d->cursor_, length);
        }
-       // Ensure a redraw happens in any case because the new selection could 
-       // possibly be on the same screen as the previous selection.
-       processUpdateFlags(Update::Force | Update::FitCursor);
 }
 
 
index 0206025aa29124acb366aea8d079a1d07bbb8c58..2038500b477f88efb443a2c5023c6504e54a54fc 100644 (file)
@@ -180,8 +180,9 @@ bool GuiErrorList::goTo(int item)
        pos_type const range = end - start;
        dit.pos() = start;
        BufferView * bv = const_cast<BufferView *>(bufferview());
-       // FIXME: If we used an LFUN, we would not need this line:
+       // FIXME: If we used an LFUN, we would not need these lines:
        bv->putSelectionAt(dit, range, false);
+       bv->processUpdateFlags(Update::Force | Update::FitCursor);
        return true;
 }
 
index 4059a7be93dd0f88bbcfe808254dd7088e326c33..cfb9f6812a68e284db0d6b0825388e78e5eaac43 100644 (file)
@@ -325,10 +325,12 @@ void GuiSpellchecker::check()
                d->ui.languageCO->setCurrentIndex(pos);
 
        // FIXME: if we used a lfun like in find/replace, dispatch would do
-       // that for us
+       // all of this for us
        int const size = to.pos() - from.pos();
        BufferView * bv = const_cast<BufferView *>(bufferview());
        bv->putSelectionAt(from, size, false);
+       bv->processUpdateFlags(Update::Force | Update::FitCursor);
+       
 }