]> git.lyx.org Git - features.git/commitdiff
Fixed S&R functions with insets.
authorJürgen Vigna <jug@sad.it>
Mon, 13 Aug 2001 11:27:53 +0000 (11:27 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 13 Aug 2001 11:27:53 +0000 (11:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2497 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insettext.C
src/lyxfind.C

index b52f7c6ca868e4a7e242cf78a17122016cb83c61..7538ed4050d3969540447b3ac99f560a0fadaadc 100644 (file)
@@ -2,6 +2,8 @@
 
        * lyxfind.C (LyXReplace): fixed not single-replacing characters with
        casesensitive off.
+       (SearchBackward): comment out the unlocking of the inset_owner this
+       should not be needed!
 
 2001-08-11  Dekel Tsur  <dekelts@tau.ac.il>
 
index 3f8f4a0cf0ada64a58b32c7e8799428acd2e2465..2a6e14a9bf8f4b8187a723c4ed948ae0ab2246c5 100644 (file)
@@ -1,8 +1,12 @@
 2001-08-13  Juergen Vigna  <jug@sad.it>
 
+       * insetcollapsable.C (edit): don't recollapse an already open inset.
+
        * insettext.C: fixed problem when reinitializing LyXText by not doing
        it while lt is in use and post this to the next possible time in
        getLyXText().
+       (searchForward): fixed not unlocking of inset if nothing found.
+       (edit): set cursor behind right (was set -1 pos).
 
        * insetert.C (InsetERT): init status_ also in the 3rd constructor.
 
index b5c7cb021230d9764ad86f3b6fd940afbcb49e46..ce43acc582135c7dfc603ace9d0a760c7e93a5fe 100644 (file)
@@ -238,6 +238,9 @@ void InsetCollapsable::edit(BufferView * bv, int xp, int yp,
 
        if (collapsed_) {
                collapsed_ = false;
+               // set this only here as it should be recollapsed only if
+               // it was already collapsed!
+               first_after_edit = true;
                if (!bv->lockInset(this))
                        return;
                bv->updateInset(this, true);
@@ -256,7 +259,6 @@ void InsetCollapsable::edit(BufferView * bv, int xp, int yp,
                        inset.edit(bv, xp, yy, button);
                }
        }
-       first_after_edit = true;
 }
 
 
index 4c677b4ce1254474208f263b2b333bfc1f88e153..09a29c4a85feb6c552b946bb2608c534f05e81c8 100644 (file)
@@ -708,8 +708,8 @@ void InsetText::edit(BufferView * bv, bool front)
                Paragraph * p = par;
                while(p->next())
                        p = p->next();
-               int const pos = (p->size() ? p->size()-1 : p->size());
-               lt->setCursor(bv, p, pos);
+//             int const pos = (p->size() ? p->size()-1 : p->size());
+               lt->setCursor(bv, p, p->size());
        }
        lt->clearSelection();
        finishUndo();
@@ -2272,6 +2272,8 @@ bool InsetText::searchForward(BufferView * bv, string const & str,
                if (!lpar) {
                        if (clear)
                                lt = 0;
+                       // we have to unlock ourself in this function by default!
+                       bv->unlockInset(const_cast<InsetText *>(this));
                        return false;
                }
                lt->setCursor(bv, lpar, pos);
index 34d1bfaebe14352a6c6b90958f60285307b42e11..03de70a4695de83e917cf170289c7cedf6558da2 100644 (file)
@@ -311,7 +311,9 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
        if (par) {
                text->setCursor(bv, par, pos);
                return SR_FOUND;
-       } else if (text->inset_owner) {
+       }
+#if 0
+       else if (text->inset_owner) {
                // test if we're inside an inset if yes unlock the inset
                // and recall us with the outside LyXText!
                bv->unlockInset((UpdatableInset *)text->inset_owner);
@@ -319,6 +321,7 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
                        return SearchBackward(bv, bv->getLyXText(), str, cs, mw);
                }
        }
+#endif
        return SR_NOT_FOUND;
 }