mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Fixed bug that did not single replace words with casesensitive off sometimes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2495 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7b9594ef0f
commit
4a2096fff1
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -43,7 +43,7 @@ SearchResult SearchBackward(BufferView *, LyXText * text, string const & str,
|
||||
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;
|
||||
@ -76,14 +76,23 @@ int LyXReplace(BufferView * bv,
|
||||
|
||||
// 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 {
|
||||
@ -106,7 +115,7 @@ int LyXReplace(BufferView * bv,
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user