]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/FindAndReplace.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / FindAndReplace.cpp
index 19c0bacf123827be448668bb9ae6e6368abcff50..33098038ca7643235bb4f6e0d0c5ae030ce51f82 100644 (file)
 #include "qt_helpers.h"
 #include "Language.h"
 
+#include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferList.h"
+#include "BufferView.h"
+#include "Text.h"
 #include "TextClass.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
+#include "LyX.h"
 #include "lyxfind.h"
 
 #include "frontends/alert.h"
@@ -68,9 +72,11 @@ FindAndReplaceWidget::FindAndReplaceWidget(GuiView & view)
 void FindAndReplaceWidget::dockLocationChanged(Qt::DockWidgetArea area)
 {
        if (area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea) {
-               dynamicLayout_->setDirection(QBoxLayout::TopToBottom);
+               dynamicLayoutBasic_->setDirection(QBoxLayout::TopToBottom);
+               dynamicLayoutAdvanced_->setDirection(QBoxLayout::TopToBottom);
        } else {
-               dynamicLayout_->setDirection(QBoxLayout::LeftToRight);
+               dynamicLayoutBasic_->setDirection(QBoxLayout::LeftToRight);
+               dynamicLayoutAdvanced_->setDirection(QBoxLayout::LeftToRight);
        }
 }
 
@@ -104,8 +110,8 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
                // back to how it was
                searchbackCB->setChecked(searchback);
                return true;
-               break;
-               }
+       }
+
        case Qt::Key_Tab:
                if (e->modifiers() == Qt::NoModifier) {
                        if (obj == find_work_area_){
@@ -140,12 +146,13 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
 
 static vector<string> const & allManualsFiles() 
 {
-       static vector<string> v;
        static const char * files[] = {
                "Intro", "UserGuide", "Tutorial", "Additional",
                "EmbeddedObjects", "Math", "Customization", "Shortcuts",
                "LFUNs", "LaTeXConfig"
        };
+
+       static vector<string> v;
        if (v.empty()) {
                FileName fname;
                for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); ++i) {
@@ -153,6 +160,7 @@ static vector<string> const & allManualsFiles()
                        v.push_back(fname.absFileName());
                }
        }
+
        return v;
 }
 
@@ -433,6 +441,12 @@ bool FindAndReplaceWidget::findAndReplace(
                scope = FindAndReplaceOptions::S_ALL_MANUALS;
        else
                LATTEST(false);
+
+       FindAndReplaceOptions::SearchRestriction restr =
+               OnlyMaths->isChecked()
+                       ? FindAndReplaceOptions::R_ONLY_MATHS
+                       : FindAndReplaceOptions::R_EVERYTHING;
+
        LYXERR(Debug::FIND, "FindAndReplaceOptions: "
               << "find_buf_name=" << find_buf_name
               << ", casesensitiv=" << casesensitive
@@ -442,10 +456,12 @@ bool FindAndReplaceWidget::findAndReplace(
               << ", ignoreformat=" << ignoreformat
               << ", repl_buf_name" << repl_buf_name
               << ", keep_case=" << keep_case
-              << ", scope=" << scope);
+              << ", scope=" << scope
+              << ", restr=" << restr);
+
        FindAndReplaceOptions opt(find_buf_name, casesensitive, matchword,
                                  !backwards, expandmacros, ignoreformat,
-                                 repl_buf_name, keep_case, scope);
+                                 repl_buf_name, keep_case, scope, restr);
        return findAndReplaceScope(opt, replace_all);
 }