From 6f305f211d192872796a3237803f80fd0507fdb7 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 22 Nov 2008 17:54:59 +0000 Subject: [PATCH] FindAndReplace: more simplification. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27669 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/FindAndReplace.cpp | 16 ++++++++-------- src/frontends/qt4/FindAndReplace.h | 4 ---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 2a0024a89a..829828b047 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -44,11 +44,10 @@ namespace lyx { namespace frontend { FindAndReplace::FindAndReplace(GuiView & parent) - : DockView(parent, "Find LyX", "Find LyX Dialog", Qt::RightDockWidgetArea), - parent_view_(parent) + : DockView(parent, "Find LyX", "Find LyX Dialog", Qt::RightDockWidgetArea) { setupUi(this); - find_work_area_->setGuiView(parent_view_); + find_work_area_->setGuiView(parent); find_work_area_->init(); setFocusProxy(find_work_area_); } @@ -144,13 +143,16 @@ bool FindAndReplace::initialiseParams(std::string const &) void FindAndReplace::find(bool backwards) { - parent_view_.setCurrentWorkArea(parent_view_.currentMainWorkArea()); + // FIXME: create a Dialog::returnFocus() or something instead of this: + GuiView & gv = const_cast(lyxview()); + gv.setCurrentWorkArea(gv.currentMainWorkArea()); + // FIXME: This should be an LFUN. findAdv(caseCB->isChecked(), wordsCB->isChecked(), backwards, expandMacrosCB->isChecked(), ignoreFormatCB->isChecked()); - parent_view_.currentMainWorkArea()->redraw(); + gv.currentMainWorkArea()->redraw(); find_work_area_->setFocus(); } @@ -174,9 +176,7 @@ void FindAndReplace::on_regexpInsertCombo_currentIndexChanged(int index) void FindAndReplace::on_closePB_clicked() { - find_work_area_->disable(); - LYXERR(Debug::DEBUG, "Dispatching dialog-hide findreplaceadv" << std::endl); - parent_view_.dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplaceadv")); + dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplaceadv")); } diff --git a/src/frontends/qt4/FindAndReplace.h b/src/frontends/qt4/FindAndReplace.h index f1f89b0b01..62b2b738a0 100644 --- a/src/frontends/qt4/FindAndReplace.h +++ b/src/frontends/qt4/FindAndReplace.h @@ -65,10 +65,6 @@ private: bool matchword, bool backwards, bool expandmacros, bool ignoreformat); - GuiView & parent_view_; - - GuiWorkArea * searchWorkArea_; // The work area defining what to search - private: /// Apply changes virtual void apply() {}