Replace all should save the position of the first occurence of the found string, because otherwise replace all could result in an endless loop if combined with wrap around and a replace string containing the search string.
Analysis:
Some additional logic has to be implemented in NumeReWindow::ReplaceAllStrings(), e.g. going to Position 0 and removing the wxFR_WRAPAROUND flag locally, if this flag was set.
Implementation:
The following lines were added to the function ReplaceAllStrings():
if (flags & wxFR_WRAPAROUND)
{
m_currentEd->GotoPos(0);
flags &= flags & ~wxFR_WRAPAROUND;
}
This prevents NumeRe from looping.
Additionally the following issues were processed:
Documentation:
Not needed - Bug fix.
Tests:
Repeated tests of the replace all functionality with replace strings containing the search string were passed without any deviation. Search and replace dialogs working as expected. Bug fix accepted.
Anonymous
Diff:
Diff:
Diff:
Diff: