]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfr1.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / lyxfr1.C
index b2282715aaf694f83db4d2dbbf2ea272ff8e2a31..883448250aadc74c59ec8f1d0fc5e476ea0106d3 100644 (file)
@@ -120,7 +120,7 @@ void LyXFindReplace::SearchReplaceCB()
        // in order to avoid endless loop :-(
        if (SF.SearchString().length() == 0
            || (SF.SearchString().length() == 1
-               && SF.SearchString()[0] == ' ') ) {
+               && SF.SearchString()[0] == ' ')) {
                WriteAlert(_("Sorry!"), _("You cannot replace a single space, "
                                          "nor an empty character."));
                return;
@@ -129,17 +129,17 @@ void LyXFindReplace::SearchReplaceCB()
        string const replacestring = SF.ReplaceString();
 
        bv->hideCursor();
-       bv->update(BufferView::SELECT|BufferView::FITCUR);
+       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
 
        LyXText * ltCur = bv->text;     
        if (ltCur->selection) {
                // clear the selection (if there is any) 
                bv->toggleSelection(false);
                bv->text->
-                       ReplaceSelectionWithString(bv, replacestring.c_str());
+                       ReplaceSelectionWithString(bv, replacestring);
                bv->text->
-                       SetSelectionOverString(bv, replacestring.c_str());
-               bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+                       SetSelectionOverString(bv, replacestring);
+               bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
        }
        
        // jump to next match:
@@ -157,7 +157,7 @@ void LyXFindReplace::SearchReplaceAllCB()
        // in order to avoid endless loop :-(
        if (SF.SearchString().length() == 0
            || (SF.SearchString().length() == 1
-               && SF.SearchString()[0] == ' ') ) {
+               && SF.SearchString()[0] == ' ')) {
                WriteAlert(_("Sorry!"), _("You cannot replace a single space, "
                                          "nor an empty character."));
                return;
@@ -176,18 +176,17 @@ void LyXFindReplace::SearchReplaceAllCB()
        do {
                ltCur = bv->text;       
                if (ltCur->selection) {
-                       bv->update(BufferView::SELECT|BufferView::FITCUR);
+                       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
                        bv->toggleSelection(false);
                        bv->text->
-                               ReplaceSelectionWithString(bv, replacestring.c_str());
+                               ReplaceSelectionWithString(bv, replacestring);
                        bv->text->
-                               SetSelectionOverString(bv, replacestring.c_str());
-                       bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); 
+                               SetSelectionOverString(bv, replacestring);
+                       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); 
                        ++replace_count;
                }
        } while (SearchCB(true));
-       if( replace_count == 0 ) {
-               LyXBell();      
+       if (replace_count == 0) {
                bv->owner()->getMiniBuffer()->Set(
                        _("String not found!"));
        } else {
@@ -212,7 +211,7 @@ bool LyXFindReplace::SearchCB(bool fForward)
                return false;
    
        bv->hideCursor();
-       bv->update(BufferView::SELECT|BufferView::FITCUR);
+       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
        LyXText * ltCur = bv->text;
        if (ltCur->selection) 
                ltCur->cursor = fForward ? ltCur->sel_end_cursor :
@@ -223,7 +222,7 @@ bool LyXFindReplace::SearchCB(bool fForward)
    
        if (!SF.ValidSearchData() ||
            (fForward ? SearchForward(bv):SearchBackward(bv))) {
-               bv->update(BufferView::SELECT|BufferView::FITCUR);
+               bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
 
                // clear the selection (if there is any) 
                bv->toggleSelection();
@@ -235,7 +234,6 @@ bool LyXFindReplace::SearchCB(bool fForward)
                bv->owner()->getMiniBuffer()->Set(_("Found."));
                result = true;
        } else {
-               LyXBell();
                bv->owner()->getMiniBuffer()->Set(_("String not found!"));
                result = false;
        }