+
+
+bool InsetText::searchForward(BufferView * bv, string const & str,
+ bool const & cs, bool const & mw)
+{
+ if (the_locking_inset) {
+ if (the_locking_inset->searchForward(bv, str, cs, mw))
+ return true;
+ bool clear = false;
+ if (!lt) {
+ lt = getLyXText(bv);
+ clear = true;
+ }
+ Paragraph * lpar = lt->cursor.par();
+ Paragraph::size_type pos = lt->cursor.pos();
+ if (pos < lpar->size() - 1)
+ ++pos;
+ else {
+ pos = 0;
+ lpar = lpar->next();
+ }
+ if (!lpar) {
+ if (clear)
+ lt = 0;
+ return false;
+ }
+ lt->setCursor(bv, lpar, pos);
+ if (clear)
+ lt = 0;
+ }
+ if (LyXFind(bv, str, true, true, cs , mw)) {
+ return true;
+ }
+ // we have to unlock ourself in this function by default!
+ bv->unlockInset(const_cast<InsetText *>(this));
+ return false;
+}
+
+bool InsetText::searchBackward(BufferView * bv, string const & str,
+ bool const & cs, bool const & mw)
+{
+ if (the_locking_inset)
+ if (the_locking_inset->searchBackward(bv, str, cs, mw))
+ return true;
+ if (LyXFind(bv, str, false, true, cs, mw)) {
+ return true;
+ }
+ // we have to unlock ourself in this function by default!
+ bv->unlockInset(const_cast<InsetText *>(this));
+ return false;
+}