// 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;
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:
// 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;
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 {
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 :
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();
bv->owner()->getMiniBuffer()->Set(_("Found."));
result = true;
} else {
- LyXBell();
bv->owner()->getMiniBuffer()->Set(_("String not found!"));
result = false;
}