[BUG_FIXED] (Author:Alexander van der Lokken) Fix "Replace all" feature hangs on the Regular Expression '$'.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@795 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2011-07-24 01:25:55 +00:00
parent 1b590704f6
commit d31369f267
1 changed files with 6 additions and 2 deletions

View File

@ -1639,6 +1639,12 @@ int FindReplaceDlg::processRange(ProcessOperation op, const TCHAR *txt2find, con
}
}
nbProcessed++;
// After the processing of the last string occurence the search loop should be stopped
// This helps to avoid the endless replacement during the EOL ("$") searching
if( targetStart + foundTextLen == endRange )
break;
if (!foundTextLen && !replaceDelta)
startRange = targetStart + foundTextLen + 1; // find a empty string so just step forword
@ -1646,8 +1652,6 @@ int FindReplaceDlg::processRange(ProcessOperation op, const TCHAR *txt2find, con
startRange = targetStart + foundTextLen + replaceDelta; //search from result onwards
endRange += replaceDelta; //adjust end of range in case of replace
nbProcessed++;
targetStart = (*_ppEditView)->searchInTarget(pTextFind, stringSizeFind, startRange, endRange);
}
delete [] pTextFind;