}
-bool InsetText::nextChange(BufferView * bv, lyx::pos_type & length)
-{
- if (the_locking_inset) {
- if (the_locking_inset->nextChange(bv, length))
- return true;
- text_.cursorRight(true);
- }
- lyx::find::SearchResult result =
- lyx::find::findNextChange(bv, &text_, length);
-
- if (result == lyx::find::SR_FOUND) {
- LyXCursor cur = text_.cursor;
- bv->unlockInset(bv->theLockingInset());
- if (bv->lockInset(this))
- locked = true;
- text_.cursor = cur;
- text_.setSelectionRange(length);
- updateLocal(bv, false);
- }
- return result != lyx::find::SR_NOT_FOUND;
-}
-
-
-bool InsetText::searchForward(BufferView * bv, string const & str,
- bool cs, bool mw)
-{
- if (the_locking_inset) {
- if (the_locking_inset->searchForward(bv, str, cs, mw))
- return true;
- text_.cursorRight(true);
- }
- lyx::find::SearchResult result =
- lyx::find::find(bv, &text_, str, true, cs, mw);
-
- if (result == lyx::find::SR_FOUND) {
- LyXCursor cur = text_.cursor;
- bv->unlockInset(bv->theLockingInset());
- if (bv->lockInset(this))
- locked = true;
- text_.cursor = cur;
- text_.setSelectionRange(str.length());
- updateLocal(bv, false);
- }
- return result != lyx::find::SR_NOT_FOUND;
-}
-
-
-bool InsetText::searchBackward(BufferView * bv, string const & str,
- bool cs, bool mw)
-{
- if (the_locking_inset) {
- if (the_locking_inset->searchBackward(bv, str, cs, mw))
- return true;
- }
- if (!locked) {
- text_.setCursor(paragraphs.size() - 1, paragraphs.back().size());
- }
- lyx::find::SearchResult result =
- lyx::find::find(bv, &text_, str, false, cs, mw);
-
- if (result == lyx::find::SR_FOUND) {
- LyXCursor cur = text_.cursor;
- bv->unlockInset(bv->theLockingInset());
- if (bv->lockInset(this))
- locked = true;
- text_.cursor = cur;
- text_.setSelectionRange(str.length());
- updateLocal(bv, false);
- }
- return result != lyx::find::SR_NOT_FOUND;
-}
-
-
bool InsetText::checkInsertChar(LyXFont & font)
{
return owner() ? owner()->checkInsertChar(font) : true;