]> 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 1a390ec4b27cc0c31a6260edf545ff5a18b434b7..33098038ca7643235bb4f6e0d0c5ae030ce51f82 100644 (file)
@@ -110,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_){
@@ -146,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) {
@@ -159,6 +160,7 @@ static vector<string> const & allManualsFiles()
                        v.push_back(fname.absFileName());
                }
        }
+
        return v;
 }
 
@@ -439,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
@@ -448,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);
 }