X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxfind.C;h=70c9de2c51b98763d5052204542ee52b7ed22ac0;hb=c90c5e6386ce69c34c99b3594d6fa452e6a13161;hp=27b9a6a38882301a77857e98e6231e54d073e638;hpb=b95e8f250dca6264900d8aedf98e8a24411c36d4;p=lyx.git diff --git a/src/lyxfind.C b/src/lyxfind.C index 27b9a6a388..70c9de2c51 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -118,7 +118,11 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos, string::size_type size = str.length(); LyXParagraph::size_type i = 0; +#ifndef NEW_INSETS while (((pos + i) < par->Last()) +#else + while (((pos + i) < par->size()) +#endif && (string::size_type(i) < size) && (cs ? (str[i] == par->GetChar(pos + i)) : (toupper(str[i]) == toupper(par->GetChar(pos + i))))) @@ -129,7 +133,11 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos, // if necessary, check whether string matches word if (!mw || (mw && ((pos <= 0 || !IsLetterCharOrDigit(par->GetChar(pos - 1))) +#ifndef NEW_INSETS && (pos + size >= par->Last() +#else + && (pos + size >= par->size() +#endif || !IsLetterCharOrDigit(par->GetChar(pos + size)))) ) ) @@ -148,7 +156,11 @@ bool SearchForward(BufferView * bv, string const & str, LyXParagraph::size_type pos = bv->text->cursor.pos(); while (par && !IsStringInText(par, pos, str, cs, mw)) { +#ifndef NEW_INSETS if (pos < par->Last() - 1) +#else + if (pos < par->size() - 1) +#endif ++pos; else { pos = 0; @@ -181,7 +193,11 @@ bool SearchBackward(BufferView * bv, string const & str, do { par = par->previous(); if (par) +#ifndef NEW_INSETS pos = par->Last() - 1; +#else + pos = par->size() - 1; +#endif } while (par && pos < 0); } } while (par && !IsStringInText(par, pos, str, cs, mw));