From 8cabbae616bf5415bd29d98f9de38fe07410c88c Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 2 Dec 2011 22:44:38 +0000 Subject: [PATCH] The Cursor argument here was not being used, so there is no need 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 | 47 +++++++++++------------------- src/frontends/qt4/GuiCompleter.h | 2 -- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/frontends/qt4/GuiCompleter.cpp b/src/frontends/qt4/GuiCompleter.cpp index 06ed395221..7ef1a1a579 100644 --- a/src/frontends/qt4/GuiCompleter.cpp +++ b/src/frontends/qt4/GuiCompleter.cpp @@ -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()) diff --git a/src/frontends/qt4/GuiCompleter.h b/src/frontends/qt4/GuiCompleter.h index 5e96ac3c68..20b50e7ab4 100644 --- a/src/frontends/qt4/GuiCompleter.h +++ b/src/frontends/qt4/GuiCompleter.h @@ -105,8 +105,6 @@ private: /// void showInline(Cursor const & cur); /// - void hidePopup(Cursor & cur); - /// void hideInline(Cursor const & cur); /// void updatePopup(Cursor const & cur); -- 2.39.5