]> git.lyx.org Git - features.git/commitdiff
The Cursor argument here was not being used, so there is no need
authorRichard Heck <rgheck@comcast.net>
Fri, 2 Dec 2011 22:44:38 +0000 (22:44 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 2 Dec 2011 22:44:38 +0000 (22:44 +0000)
for the indirection.

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

src/frontends/qt4/GuiCompleter.cpp
src/frontends/qt4/GuiCompleter.h

index 06ed395221ddec7e2e2f611b57cb9a902e88a05a..7ef1a1a5794339143d40c9dd0d04b7b617c99290 100644 (file)
@@ -297,7 +297,7 @@ void GuiCompleter::updateVisibility(Cursor & cur, bool start, bool keep)
 
        // we moved or popup state is not ok for popup?
        if ((moved && !keep) || !possiblePopupState)
-               hidePopup(cur);
+               hidePopup();
 
        // we moved or inline state is not ok for inline completion?
        if ((moved && !keep) || !possibleInlineState)
@@ -530,26 +530,6 @@ void GuiCompleter::showPopup(Cursor const & cur)
 }
 
 
-void GuiCompleter::hidePopup(Cursor &)
-{
-       popupVisible_ = false;
-
-       if (popup_timer_.isActive())
-               popup_timer_.stop();
-
-       // hide popup asynchronously because we might be here inside of
-       // LFUN dispatchers. Hiding a popup can trigger a focus event on the 
-       // workarea which then redisplays the cursor. But the metrics are not
-       // yet up to date such that the coord cache has not all insets yet. The
-       // cursorPos methods would triggers asserts in the coord cache then.
-       QTimer::singleShot(0, this, SLOT(asyncHidePopup()));
-       
-       // mark that the asynchronous part will reset the model
-       if (!inlineVisible())
-               modelActive_ = false;
-}
-
-
 void GuiCompleter::asyncHidePopup()
 {
        popup()->hide();
@@ -621,14 +601,21 @@ void GuiCompleter::showInline()
 
 void GuiCompleter::hidePopup()
 {
-       Cursor cur = gui_->bufferView().cursor();
-       cur.screenUpdateFlags(Update::None);
-       
-       hidePopup(cur);
+       popupVisible_ = false;
+
+       if (popup_timer_.isActive())
+               popup_timer_.stop();
+
+       // hide popup asynchronously because we might be here inside of
+       // LFUN dispatchers. Hiding a popup can trigger a focus event on the
+       // workarea which then redisplays the cursor. But the metrics are not
+       // yet up to date such that the coord cache has not all insets yet. The
+       // cursorPos methods would triggers asserts in the coord cache then.
+       QTimer::singleShot(0, this, SLOT(asyncHidePopup()));
        
-       // redraw if needed
-       if (cur.result().screenUpdate())
-               gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
+       // mark that the asynchronous part will reset the model
+       if (!inlineVisible())
+               modelActive_ = false;
 }
 
 
@@ -695,7 +682,7 @@ void GuiCompleter::tab()
                cur.inset().insertCompletion(cur, docstring(), true);
                
                // hide popup and inline completion
-               hidePopup(cur);
+               hidePopup();
                hideInline(cur);
                updateVisibility(false, false);
                cur.endUndoGroup();
@@ -888,7 +875,7 @@ void GuiCompleter::popupActivated(const QString & completion)
        docstring prefix = cur.inset().completionPrefix(cur);
        docstring postfix = qstring_to_ucs4(completion.mid(prefix.length()));
        cur.inset().insertCompletion(cur, postfix, true);
-       hidePopup(cur);
+       hidePopup();
        hideInline(cur);
        
        if (cur.result().screenUpdate())
index 5e96ac3c68a21bb0e2b374b148e0b8d2194c9760..20b50e7ab46d85b6475e300426fa25f9215defc4 100644 (file)
@@ -105,8 +105,6 @@ private:
        ///
        void showInline(Cursor const & cur);
        ///
-       void hidePopup(Cursor & cur);
-       ///
        void hideInline(Cursor const & cur);
        ///
        void updatePopup(Cursor const & cur);