]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSearch.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiSearch.cpp
index fd401e7afd74728b79582b52eb4d89069a23cf8e..a8f10e7c63cf59b1169b0c5b59911e2cb495c9d8 100644 (file)
 
 #include "GuiSearch.h"
 
+#include "qt_helpers.h"
+
 #include "FuncRequest.h"
 #include "lyxfind.h"
 
-#include "qt_helpers.h"
-
 #include <QLineEdit>
-#include <QCloseEvent>
 #include <QShowEvent>
 
 using namespace std;
@@ -34,7 +33,7 @@ static void uniqueInsert(QComboBox * box, QString const & text)
                if (box->itemText(i) == text)
                        return;
 
-       box->addItem(text);
+       box->insertItem(0, text);
 }
 
 
@@ -65,18 +64,12 @@ GuiSearch::GuiSearch(GuiView & lv)
 
 void GuiSearch::showEvent(QShowEvent * e)
 {
+       findPB->setFocus();
        findCO->lineEdit()->selectAll();
        GuiDialog::showEvent(e);
 }
 
 
-void GuiSearch::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       GuiDialog::closeEvent(e);
-}
-
-
 void GuiSearch::findChanged()
 {
        if (findCO->currentText().isEmpty()) {
@@ -136,7 +129,7 @@ void GuiSearch::replace(docstring const & search, docstring const & replace,
                            bool forward, bool all)
 {
        docstring const data =
-               replace2string(search, replace, casesensitive,
+               replace2string(replace, search, casesensitive,
                                     matchword, all, forward);
        dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
 }
@@ -148,4 +141,4 @@ Dialog * createGuiSearch(GuiView & lv) { return new GuiSearch(lv); }
 } // namespace lyx
 
 
-#include "GuiSearch_moc.cpp"
+#include "moc_GuiSearch.cpp"