]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSearch.cpp
Properly track the lifetime of signals2::slots (#8261)
[lyx.git] / src / frontends / qt4 / GuiSearch.cpp
index 5564ac567d7dcb91917a999bd2006227db17412e..411ba2ef10eda0c98536a1aaba5f80ff20c7bc84 100644 (file)
 
 #include <config.h>
 
-#include "GuiSearch.h"
-
+#include "lyxfind.h"
 #include "qt_helpers.h"
-
 #include "FuncRequest.h"
-#include "lyxfind.h"
+#include "BufferView.h"
+#include "Buffer.h"
+#include "Cursor.h"
+#include "GuiSearch.h"
+#include "GuiView.h"
+
+#include "support/gettext.h"
+#include "frontends/alert.h"
 
 #include <QLineEdit>
 #include <QShowEvent>
@@ -33,7 +38,7 @@ static void uniqueInsert(QComboBox * box, QString const & text)
                if (box->itemText(i) == text)
                        return;
 
-       box->addItem(text);
+       box->insertItem(0, text);
 }
 
 
@@ -129,11 +134,12 @@ 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));
 }
 
+
 Dialog * createGuiSearch(GuiView & lv) { return new GuiSearch(lv); }
 
 
@@ -141,4 +147,4 @@ Dialog * createGuiSearch(GuiView & lv) { return new GuiSearch(lv); }
 } // namespace lyx
 
 
-#include "GuiSearch_moc.cpp"
+#include "moc_GuiSearch.cpp"