+2001-08-13 Juergen Vigna <jug@sad.it>
+
+ * lyxfind.C (LyXReplace): fixed not single-replacing characters with
+ casesensitive off.
+
2001-08-11 Dekel Tsur <dekelts@tau.ac.il>
* Many files: Remove inherit_language, and add latex_language
int LyXReplace(BufferView * bv,
string const & searchstr, string const & replacestr,
bool forward, bool casesens, bool matchwrd, bool replaceall,
- bool once)
+ bool once)
{
if (!bv->available() || bv->buffer()->isReadonly())
return 0;
// if nothing selected or selection does not equal search string
// search and select next occurance and return if no replaceall
- if (searchstr!=text->selectionAsString(bv->buffer())) {
+ string str1;
+ string str2;
+ if (casesens) {
+ str1 = searchstr;
+ str2 = text->selectionAsString(bv->buffer());
+ } else {
+ str1 = lowercase(searchstr);
+ str2 = lowercase(text->selectionAsString(bv->buffer()));
+ }
+ if (str1 != str2) {
if (!LyXFind(bv, searchstr, fw, false, casesens, matchwrd) ||
!replaceall)
{
return 0;
}
}
-
+
bool found = false;
int replace_count = 0;
do {
bool LyXFind(BufferView * bv,
string const & searchstr, bool forward,
- bool frominset, bool casesens, bool matchwrd)
+ bool frominset, bool casesens, bool matchwrd)
{
if (!bv->available() || searchstr.empty())
return false;