#include "lyxtext.h"
#include "lyxfind.h"
#include "LyXView.h"
-#include "minibuffer.h"
#include "lyx_gui_misc.h"
#include "support/textutils.h"
#include "support/lstrings.h"
#include "BufferView.h"
#include "buffer.h"
+#include "gettext.h"
int LyXReplace(BufferView * bv,
- string const & searchstr,
- string const & replacestr,
- bool const & casesens,
- bool const & matchwrd,
- bool const & forward,
- bool const & replaceall)
+ string const & searchstr,
+ string const & replacestr,
+ bool const & casesens,
+ bool const & matchwrd,
+ bool const & forward,
+ bool const & replaceall)
{
int replace_count = 0;
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)))))
// 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))))
)
)
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;
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));