]> git.lyx.org Git - features.git/commitdiff
Fixed some s+r bugs.
authorJürgen Vigna <jug@sad.it>
Thu, 25 Jul 2002 15:42:35 +0000 (15:42 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 25 Jul 2002 15:42:35 +0000 (15:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4788 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insettabular.C
src/lyxfind.C

index 977da970f3bbed63b6d691da12cf2855f0074a8c..e71021c512d04281b41b51eb1b51ebb523c99c12 100644 (file)
@@ -1,5 +1,8 @@
 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>
index 14cce5fbd245f6a1221913a73d01c109357f7d5f..373bc186a07dfd94a56f143bcb3945873683999f 100644 (file)
@@ -2,6 +2,7 @@
 
        * 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>
 
index 5b1f628f165bd1c28fd25d47e95a98ca4a4321b9..2f093054a46d23b4a0865bb80229c751b1998551 100644 (file)
@@ -2753,14 +2753,19 @@ bool InsetTabular::searchForward(BufferView * bv, string const & str,
                        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;
 }
 
index 0b2a5c5906f44411e41f7fcb3f07e798ebd5982f..4275b085b19372f6ea4f1f13cacfc9fb02456aad 100644 (file)
@@ -85,13 +85,15 @@ int LyXReplace(BufferView * bv,
        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);