Fixed S&R functions with insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2497 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2001-08-13 11:27:53 +00:00
parent f5394fd982
commit 9f3dd22dd3
5 changed files with 17 additions and 4 deletions

View File

@ -2,6 +2,8 @@
* lyxfind.C (LyXReplace): fixed not single-replacing characters with * lyxfind.C (LyXReplace): fixed not single-replacing characters with
casesensitive off. 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> 2001-08-11 Dekel Tsur <dekelts@tau.ac.il>

View File

@ -1,8 +1,12 @@
2001-08-13 Juergen Vigna <jug@sad.it> 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 * 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 it while lt is in use and post this to the next possible time in
getLyXText(). 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. * insetert.C (InsetERT): init status_ also in the 3rd constructor.

View File

@ -238,6 +238,9 @@ void InsetCollapsable::edit(BufferView * bv, int xp, int yp,
if (collapsed_) { if (collapsed_) {
collapsed_ = false; 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)) if (!bv->lockInset(this))
return; return;
bv->updateInset(this, true); bv->updateInset(this, true);
@ -256,7 +259,6 @@ void InsetCollapsable::edit(BufferView * bv, int xp, int yp,
inset.edit(bv, xp, yy, button); inset.edit(bv, xp, yy, button);
} }
} }
first_after_edit = true;
} }

View File

@ -708,8 +708,8 @@ void InsetText::edit(BufferView * bv, bool front)
Paragraph * p = par; Paragraph * p = par;
while(p->next()) while(p->next())
p = p->next(); p = p->next();
int const pos = (p->size() ? p->size()-1 : p->size()); // int const pos = (p->size() ? p->size()-1 : p->size());
lt->setCursor(bv, p, pos); lt->setCursor(bv, p, p->size());
} }
lt->clearSelection(); lt->clearSelection();
finishUndo(); finishUndo();
@ -2272,6 +2272,8 @@ bool InsetText::searchForward(BufferView * bv, string const & str,
if (!lpar) { if (!lpar) {
if (clear) if (clear)
lt = 0; lt = 0;
// we have to unlock ourself in this function by default!
bv->unlockInset(const_cast<InsetText *>(this));
return false; return false;
} }
lt->setCursor(bv, lpar, pos); lt->setCursor(bv, lpar, pos);

View File

@ -311,7 +311,9 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
if (par) { if (par) {
text->setCursor(bv, par, pos); text->setCursor(bv, par, pos);
return SR_FOUND; 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 // test if we're inside an inset if yes unlock the inset
// and recall us with the outside LyXText! // and recall us with the outside LyXText!
bv->unlockInset((UpdatableInset *)text->inset_owner); bv->unlockInset((UpdatableInset *)text->inset_owner);
@ -319,6 +321,7 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
return SearchBackward(bv, bv->getLyXText(), str, cs, mw); return SearchBackward(bv, bv->getLyXText(), str, cs, mw);
} }
} }
#endif
return SR_NOT_FOUND; return SR_NOT_FOUND;
} }