From: André Pönitz Date: Mon, 21 Apr 2008 19:12:15 +0000 (+0000) Subject: fix #4758 X-Git-Tag: 1.6.10~5059 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d61ceb81d1d01667e7539b2d69ac589a30d1b9d;p=lyx.git fix #4758 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24416 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiCompleter.cpp b/src/frontends/qt4/GuiCompleter.cpp index c22eaa0fb3..72589dac41 100644 --- a/src/frontends/qt4/GuiCompleter.cpp +++ b/src/frontends/qt4/GuiCompleter.cpp @@ -10,7 +10,7 @@ #include -#include "GuiWorkArea.h" +#include "GuiCompleter.h" #include "Buffer.h" #include "BufferView.h" @@ -18,6 +18,7 @@ #include "Cursor.h" #include "Dimension.h" #include "FuncRequest.h" +#include "GuiWorkArea.h" #include "GuiView.h" #include "LyXFunc.h" #include "LyXRC.h" diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index c10c5924a9..9882c3a840 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -18,6 +18,7 @@ #include "Dialog.h" #include "FileDialog.h" #include "GuiApplication.h" +#include "GuiCompleter.h" #include "GuiWorkArea.h" #include "GuiKeySymbol.h" #include "GuiToolbar.h" diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 9bed56018f..f040777e3c 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -21,6 +21,7 @@ #include "Font.h" #include "FuncRequest.h" #include "GuiApplication.h" +#include "GuiCompleter.h" #include "GuiKeySymbol.h" #include "GuiPainter.h" #include "GuiView.h" @@ -229,7 +230,7 @@ GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & lv) : buffer_view_(new BufferView(buffer)), lyx_view_(&lv), cursor_visible_(false), need_resize_(false), schedule_redraw_(false), - preedit_lines_(1), completer_(this) + preedit_lines_(1), completer_(new GuiCompleter(this)) { buffer.workAreaManager().add(this); // Setup the signals @@ -450,7 +451,7 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod) // Skip these when selecting if (cmd.action != LFUN_MOUSE_MOTION) { - completer_.updateVisibility(false, false); + completer_->updateVisibility(false, false); lyx_view_->updateLayoutList(); lyx_view_->updateToolbars(); } @@ -525,9 +526,9 @@ void GuiWorkArea::showCursor() // show cursor on screen bool completable = cur.inset().showCompletionCursor() - && completer_.completionAvailable() - && !completer_.popupVisible() - && !completer_.inlineVisible(); + && completer_->completionAvailable() + && !completer_->popupVisible() + && !completer_->inlineVisible(); if (cursorInView) { cursor_visible_ = true; showCursor(x, y, h, l_shape, isrtl, completable); @@ -811,11 +812,11 @@ void GuiWorkArea::generateSyntheticMouseEvent() void GuiWorkArea::keyPressEvent(QKeyEvent * ev) { // intercept some keys if completion popup is visible - if (completer_.popupVisible()) { + if (completer_->popupVisible()) { switch (ev->key()) { case Qt::Key_Enter: case Qt::Key_Return: - completer_.activate(); + completer_->activate(); ev->accept(); return; } @@ -823,19 +824,19 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * ev) // intercept keys for the completion if (ev->key() == Qt::Key_Tab) { - completer_.tab(); + completer_->tab(); ev->accept(); return; } - if (completer_.popupVisible() && ev->key() == Qt::Key_Escape) { - completer_.hidePopup(); + if (completer_->popupVisible() && ev->key() == Qt::Key_Escape) { + completer_->hidePopup(); ev->accept(); return; } - if (completer_.inlineVisible() && ev->key() == Qt::Key_Escape) { - completer_.hideInline(); + if (completer_->inlineVisible() && ev->key() == Qt::Key_Escape) { + completer_->hideInline(); ev->accept(); return; } diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index 86da009bfb..b868353563 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -14,7 +14,6 @@ #define WORKAREA_H #include "frontends/WorkArea.h" -#include "frontends/qt4/GuiCompleter.h" #include "DocIterator.h" #include "FuncRequest.h" @@ -48,6 +47,7 @@ class Buffer; namespace frontend { +class GuiCompleter; class GuiView; class GuiWorkArea; @@ -128,7 +128,7 @@ public: void resizeBufferView(); /// - GuiCompleter & completer() { return completer_; } + GuiCompleter & completer() { return *completer_; } Q_SIGNALS: /// @@ -237,7 +237,7 @@ private: int preedit_lines_; /// - GuiCompleter completer_; + GuiCompleter * completer_; }; // GuiWorkArea