2002-07-25 Juergen Vigna <jug@sad.it>
+ * lyxfind.C (LyXReplace): don't replace if we don't get the
+ right LyXText.
+
* undo_funcs.C (createUndo): remove debugging code.
2002-07-25 Dekel Tsur <dekelts@tau.ac.il>
* insettabular.C (insetMotionNotify): Don't update the screen
if we didn't do nothing.
+ (searchForward): last cell was not checked.
2002-07-25 Dekel Tsur <dekelts@tau.ac.il>
return true;
}
}
- do {
- InsetText * inset = tabular->GetCellInset(actcell);
+ InsetText * inset = tabular->GetCellInset(actcell);
+ if (inset->searchForward(bv, str, cs, mw)) {
+ updateLocal(bv, FULL, false);
+ return true;
+ }
+ while (!tabular->IsLastCell(actcell)) {
+ ++actcell;
+ inset = tabular->GetCellInset(actcell);
if (inset->searchForward(bv, str, cs, mw)) {
updateLocal(bv, FULL, false);
return true;
}
- ++actcell;
- } while (!tabular->IsLastCell(actcell));
+ }
return false;
}
int replace_count = 0;
do {
text = bv->getLyXText();
- bv->hideCursor();
- bv->update(text, BufferView::SELECT|BufferView::FITCUR);
- bv->toggleSelection(false);
- text->replaceSelectionWithString(bv, replacestr);
- text->setSelectionOverString(bv, replacestr);
- bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
- ++replace_count;
+ if (!bv->theLockingInset() || text != bv->text) {
+ bv->hideCursor();
+ bv->update(text, BufferView::SELECT|BufferView::FITCUR);
+ bv->toggleSelection(false);
+ text->replaceSelectionWithString(bv, replacestr);
+ text->setSelectionOverString(bv, replacestr);
+ bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ ++replace_count;
+ }
if (!once)
found = LyXFind(bv, searchstr, fw, casesens, matchwrd);
} while (!once && replaceall && found);