Fixed some s+r bugs.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4788 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-07-25 15:42:35 +00:00
parent 6e1b894e38
commit 2232b64760
4 changed files with 22 additions and 11 deletions

View File

@ -1,5 +1,8 @@
2002-07-25 Juergen Vigna <jug@sad.it> 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. * undo_funcs.C (createUndo): remove debugging code.
2002-07-25 Dekel Tsur <dekelts@tau.ac.il> 2002-07-25 Dekel Tsur <dekelts@tau.ac.il>

View File

@ -2,6 +2,7 @@
* insettabular.C (insetMotionNotify): Don't update the screen * insettabular.C (insetMotionNotify): Don't update the screen
if we didn't do nothing. if we didn't do nothing.
(searchForward): last cell was not checked.
2002-07-25 Dekel Tsur <dekelts@tau.ac.il> 2002-07-25 Dekel Tsur <dekelts@tau.ac.il>

View File

@ -2753,14 +2753,19 @@ bool InsetTabular::searchForward(BufferView * bv, string const & str,
return true; 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)) { if (inset->searchForward(bv, str, cs, mw)) {
updateLocal(bv, FULL, false); updateLocal(bv, FULL, false);
return true; return true;
} }
++actcell; }
} while (!tabular->IsLastCell(actcell));
return false; return false;
} }

View File

@ -85,13 +85,15 @@ int LyXReplace(BufferView * bv,
int replace_count = 0; int replace_count = 0;
do { do {
text = bv->getLyXText(); text = bv->getLyXText();
bv->hideCursor(); if (!bv->theLockingInset() || text != bv->text) {
bv->update(text, BufferView::SELECT|BufferView::FITCUR); bv->hideCursor();
bv->toggleSelection(false); bv->update(text, BufferView::SELECT|BufferView::FITCUR);
text->replaceSelectionWithString(bv, replacestr); bv->toggleSelection(false);
text->setSelectionOverString(bv, replacestr); text->replaceSelectionWithString(bv, replacestr);
bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); text->setSelectionOverString(bv, replacestr);
++replace_count; bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
++replace_count;
}
if (!once) if (!once)
found = LyXFind(bv, searchstr, fw, casesens, matchwrd); found = LyXFind(bv, searchstr, fw, casesens, matchwrd);
} while (!once && replaceall && found); } while (!once && replaceall && found);