]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfr1.C
Fix class switching bug
[lyx.git] / src / lyxfr1.C
index b2282715aaf694f83db4d2dbbf2ea272ff8e2a31..76a99e9cca994d5f5eee732329c6b65c132c7e04 100644 (file)
@@ -82,7 +82,7 @@ void SetSelectionOverLenChars(BufferView * bv, int len)
        bv->text->sel_cursor = bv->text->cursor;
        for (int i = 0; i < len; ++i)
                bv->text->CursorRight(bv);
-       bv->text->SetSelection(bv);
+       bv->text->SetSelection();
 }
 
 
@@ -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;
@@ -136,9 +136,9 @@ void LyXFindReplace::SearchReplaceCB()
                // 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());
+                       SetSelectionOverString(bv, replacestring);
                bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
        }
        
@@ -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;
@@ -179,14 +179,14 @@ void LyXFindReplace::SearchReplaceAllCB()
                        bv->update(BufferView::SELECT|BufferView::FITCUR);
                        bv->toggleSelection(false);
                        bv->text->
-                               ReplaceSelectionWithString(bv, replacestring.c_str());
+                               ReplaceSelectionWithString(bv, replacestring);
                        bv->text->
-                               SetSelectionOverString(bv, replacestring.c_str());
+                               SetSelectionOverString(bv, replacestring);
                        bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); 
                        ++replace_count;
                }
        } while (SearchCB(true));
-       if( replace_count == 0 ) {
+       if (replace_count == 0) {
                LyXBell();      
                bv->owner()->getMiniBuffer()->Set(
                        _("String not found!"));