]> git.lyx.org Git - features.git/commitdiff
FindAndReplace: more simplification.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 22 Nov 2008 17:54:59 +0000 (17:54 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 22 Nov 2008 17:54:59 +0000 (17:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27669 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/FindAndReplace.cpp
src/frontends/qt4/FindAndReplace.h

index 2a0024a89ae1ca2788f957e805814fcf0596ee0b..829828b047a8366affdbe80102be2f274993723d 100644 (file)
@@ -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<GuiView &>(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"));
 }
 
 
index f1f89b0b01ea0019c9a9485c5e7be5e813d11ecb..62b2b738a050034c0010f68a0fed6f542bed056f 100644 (file)
@@ -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() {}